summaryrefslogtreecommitdiff
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-17 03:26:42 +0000
committerChris Lattner <sabre@nondot.org>2007-04-17 03:26:42 +0000
commit17fcdd5e1b78b829068ca657c97357a39d6e768b (patch)
treedb5c01cfda299d428837e2689e9aca31bf1bf556 /lib/VMCore/Function.cpp
parent205c27d4a904c12d1bfb0b2961daab70f286cc20 (diff)
downloadllvm-17fcdd5e1b78b829068ca657c97357a39d6e768b.tar.gz
llvm-17fcdd5e1b78b829068ca657c97357a39d6e768b.tar.bz2
llvm-17fcdd5e1b78b829068ca657c97357a39d6e768b.tar.xz
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
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index edce58d6aa..7949e39f84 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -44,8 +44,8 @@ iplist<Argument> &ilist_traits<Argument>::getList(Function *F) {
// Explicit instantiations of SymbolTableListTraits since some of the methods
// are not in the public header file...
-template class SymbolTableListTraits<Argument, Function, Function>;
-template class SymbolTableListTraits<BasicBlock, Function, Function>;
+template class SymbolTableListTraits<Argument, Function>;
+template class SymbolTableListTraits<BasicBlock, Function>;
//===----------------------------------------------------------------------===//
// Argument Implementation
@@ -144,9 +144,7 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
ParamAttrs = 0;
CallingConvention = 0;
BasicBlocks.setItemParent(this);
- BasicBlocks.setParent(this);
ArgumentList.setItemParent(this);
- ArgumentList.setParent(this);
SymTab = new ValueSymbolTable();
assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy)
@@ -171,7 +169,6 @@ Function::~Function() {
// Delete all of the method arguments and unlink from symbol table...
ArgumentList.clear();
- ArgumentList.setParent(0);
delete SymTab;
}