Update Clang for an API change to LLVM's switch case iterator (it is now
authorChandler Carruth <chandlerc@gmail.com>
Wed, 12 Apr 2017 08:12:30 +0000 (08:12 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 12 Apr 2017 08:12:30 +0000 (08:12 +0000)
an actual iterator and so we need to look through it to the case
handle).

llvm-svn: 300035

clang/lib/CodeGen/CGCleanup.cpp

index df6741d..437ab7d 100644 (file)
@@ -609,7 +609,7 @@ static void destroyOptimisticNormalEntry(CodeGenFunction &CGF,
     llvm::SwitchInst *si = cast<llvm::SwitchInst>(use.getUser());
     if (si->getNumCases() == 1 && si->getDefaultDest() == unreachableBB) {
       // Replace the switch with a branch.
-      llvm::BranchInst::Create(si->case_begin().getCaseSuccessor(), si);
+      llvm::BranchInst::Create(si->case_begin()->getCaseSuccessor(), si);
 
       // The switch operand is a load from the cleanup-dest alloca.
       llvm::LoadInst *condition = cast<llvm::LoadInst>(si->getCondition());