[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
This commit is contained in:
David Majnemer
2015-07-31 17:58:45 +00:00
parent 654e130b6e
commit dbf1045ad7
10 changed files with 242 additions and 44 deletions

View File

@@ -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();
}