[cfe-commits] r84107 - in /cfe/trunk/lib/CodeGen: CGObjCGNU.cpp CGObjCMac.cpp

Duncan Sands baldrick at free.fr
Wed Oct 14 09:13:31 PDT 2009


Author: baldrick
Date: Wed Oct 14 11:13:30 2009
New Revision: 84107

URL: http://llvm.org/viewvc/llvm-project?rev=84107&view=rev
Log:
There is now only one version of eh.selector and eh.typeid.for.
Fix the clang build.

Modified:
    cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=84107&r1=84106&r2=84107&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Wed Oct 14 11:13:30 2009
@@ -1643,17 +1643,12 @@
 
   // Get the correct versions of the exception handling intrinsics
   llvm::TargetData td = llvm::TargetData::TargetData(&TheModule);
-  int PointerWidth = td.getTypeSizeInBits(PtrTy);
-  assert((PointerWidth == 32 || PointerWidth == 64) &&
-    "Can't yet handle exceptions if pointers are not 32 or 64 bits");
   llvm::Value *llvm_eh_exception =
     CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_exception);
-  llvm::Value *llvm_eh_selector = PointerWidth == 32 ?
-    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector_i32) :
-    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector_i64);
-  llvm::Value *llvm_eh_typeid_for = PointerWidth == 32 ?
-    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for_i32) :
-    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for_i64);
+  llvm::Value *llvm_eh_selector =
+    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector);
+  llvm::Value *llvm_eh_typeid_for =
+    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for);
 
   // Exception object
   llvm::Value *Exc = CGF.Builder.CreateCall(llvm_eh_exception, "exc");

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=84107&r1=84106&r2=84107&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Wed Oct 14 11:13:30 2009
@@ -5425,10 +5425,10 @@
 
   llvm::Value *llvm_eh_exception =
     CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_exception);
-  llvm::Value *llvm_eh_selector_i64 =
-    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector_i64);
-  llvm::Value *llvm_eh_typeid_for_i64 =
-    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for_i64);
+  llvm::Value *llvm_eh_selector =
+    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector);
+  llvm::Value *llvm_eh_typeid_for =
+    CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for);
   llvm::Value *Exc = CGF.Builder.CreateCall(llvm_eh_exception, "exc");
   llvm::Value *RethrowPtr = CGF.CreateTempAlloca(Exc->getType(), "_rethrow");
 
@@ -5490,7 +5490,7 @@
   }
 
   llvm::Value *Selector =
-    CGF.Builder.CreateCall(llvm_eh_selector_i64,
+    CGF.Builder.CreateCall(llvm_eh_selector,
                            SelectorArgs.begin(), SelectorArgs.end(),
                            "selector");
   for (unsigned i = 0, e = Handlers.size(); i != e; ++i) {
@@ -5506,7 +5506,7 @@
       llvm::BasicBlock *Match = CGF.createBasicBlock("match");
       Next = CGF.createBasicBlock("catch.next");
       llvm::Value *Id =
-        CGF.Builder.CreateCall(llvm_eh_typeid_for_i64,
+        CGF.Builder.CreateCall(llvm_eh_typeid_for,
                                CGF.Builder.CreateBitCast(SelectorArgs[i+2],
                                                          ObjCTypes.Int8PtrTy));
       CGF.Builder.CreateCondBr(CGF.Builder.CreateICmpEQ(Selector, Id),
@@ -5557,7 +5557,7 @@
       Args.push_back(ObjCTypes.getEHPersonalityPtr());
       Args.push_back(llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext),
                                             0));
-      CGF.Builder.CreateCall(llvm_eh_selector_i64, Args.begin(), Args.end());
+      CGF.Builder.CreateCall(llvm_eh_selector, Args.begin(), Args.end());
       CGF.Builder.CreateStore(Exc, RethrowPtr);
       CGF.EmitBranchThroughCleanup(FinallyRethrow);
 
@@ -5589,7 +5589,7 @@
       Args.push_back(ObjCTypes.getEHPersonalityPtr());
       Args.push_back(llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext),
                                             0));
-      CGF.Builder.CreateCall(llvm_eh_selector_i64, Args.begin(), Args.end());
+      CGF.Builder.CreateCall(llvm_eh_selector, Args.begin(), Args.end());
       CGF.Builder.CreateStore(Exc, RethrowPtr);
       CGF.EmitBranchThroughCleanup(FinallyRethrow);
 





More information about the cfe-commits mailing list