X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FCodeGen%2FWinEHPrepare.cpp;h=c1067c5d56000f8f7e26ead28ab9838b314ce2f6;hp=db91c02ee461dcf7adb670b8e738b74c8700461a;hb=039d60c2548f8f46d2051198cd5d803342d75e9f;hpb=2701a7ff17508dcf9971f1c84e58cc0c5d187873 diff --git a/lib/CodeGen/WinEHPrepare.cpp b/lib/CodeGen/WinEHPrepare.cpp index db91c02ee46..c1067c5d560 100644 --- a/lib/CodeGen/WinEHPrepare.cpp +++ b/lib/CodeGen/WinEHPrepare.cpp @@ -8,11 +8,9 @@ //===----------------------------------------------------------------------===// // // This pass lowers LLVM IR exception handling into something closer to what the -// backend wants for functions using a personality function from a runtime -// provided by MSVC. Functions with other personality functions are left alone -// and may be prepared by other passes. In particular, all supported MSVC -// personality functions require cleanup code to be outlined, and the C++ -// personality requires catch handler code to be outlined. +// backend wants. It snifs the personality function to see which kind of +// preparation is necessary. If the personality function uses the Itanium LSDA, +// this pass delegates to the DWARF EH preparation pass. // //===----------------------------------------------------------------------===// @@ -33,6 +31,7 @@ #include "llvm/IR/Module.h" #include "llvm/IR/PatternMatch.h" #include "llvm/Pass.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" @@ -923,7 +922,7 @@ bool WinEHPrepare::prepareExceptionHandlers( if (SEHExceptionCodeSlot) { if (SEHExceptionCodeSlot->hasNUses(0)) SEHExceptionCodeSlot->eraseFromParent(); - else if (isAllocaPromotable(SEHExceptionCodeSlot)) + else PromoteMemToReg(SEHExceptionCodeSlot, *DT); }