diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-07-31 17:58:45 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-07-31 17:58:45 +0000 |
commit | dbf1045ad75c41e0711e075cf9e0ffd433c55c67 (patch) | |
tree | c75cc12748d00898b082c1e1d556af59ec43ab8d /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 654e130b6ec76c1a2910b2594cb403ecd2773af8 (diff) | |
download | bcm5719-llvm-dbf1045ad75c41e0711e075cf9e0ffd433c55c67.tar.gz bcm5719-llvm-dbf1045ad75c41e0711e075cf9e0ffd433c55c67.zip |
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index ec3c75ccd25..9bf4161e945 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<llvm::CallInst>(&*BI)) { - if (!Call->doesNotThrow()) - return; - } else if (isa<llvm::ResumeInst>(&*BI)) { + for (llvm::BasicBlock &BB : *F) + for (llvm::Instruction &I : BB) + if (I.mayThrow()) return; - } + F->setDoesNotThrow(); } |