diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-28 04:50:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-28 04:50:54 +0000 |
commit | fd63f25fbddd433555801b24851155b49c673bef (patch) | |
tree | f9f69687867acbb1f1f03b90d9774ad0f4cdd898 /lib/Target | |
parent | 09c66f07c0f0f2a241fd9737b29932ab360f29d1 (diff) |
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
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/SparcV9/SparcV9AsmPrinter.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp index 83e5487165..77c9d3183a 100644 --- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp +++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp @@ -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_"); } |