summaryrefslogtreecommitdiff
path: root/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
committerOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
commit1d0be15f89cb5056e20e2d24faa8d6afb1573bca (patch)
tree2cdabe223bfce83bd12e10dd557147a2f68c9bf8 /lib/VMCore/AsmWriter.cpp
parentd163e8b14c8aa5bbbb129e3f0dffdbe7213a3c72 (diff)
downloadllvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.gz
llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.bz2
llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.xz
Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r--lib/VMCore/AsmWriter.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index b6d98b8573..8270f1723f 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -685,7 +685,8 @@ void SlotTracker::processFunction() {
CreateFunctionSlot(BB);
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E;
++I) {
- if (I->getType() != Type::VoidTy && !I->hasName())
+ if (I->getType() != Type::getVoidTy(TheFunction->getContext()) &&
+ !I->hasName())
CreateFunctionSlot(I);
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
if (MDNode *N = dyn_cast<MDNode>(I->getOperand(i)))
@@ -767,7 +768,8 @@ int SlotTracker::getLocalSlot(const Value *V) {
/// CreateModuleSlot - Insert the specified GlobalValue* into the slot table.
void SlotTracker::CreateModuleSlot(const GlobalValue *V) {
assert(V && "Can't insert a null Value into SlotTracker!");
- assert(V->getType() != Type::VoidTy && "Doesn't need a slot!");
+ assert(V->getType() != Type::getVoidTy(V->getContext()) &&
+ "Doesn't need a slot!");
assert(!V->hasName() && "Doesn't need a slot!");
unsigned DestSlot = mNext++;
@@ -783,8 +785,8 @@ void SlotTracker::CreateModuleSlot(const GlobalValue *V) {
/// CreateSlot - Create a new slot for the specified value if it has no name.
void SlotTracker::CreateFunctionSlot(const Value *V) {
- assert(V->getType() != Type::VoidTy && !V->hasName() &&
- "Doesn't need a slot!");
+ assert(V->getType() != Type::getVoidTy(TheFunction->getContext()) &&
+ !V->hasName() && "Doesn't need a slot!");
unsigned DestSlot = fNext++;
fMap[V] = DestSlot;
@@ -909,7 +911,7 @@ static void WriteOptimizationInfo(raw_ostream &Out, const User *U) {
static void WriteConstantInt(raw_ostream &Out, const Constant *CV,
TypePrinting &TypePrinter, SlotTracker *Machine) {
if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
- if (CI->getType() == Type::Int1Ty) {
+ if (CI->getType() == Type::getInt1Ty(CV->getContext())) {
Out << (CI->getZExtValue() ? "true" : "false");
return;
}
@@ -1725,7 +1727,7 @@ void AssemblyWriter::printBasicBlock(const BasicBlock *BB) {
/// which slot it occupies.
///
void AssemblyWriter::printInfoComment(const Value &V) {
- if (V.getType() != Type::VoidTy) {
+ if (V.getType() != Type::getVoidTy(V.getContext())) {
Out.PadToColumn(50);
Out << "; <";
TypePrinter.print(V.getType(), Out);
@@ -1744,7 +1746,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
if (I.hasName()) {
PrintLLVMName(Out, &I);
Out << " = ";
- } else if (I.getType() != Type::VoidTy) {
+ } else if (I.getType() != Type::getVoidTy(I.getContext())) {
// Print out the def slot taken.
int SlotNum = Machine.getLocalSlot(&I);
if (SlotNum == -1)