mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
EH: Prune unreachable resume instructions during Dwarf EH preparation
Today a simple function that only catches exceptions and doesn't run destructor cleanups ends up containing a dead call to _Unwind_Resume (PR20300). We can't remove these dead resume instructions during normal optimization because inlining might introduce additional landingpads that do have cleanups to run. Instead we can do this during EH preparation, which is guaranteed to run after inlining. Fixes PR20300. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D7744 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229944 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -612,13 +612,13 @@ namespace llvm {
|
||||
ModulePass *createForwardControlFlowIntegrityPass();
|
||||
} // End llvm namespace
|
||||
|
||||
/// This initializer registers TargetMachine constructor, so the pass being
|
||||
/// initialized can use target dependent interfaces. Please do not move this
|
||||
/// macro to be together with INITIALIZE_PASS, which is a complete target
|
||||
/// independent initializer, and we don't want to make libScalarOpts depend
|
||||
/// on libCodeGen.
|
||||
#define INITIALIZE_TM_PASS(passName, arg, name, cfg, analysis) \
|
||||
static void* initialize##passName##PassOnce(PassRegistry &Registry) { \
|
||||
/// Target machine pass initializer for passes with dependencies. Use with
|
||||
/// INITIALIZE_TM_PASS_END.
|
||||
#define INITIALIZE_TM_PASS_BEGIN INITIALIZE_PASS_BEGIN
|
||||
|
||||
/// Target machine pass initializer for passes with dependencies. Use with
|
||||
/// INITIALIZE_TM_PASS_BEGIN.
|
||||
#define INITIALIZE_TM_PASS_END(passName, arg, name, cfg, analysis) \
|
||||
PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
|
||||
PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis, \
|
||||
PassInfo::TargetMachineCtor_t(callTargetMachineCtor< passName >)); \
|
||||
@@ -629,4 +629,13 @@ namespace llvm {
|
||||
CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \
|
||||
}
|
||||
|
||||
/// This initializer registers TargetMachine constructor, so the pass being
|
||||
/// initialized can use target dependent interfaces. Please do not move this
|
||||
/// macro to be together with INITIALIZE_PASS, which is a complete target
|
||||
/// independent initializer, and we don't want to make libScalarOpts depend
|
||||
/// on libCodeGen.
|
||||
#define INITIALIZE_TM_PASS(passName, arg, name, cfg, analysis) \
|
||||
INITIALIZE_TM_PASS_BEGIN(passName, arg, name, cfg, analysis) \
|
||||
INITIALIZE_TM_PASS_END(passName, arg, name, cfg, analysis)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user