From 17fcdd5e1b78b829068ca657c97357a39d6e768b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 17 Apr 2007 03:26:42 +0000 Subject: Refactor SymbolTableListTraits to only have a single pointer in it, instead of two. This shrinkifies Function by 8 bytes (104->96) and Module by 8 bytes (68->60). On a testcase of mine, this reduces the memory used to read a module header from 565680b to 561024, a little over 4K. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36188 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Module.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/VMCore/Module.cpp') diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 016ab16ff5..465cb69445 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -55,8 +55,8 @@ iplist &ilist_traits::getList(Module *M) { // Explicit instantiations of SymbolTableListTraits since some of the methods // are not in the public header file. -template class SymbolTableListTraits; -template class SymbolTableListTraits; +template class SymbolTableListTraits; +template class SymbolTableListTraits; //===----------------------------------------------------------------------===// // Primitive Module methods. @@ -65,9 +65,7 @@ template class SymbolTableListTraits; Module::Module(const std::string &MID) : ModuleID(MID), DataLayout("") { FunctionList.setItemParent(this); - FunctionList.setParent(this); GlobalList.setItemParent(this); - GlobalList.setParent(this); ValSymTab = new ValueSymbolTable(); TypeSymTab = new TypeSymbolTable(); } @@ -75,9 +73,7 @@ Module::Module(const std::string &MID) Module::~Module() { dropAllReferences(); GlobalList.clear(); - GlobalList.setParent(0); FunctionList.clear(); - FunctionList.setParent(0); LibraryList.clear(); delete ValSymTab; delete TypeSymTab; -- cgit v1.2.3-18-g5258