From dbf1045ad75c41e0711e075cf9e0ffd433c55c67 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 31 Jul 2015 17:58:45 +0000 Subject: [MS ABI] Hook clang up to the new EH instructions The new EH instructions make it possible for LLVM to generate .xdata tables that the MSVC personality routines will be happy about. Because this is experimental, hide it behind a -cc1 flag (-fnew-ms-eh). Differential Revision: http://reviews.llvm.org/D11405 llvm-svn: 243767 --- clang/lib/CodeGen/CodeGenFunction.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index ec3c75c..9bf4161 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -826,15 +826,11 @@ static void TryMarkNoThrow(llvm::Function *F) { // can't do this on functions that can be overwritten. if (F->mayBeOverridden()) return; - for (llvm::Function::iterator FI = F->begin(), FE = F->end(); FI != FE; ++FI) - for (llvm::BasicBlock::iterator - BI = FI->begin(), BE = FI->end(); BI != BE; ++BI) - if (llvm::CallInst *Call = dyn_cast(&*BI)) { - if (!Call->doesNotThrow()) - return; - } else if (isa(&*BI)) { + for (llvm::BasicBlock &BB : *F) + for (llvm::Instruction &I : BB) + if (I.mayThrow()) return; - } + F->setDoesNotThrow(); } -- cgit v1.1