From 76a9261056a2683f5bb40a469f3f8b0d35142279 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 12 Oct 2015 17:42:32 +0000 Subject: [PATCH] Don't call PrepareEHLandingPad on non EH pads 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 2a25131dbad..51e8e1486c8 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -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) { -- 2.34.1