diff options
author | Chris Lattner <sabre@nondot.org> | 2007-04-17 03:26:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-04-17 03:26:42 +0000 |
commit | b47aa543bb7a2e1521eea79978dc83cf0c8125bc (patch) | |
tree | 126cbf7131ba7ead6f9c936d3681425a22382fdc /llvm/lib/VMCore/Module.cpp | |
parent | 0ed36f4078d7438f8f100103920912c37d515a7c (diff) | |
download | bcm5719-llvm-b47aa543bb7a2e1521eea79978dc83cf0c8125bc.tar.gz bcm5719-llvm-b47aa543bb7a2e1521eea79978dc83cf0c8125bc.zip |
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.
llvm-svn: 36188
Diffstat (limited to 'llvm/lib/VMCore/Module.cpp')
-rw-r--r-- | llvm/lib/VMCore/Module.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/Module.cpp b/llvm/lib/VMCore/Module.cpp index 016ab16ff52..465cb694458 100644 --- a/llvm/lib/VMCore/Module.cpp +++ b/llvm/lib/VMCore/Module.cpp @@ -55,8 +55,8 @@ iplist<GlobalVariable> &ilist_traits<GlobalVariable>::getList(Module *M) { // Explicit instantiations of SymbolTableListTraits since some of the methods // are not in the public header file. -template class SymbolTableListTraits<GlobalVariable, Module, Module>; -template class SymbolTableListTraits<Function, Module, Module>; +template class SymbolTableListTraits<GlobalVariable, Module>; +template class SymbolTableListTraits<Function, Module>; //===----------------------------------------------------------------------===// // Primitive Module methods. @@ -65,9 +65,7 @@ template class SymbolTableListTraits<Function, Module, Module>; 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; |