Don't waste as much horizontal space on #uses flag when printing
[oota-llvm.git] / lib / VMCore / Function.cpp
index 9cea29cf227e1c98648adb230791e3a4152d0b1b..4b38ce11965a76d27be12ccc623da4f3862d83d7 100644 (file)
@@ -13,7 +13,6 @@
 #include "llvm/GlobalVariable.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/iOther.h"
-#include "llvm/CodeGen/MachineInstr.h"
 
 //===----------------------------------------------------------------------===//
 // Method Implementation
 template class ValueHolder<MethodArgument, Method, Method>;
 template class ValueHolder<BasicBlock    , Method, Method>;
 
-Method::Method(const MethodType *Ty, const string &name) 
-  : GlobalValue(PointerType::get(Ty), Value::MethodVal, name),
-    SymTabValue(this), BasicBlocks(this), ArgumentList(this, this),
-    machineCode(new MachineCodeForMethod(this)) {
+Method::Method(const MethodType *Ty, bool isInternal, const string &name) 
+  : GlobalValue(PointerType::get(Ty), Value::MethodVal, isInternal, name),
+    SymTabValue(this), BasicBlocks(this), ArgumentList(this, this) {
   assert(::isa<MethodType>(Ty) && "Method signature must be of method type!");
 }
 
@@ -64,7 +62,7 @@ void Method::setParent(Module *parent) {
 }
 
 const MethodType *Method::getMethodType() const {
-  return cast<MethodType>(cast<PointerType>(getType())->getValueType());
+  return cast<MethodType>(cast<PointerType>(getType())->getElementType());
 }
 
 const Type *Method::getReturnType() const { 
@@ -87,11 +85,11 @@ void Method::dropAllReferences() {
 // GlobalVariable Implementation
 //===----------------------------------------------------------------------===//
 
-GlobalVariable::GlobalVariable(const Type *Ty, bool isConstant,
-                              ConstPoolVal *Initializer = 0, 
+GlobalVariable::GlobalVariable(const Type *Ty, bool constant, bool isIntern,
+                              Constant *Initializer = 0,
                               const string &Name = "")
-  : GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal, Name),
-    Constant(isConstant) {
+  : GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal, isIntern, Name),
+    isConstantGlobal(constant) {
   if (Initializer) Operands.push_back(Use((Value*)Initializer, this));
 }