fix think-o
authorJim Grosbach <grosbach@apple.com>
Tue, 1 Jun 2010 21:35:50 +0000 (21:35 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 1 Jun 2010 21:35:50 +0000 (21:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105291 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/LowerInvoke.cpp

index 75d5cdfe5e601bed1022a3dd42ef64515f8445e9..90e9b3168ec9af56b3361af5bca848c590238a46 100644 (file)
@@ -186,6 +186,8 @@ bool LowerInvoke::doInitialization(Module &M) {
 }
 
 void LowerInvoke::createAbortMessage(Module *M) {
+  Constant *Null32 = Constant::getNullValue(Type::getInt32Ty(M->getContext()));
+  Constant *GEPIdx[2] = { Null32, Null32 };
   if (useExpensiveEHSupport) {
     // The abort message for expensive EH support tells the user that the
     // program 'unwound' without an 'invoke' instruction.
@@ -197,9 +199,6 @@ void LowerInvoke::createAbortMessage(Module *M) {
     GlobalVariable *MsgGV = new GlobalVariable(*M, Msg->getType(), true,
                                                GlobalValue::InternalLinkage,
                                                Msg, "abortmsg");
-    Constant *GEPIdx[2] = {
-      ConstantInt::get(Type::getInt32Ty(M->getContext()), 2),
-      Constant::getNullValue(Type::getInt32Ty(M->getContext())) };
     AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, &GEPIdx[0], 2);
   } else {
     // The abort message for cheap EH support tells the user that EH is not
@@ -213,9 +212,6 @@ void LowerInvoke::createAbortMessage(Module *M) {
     GlobalVariable *MsgGV = new GlobalVariable(*M, Msg->getType(), true,
                                                GlobalValue::InternalLinkage,
                                                Msg, "abortmsg");
-    Constant *GEPIdx[2] = {
-      ConstantInt::get(Type::getInt32Ty(M->getContext()), 2),
-      Constant::getNullValue(Type::getInt32Ty(M->getContext())) };
     AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, &GEPIdx[0], 2);
   }
 }