mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
make the datastructure used in BytecodeWriter::outputValueSymbolTable
*slightly* less abusive of memory. This speeds up the bcwriter from 1.83s to 1.32s (39% faster) on 447.dealII. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34140 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1086,14 +1086,14 @@ void BytecodeWriter::outputValueSymbolTable(const ValueSymbolTable &VST) {
|
|||||||
true/*ElideIfEmpty*/);
|
true/*ElideIfEmpty*/);
|
||||||
|
|
||||||
// Organize the symbol table by type
|
// Organize the symbol table by type
|
||||||
typedef std::pair<std::string, const Value*> PlaneMapEntry;
|
typedef std::pair<const std::string*, const Value*> PlaneMapEntry;
|
||||||
typedef std::vector<PlaneMapEntry> PlaneMapVector;
|
typedef std::vector<PlaneMapEntry> PlaneMapVector;
|
||||||
typedef std::map<const Type*, PlaneMapVector > PlaneMap;
|
typedef std::map<const Type*, PlaneMapVector > PlaneMap;
|
||||||
PlaneMap Planes;
|
PlaneMap Planes;
|
||||||
for (ValueSymbolTable::const_iterator SI = VST.begin(), SE = VST.end();
|
for (ValueSymbolTable::const_iterator SI = VST.begin(), SE = VST.end();
|
||||||
SI != SE; ++SI)
|
SI != SE; ++SI)
|
||||||
Planes[SI->second->getType()].push_back(
|
Planes[SI->second->getType()]
|
||||||
std::make_pair(SI->first,SI->second));
|
.push_back(std::make_pair(&SI->first, SI->second));
|
||||||
|
|
||||||
for (PlaneMap::const_iterator PI = Planes.begin(), PE = Planes.end();
|
for (PlaneMap::const_iterator PI = Planes.begin(), PE = Planes.end();
|
||||||
PI != PE; ++PI) {
|
PI != PE; ++PI) {
|
||||||
@@ -1112,7 +1112,7 @@ void BytecodeWriter::outputValueSymbolTable(const ValueSymbolTable &VST) {
|
|||||||
for (; I != End; ++I) {
|
for (; I != End; ++I) {
|
||||||
// Symtab entry: [def slot #][name]
|
// Symtab entry: [def slot #][name]
|
||||||
output_vbr(Table.getSlot(I->second));
|
output_vbr(Table.getSlot(I->second));
|
||||||
output(I->first);
|
output(*I->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user