[AnnotationRemarks] Support generating annotation remarks with -O0.
This matches the legacy pass manager behavior. If remarks are not enabled the pass is effectively a no-op.
This commit is contained in:
3 files changed
+5
-1
No files matched your search
@@ -22,6 +22,7 @@ class Function;
|
||||
|
||||
struct AnnotationRemarksPass : public PassInfoMixin<AnnotationRemarksPass> {
|
||||
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
|
||||
static bool isRequired() { return true; }
|
||||
};
|
||||
} // namespace llvm
|
||||
|
||||
|
||||
@@ -1765,6 +1765,8 @@ ModulePassManager PassBuilder::buildO0DefaultPipeline(OptimizationLevel Level,
|
||||
if (LTOPreLink)
|
||||
addRequiredLTOPreLinkPasses(MPM);
|
||||
|
||||
MPM.addPass(createModuleToFunctionPassAdaptor(AnnotationRemarksPass()));
|
||||
|
||||
return MPM;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,9 @@
|
||||
; CHECK-LTO-NEXT: Running analysis: InnerAnalysisManagerProxy
|
||||
; CHECK-LTO-NEXT: Running pass: LowerTypeTestsPass
|
||||
; CHECK-LTO-NEXT: Running pass: LowerTypeTestsPass
|
||||
; CHECK-CORO-NEXT: Running pass: AnnotationRemarksPass
|
||||
; CHECK-LTO-NEXT: Running pass: AnnotationRemarksPass
|
||||
; CHECK-LTO-NEXT: Running analysis: TargetLibraryAnalysis
|
||||
; CHECK-LTO-NEXT: Running analysis: TargetLibraryAnalysis
|
||||
; CHECK-NEXT: Running pass: PrintModulePass
|
||||
|
||||
; Make sure we get the IR back out without changes when we print the module.
|
||||
|
||||
Reference in new issue
Block a user