[llvm-commits] CVS: llvm/lib/VMCore/Function.cpp
Christopher Lattner
lattner at cs.uiuc.edu
Fri Sep 6 15:47:01 PDT 2002
Changes in directory llvm/lib/VMCore:
Function.cpp updated: 1.28 -> 1.29
---
Log message:
* Remove extraneous #includes
* Add extra argument to Function ctor to allow automatic insertion into module
---
Diffs of the changes:
Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.28 llvm/lib/VMCore/Function.cpp:1.29
--- llvm/lib/VMCore/Function.cpp:1.28 Wed Jul 24 17:08:49 2002
+++ llvm/lib/VMCore/Function.cpp Fri Sep 6 15:46:32 2002
@@ -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 @@
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() {
More information about the llvm-commits
mailing list