diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-02-18 23:17:41 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-02-18 23:17:41 +0000 |
commit | 7bb0738d825d0f8e0e3f36f945e9ae47c9b904f0 (patch) | |
tree | 48a8f8ea84b82551bb904129ec32fe2ac34e17ce /llvm/lib/CodeGen/DwarfEHPrepare.cpp | |
parent | e837626173908962a628edf870eb7ea3118a714c (diff) | |
download | bcm5719-llvm-7bb0738d825d0f8e0e3f36f945e9ae47c9b904f0.tar.gz bcm5719-llvm-7bb0738d825d0f8e0e3f36f945e9ae47c9b904f0.zip |
Add an IR-to-IR test for dwarf EH preparation using opt
This tests the simple resume instruction elimination logic that we have
before making some changes to it.
llvm-svn: 229768
Diffstat (limited to 'llvm/lib/CodeGen/DwarfEHPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/DwarfEHPrepare.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/DwarfEHPrepare.cpp b/llvm/lib/CodeGen/DwarfEHPrepare.cpp index 8e49ef31bd4..7b47a48391c 100644 --- a/llvm/lib/CodeGen/DwarfEHPrepare.cpp +++ b/llvm/lib/CodeGen/DwarfEHPrepare.cpp @@ -38,6 +38,11 @@ namespace { public: static char ID; // Pass identification, replacement for typeid. + + // INITIALIZE_TM_PASS requires a default constructor, but it isn't used in + // practice. + DwarfEHPrepare() : FunctionPass(ID), TM(nullptr), RewindFunction(nullptr) {} + DwarfEHPrepare(const TargetMachine *TM) : FunctionPass(ID), TM(TM), RewindFunction(nullptr) {} @@ -55,6 +60,8 @@ namespace { } // end anonymous namespace char DwarfEHPrepare::ID = 0; +INITIALIZE_TM_PASS(DwarfEHPrepare, "dwarfehprepare", "Prepare DWARF exceptions", + false, false) FunctionPass *llvm::createDwarfEHPass(const TargetMachine *TM) { return new DwarfEHPrepare(TM); @@ -167,6 +174,7 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls(Function &Fn) { } bool DwarfEHPrepare::runOnFunction(Function &Fn) { + assert(TM && "DWARF EH preparation requires a target machine"); bool Changed = InsertUnwindResumeCalls(Fn); return Changed; } |