[llvm-commits] [llvm] r75072 - in /llvm/trunk/lib/VMCore: Globals.cpp Module.cpp

Owen Anderson resistor at mac.com
Wed Jul 8 16:50:37 PDT 2009


Author: resistor
Date: Wed Jul  8 18:50:31 2009
New Revision: 75072

URL: http://llvm.org/viewvc/llvm-project?rev=75072&view=rev
Log:
LLVMContext-ification.

Modified:
    llvm/trunk/lib/VMCore/Globals.cpp
    llvm/trunk/lib/VMCore/Module.cpp

Modified: llvm/trunk/lib/VMCore/Globals.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Globals.cpp?rev=75072&r1=75071&r2=75072&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Globals.cpp (original)
+++ llvm/trunk/lib/VMCore/Globals.cpp Wed Jul  8 18:50:31 2009
@@ -118,7 +118,8 @@
                                const std::string &Name,
                                GlobalVariable *Before, bool ThreadLocal,
                                unsigned AddressSpace)
-  : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal,
+  : GlobalValue(M.getContext().getPointerType(Ty, AddressSpace), 
+                Value::GlobalVariableVal,
                 OperandTraits<GlobalVariable>::op_begin(this),
                 InitVal != 0, Link, Name),
     isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) {

Modified: llvm/trunk/lib/VMCore/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=75072&r1=75071&r2=75072&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Module.cpp (original)
+++ llvm/trunk/lib/VMCore/Module.cpp Wed Jul  8 18:50:31 2009
@@ -157,8 +157,8 @@
 
   // If the function exists but has the wrong type, return a bitcast to the
   // right type.
-  if (F->getType() != PointerType::getUnqual(Ty))
-    return ConstantExpr::getBitCast(F, PointerType::getUnqual(Ty));
+  if (F->getType() != Context.getPointerTypeUnqual(Ty))
+    return Context.getConstantExprBitCast(F, Context.getPointerTypeUnqual(Ty));
   
   // Otherwise, we just found the existing function or a prototype.
   return F;  
@@ -206,7 +206,8 @@
   va_end(Args);
 
   // Build the function type and chain to the other getOrInsertFunction...
-  return getOrInsertFunction(Name, FunctionType::get(RetTy, ArgTys, false),
+  return getOrInsertFunction(Name,
+                             Context.getFunctionType(RetTy, ArgTys, false),
                              AttributeList);
 }
 
@@ -223,7 +224,8 @@
   va_end(Args);
 
   // Build the function type and chain to the other getOrInsertFunction...
-  return getOrInsertFunction(Name, FunctionType::get(RetTy, ArgTys, false),
+  return getOrInsertFunction(Name, 
+                             Context.getFunctionType(RetTy, ArgTys, false),
                              AttrListPtr::get((AttributeWithIndex *)0, 0));
 }
 
@@ -277,8 +279,8 @@
 
   // If the variable exists but has the wrong type, return a bitcast to the
   // right type.
-  if (GV->getType() != PointerType::getUnqual(Ty))
-    return ConstantExpr::getBitCast(GV, PointerType::getUnqual(Ty));
+  if (GV->getType() != Context.getPointerTypeUnqual(Ty))
+    return Context.getConstantExprBitCast(GV, Context.getPointerTypeUnqual(Ty));
   
   // Otherwise, we just found the existing function or a prototype.
   return GV;





More information about the llvm-commits mailing list