diff options
Diffstat (limited to 'llvm/lib/Passes/PassBuilder.cpp')
-rw-r--r-- | llvm/lib/Passes/PassBuilder.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index a87d0b5..8d2a64d 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -326,15 +326,25 @@ AnalysisKey NoOpLoopAnalysis::Key; namespace { -// A pass for testing -print-on-crash. +// Passes for testing crashes. // DO NOT USE THIS EXCEPT FOR TESTING! -class TriggerCrashPass : public PassInfoMixin<TriggerCrashPass> { +class TriggerCrashModulePass : public PassInfoMixin<TriggerCrashModulePass> { public: PreservedAnalyses run(Module &, ModuleAnalysisManager &) { abort(); return PreservedAnalyses::all(); } - static StringRef name() { return "TriggerCrashPass"; } + static StringRef name() { return "TriggerCrashModulePass"; } +}; + +class TriggerCrashFunctionPass + : public PassInfoMixin<TriggerCrashFunctionPass> { +public: + PreservedAnalyses run(Function &, FunctionAnalysisManager &) { + abort(); + return PreservedAnalyses::all(); + } + static StringRef name() { return "TriggerCrashFunctionPass"; } }; // A pass for testing message reporting of -verify-each failures. |