summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-08-05 23:16:16 +0000
committerOwen Anderson <resistor@mac.com>2009-08-05 23:16:16 +0000
commit03cb69fbd1ef003f94710f2d497515692ff5445a (patch)
tree09edb1b4c08827055064fa639d024649076349d7 /llvm/lib/Transforms/IPO
parente148ceaf65e3704935b8bf0fdc0c7f44283acf6c (diff)
downloadbcm5719-llvm-03cb69fbd1ef003f94710f2d497515692ff5445a.tar.gz
bcm5719-llvm-03cb69fbd1ef003f94710f2d497515692ff5445a.zip
Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
llvm-svn: 78258
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp2
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
index 47f5e65ccdb..06121196181 100644
--- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -638,7 +638,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
// something and {} into void.
// Make the new struct packed if we used to return a packed struct
// already.
- NRetTy = StructType::get(RetTypes, STy->isPacked());
+ NRetTy = StructType::get(STy->getContext(), RetTypes, STy->isPacked());
else if (RetTypes.size() == 1)
// One return type? Just a simple value then, but only if we didn't use to
// return a struct with that simple value before.
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 35e3fe91f57..0048b097a8b 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1961,7 +1961,7 @@ static GlobalVariable *InstallGlobalCtors(GlobalVariable *GCL,
CSVals[1] = Constant::getNullValue(PFTy);
CSVals[0] = ConstantInt::get(Type::Int32Ty, 2147483647);
}
- CAList.push_back(ConstantStruct::get(CSVals));
+ CAList.push_back(ConstantStruct::get(Context, CSVals));
}
// Create the array initializer.
@@ -2069,7 +2069,7 @@ static Constant *EvaluateStoreInto(Constant *Init, Constant *Val,
Elts[Idx] = EvaluateStoreInto(Elts[Idx], Val, Addr, OpNo+1, Context);
// Return the modified struct.
- return ConstantStruct::get(&Elts[0], Elts.size(), STy->isPacked());
+ return ConstantStruct::get(Context, &Elts[0], Elts.size(), STy->isPacked());
} else {
ConstantInt *CI = cast<ConstantInt>(Addr->getOperand(OpNo));
const ArrayType *ATy = cast<ArrayType>(Init->getType());
OpenPOWER on IntegriCloud