I don't see any point in having both eh.selector.i32 and eh.selector.i64,
[oota-llvm.git] / lib / CodeGen / SjLjEHPrepare.cpp
index 04bc6cf89222c17beca68273b4c1189be5bbc4ad..e987fa2fbc8e46570af464ccc689d21eba1f32bf 100644 (file)
@@ -50,8 +50,7 @@ namespace {
     Constant *FrameAddrFn;
     Constant *LSDAAddrFn;
     Value *PersonalityFn;
-    Constant *Selector32Fn;
-    Constant *Selector64Fn;
+    Constant *SelectorFn;
     Constant *ExceptionFn;
 
     Value *CallSite;
@@ -116,8 +115,7 @@ bool SjLjEHPass::doInitialization(Module &M) {
   FrameAddrFn = Intrinsic::getDeclaration(&M, Intrinsic::frameaddress);
   BuiltinSetjmpFn = Intrinsic::getDeclaration(&M, Intrinsic::eh_sjlj_setjmp);
   LSDAAddrFn = Intrinsic::getDeclaration(&M, Intrinsic::eh_sjlj_lsda);
-  Selector32Fn = Intrinsic::getDeclaration(&M, Intrinsic::eh_selector_i32);
-  Selector64Fn = Intrinsic::getDeclaration(&M, Intrinsic::eh_selector_i64);
+  SelectorFn = Intrinsic::getDeclaration(&M, Intrinsic::eh_selector);
   ExceptionFn = Intrinsic::getDeclaration(&M, Intrinsic::eh_exception);
   PersonalityFn = 0;
 
@@ -298,8 +296,7 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
   for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
     for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
       if (CallInst *CI = dyn_cast<CallInst>(I)) {
-        if (CI->getCalledFunction() == Selector32Fn ||
-            CI->getCalledFunction() == Selector64Fn) {
+        if (CI->getCalledFunction() == SelectorFn) {
           if (!PersonalityFn) PersonalityFn = CI->getOperand(2);
           EH_Selectors.push_back(CI);
         } else if (CI->getCalledFunction() == ExceptionFn) {