diff options
author | Chris Lattner <sabre@nondot.org> | 2002-09-06 20:46:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-09-06 20:46:32 +0000 |
commit | 482701563a2ff76815d2cd19856469319e7c2d88 (patch) | |
tree | 8db0e9d06d85f53681cc5aa26308e610d3b88de5 /lib/VMCore | |
parent | b0dbd7fc5a4fb08ead75c1c2f3bbe275b85b8082 (diff) | |
download | external_llvm-482701563a2ff76815d2cd19856469319e7c2d88.zip external_llvm-482701563a2ff76815d2cd19856469319e7c2d88.tar.gz external_llvm-482701563a2ff76815d2cd19856469319e7c2d88.tar.bz2 |
* Remove extraneous #includes
* Add extra argument to Function ctor to allow automatic insertion into module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Function.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 591bd90..3ad7a66 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -5,13 +5,9 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Function.h" -#include "llvm/DerivedTypes.h" #include "llvm/Module.h" -#include "llvm/GlobalVariable.h" -#include "llvm/BasicBlock.h" +#include "llvm/DerivedTypes.h" #include "llvm/iOther.h" -#include "llvm/Argument.h" #include "SymbolTableListTraitsImpl.h" iplist<BasicBlock> &ilist_traits<BasicBlock>::getList(Function *F) { @@ -51,13 +47,16 @@ void Argument::setName(const std::string &name, SymbolTable *ST) { Function::Function(const FunctionType *Ty, bool isInternal, - const std::string &name) + const std::string &name, Module *ParentModule) : GlobalValue(PointerType::get(Ty), Value::FunctionVal, isInternal, name) { BasicBlocks.setItemParent(this); BasicBlocks.setParent(this); ArgumentList.setItemParent(this); ArgumentList.setParent(this); ParentSymTab = SymTab = 0; + + if (ParentModule) + ParentModule->getFunctionList().push_back(this); } Function::~Function() { |