summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LowerInvoke.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-08 19:03:57 +0000
committerOwen Anderson <resistor@mac.com>2009-07-08 19:03:57 +0000
commitb17f32945fa6dd8e552a16cc5273bba5805cf4e4 (patch)
treeb8383165ab804187660d5c8eddb2dc7486730b93 /llvm/lib/Transforms/Utils/LowerInvoke.cpp
parentd5ffa8ffb62df34c6fa3ba8ec4c29b2ea2891ad0 (diff)
downloadbcm5719-llvm-b17f32945fa6dd8e552a16cc5273bba5805cf4e4.tar.gz
bcm5719-llvm-b17f32945fa6dd8e552a16cc5273bba5805cf4e4.zip
Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
llvm-svn: 75025
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerInvoke.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LowerInvoke.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
index 1eefdc4b3ca..8ef060a1f4a 100644
--- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
@@ -139,11 +139,10 @@ bool LowerInvoke::doInitialization(Module &M) {
// Now that we've done that, insert the jmpbuf list head global, unless it
// already exists.
if (!(JBListHead = M.getGlobalVariable("llvm.sjljeh.jblist", PtrJBList))) {
- JBListHead = new GlobalVariable(M.getContext(),
- PtrJBList, false,
+ JBListHead = new GlobalVariable(M, PtrJBList, false,
GlobalValue::LinkOnceAnyLinkage,
Context->getNullValue(PtrJBList),
- "llvm.sjljeh.jblist", &M);
+ "llvm.sjljeh.jblist");
}
// VisualStudio defines setjmp as _setjmp via #include <csetjmp> / <setjmp.h>,
@@ -183,10 +182,9 @@ void LowerInvoke::createAbortMessage(Module *M) {
Context->getConstantArray("ERROR: Exception thrown, but not caught!\n");
AbortMessageLength = Msg->getNumOperands()-1; // don't include \0
- GlobalVariable *MsgGV = new GlobalVariable(M->getContext(),
- Msg->getType(), true,
+ GlobalVariable *MsgGV = new GlobalVariable(*M, Msg->getType(), true,
GlobalValue::InternalLinkage,
- Msg, "abortmsg", M);
+ Msg, "abortmsg");
std::vector<Constant*> GEPIdx(2, Context->getNullValue(Type::Int32Ty));
AbortMessage = Context->getConstantExprGetElementPtr(MsgGV, &GEPIdx[0], 2);
} else {
@@ -197,10 +195,9 @@ void LowerInvoke::createAbortMessage(Module *M) {
"Recompile program with -enable-correct-eh-support.\n");
AbortMessageLength = Msg->getNumOperands()-1; // don't include \0
- GlobalVariable *MsgGV = new GlobalVariable(M->getContext(),
- Msg->getType(), true,
+ GlobalVariable *MsgGV = new GlobalVariable(*M, Msg->getType(), true,
GlobalValue::InternalLinkage,
- Msg, "abortmsg", M);
+ Msg, "abortmsg");
std::vector<Constant*> GEPIdx(2, Context->getNullValue(Type::Int32Ty));
AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, &GEPIdx[0], 2);
}
OpenPOWER on IntegriCloud