Don't call PrepareEHLandingPad on non EH pads
authorReid Kleckner <rnk@google.com>
Mon, 12 Oct 2015 17:42:32 +0000 (17:42 +0000)
committerReid Kleckner <rnk@google.com>
Mon, 12 Oct 2015 17:42:32 +0000 (17:42 +0000)
This was a minor bug in r249492. Calling PrepareEHLandingPad on a
non-landingpad was a no-op, but it attempted to get the generic pointer
register class, which apparently doesn't exist for some targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250068 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 2a25131dbad0cc236fe7c9346ab99693358d8a59..51e8e1486c8a0693752d40de82f8be4e95e0db71 100644 (file)
@@ -1153,8 +1153,9 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
     // Setup an EH landing-pad block.
     FuncInfo->ExceptionPointerVirtReg = 0;
     FuncInfo->ExceptionSelectorVirtReg = 0;
-    if (!PrepareEHLandingPad())
-      continue;
+    if (LLVMBB->isEHPad())
+      if (!PrepareEHLandingPad())
+        continue;
 
     // Before doing SelectionDAG ISel, see if FastISel has been requested.
     if (FastIS) {