summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-06 20:46:32 +0000
committerChris Lattner <sabre@nondot.org>2002-09-06 20:46:32 +0000
commit6213ae0028c35c11fd7587f70c85b04afd7908a7 (patch)
tree954596ebc1645195d7192895264d570828e840b9 /llvm/lib/VMCore/Function.cpp
parent1871472e1413db0d1ea67e9e2f44f976a7792a48 (diff)
downloadbcm5719-llvm-6213ae0028c35c11fd7587f70c85b04afd7908a7.tar.gz
bcm5719-llvm-6213ae0028c35c11fd7587f70c85b04afd7908a7.zip
* Remove extraneous #includes
* Add extra argument to Function ctor to allow automatic insertion into module llvm-svn: 3600
Diffstat (limited to 'llvm/lib/VMCore/Function.cpp')
-rw-r--r--llvm/lib/VMCore/Function.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 591bd9009f3..3ad7a66c5ce 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/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() {
OpenPOWER on IntegriCloud