mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Simplify code
Remove unneccesary getID variant for module's git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2353 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
09c66f07c0
commit
fd63f25fbd
@ -38,17 +38,10 @@ class GlobalIdTable: public Annotation {
|
||||
typedef ValIdMap::const_iterator ValIdMapConstIterator;
|
||||
typedef ValIdMap:: iterator ValIdMapIterator;
|
||||
public:
|
||||
SlotCalculator *Table; // map anonymous values to unique integer IDs
|
||||
SlotCalculator Table; // map anonymous values to unique integer IDs
|
||||
ValIdMap valToIdMap; // used for values not handled by SlotCalculator
|
||||
|
||||
GlobalIdTable(Module* M) : Annotation(AnnotId) {
|
||||
Table = new SlotCalculator(M, true);
|
||||
}
|
||||
~GlobalIdTable() {
|
||||
delete Table;
|
||||
Table = NULL;
|
||||
valToIdMap.clear();
|
||||
}
|
||||
GlobalIdTable(Module* M) : Annotation(AnnotId), Table(M, true) {}
|
||||
};
|
||||
|
||||
AnnotationID GlobalIdTable::AnnotId =
|
||||
@ -86,10 +79,10 @@ public:
|
||||
}
|
||||
void startFunction(Function *F) {
|
||||
// Make sure the slot table has information about this function...
|
||||
idTable->Table->incorporateFunction(F);
|
||||
idTable->Table.incorporateFunction(F);
|
||||
}
|
||||
void endFunction(Function *F) {
|
||||
idTable->Table->purgeFunction(); // Forget all about F
|
||||
idTable->Table.purgeFunction(); // Forget all about F
|
||||
}
|
||||
void endModule() {
|
||||
}
|
||||
@ -159,7 +152,7 @@ public:
|
||||
|
||||
// Qualify all internal names with a unique id.
|
||||
if (!isExternal(V)) {
|
||||
int valId = idTable->Table->getValSlot(V);
|
||||
int valId = idTable->Table.getValSlot(V);
|
||||
if (valId == -1) {
|
||||
GlobalIdTable::ValIdMapConstIterator I = idTable->valToIdMap.find(V);
|
||||
if (I == idTable->valToIdMap.end())
|
||||
@ -174,9 +167,6 @@ public:
|
||||
}
|
||||
|
||||
// getID Wrappers - Ensure consistent usage...
|
||||
string getID(const Module *M) {
|
||||
return getID(M, "LLVMModule_");
|
||||
}
|
||||
string getID(const Function *F) {
|
||||
return getID(F, "LLVMFunction_");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user