}
}
- Instruction *IP = &*F.begin()->begin();
for (const auto &KV : Mapping)
- ORE.emit(OptimizationRemarkAnalysis(REMARK_PASS, "AnnotationSummary", IP)
+ ORE.emit(OptimizationRemarkAnalysis(REMARK_PASS, "AnnotationSummary",
+ F.getSubprogram(), &F.front())
<< "Annotated " << NV("count", KV.second) << " instructions with "
<< NV("type", KV.first));
; CHECK: --- !Analysis
; CHECK-NEXT: Pass: annotation-remarks
; CHECK-NEXT: Name: AnnotationSummary
-; CHECK-NEXT: DebugLoc: { File: test.c, Line: 400, Column: 3 }
+; CHECK-NEXT: DebugLoc: { File: test.c, Line: 10, Column: 0 }
; CHECK-NEXT: Function: test1
; CHECK-NEXT: Args:
; CHECK-NEXT: - String: 'Annotated '
; CHECK-NEXT: --- !Analysis
; CHECK-NEXT: Pass: annotation-remarks
; CHECK-NEXT: Name: AnnotationSummary
-; CHECK-NEXT: DebugLoc: { File: test.c, Line: 400, Column: 3 }
+; CHECK-NEXT: DebugLoc: { File: test.c, Line: 10, Column: 0 }
; CHECK-NEXT: Function: test1
; CHECK-NEXT: Args:
; CHECK-NEXT: - String: 'Annotated '
; CHECK-NEXT: --- !Analysis
; CHECK-NEXT: Pass: annotation-remarks
; CHECK-NEXT: Name: AnnotationSummary
+; CHECK-NEXT: DebugLoc: { File: test.c, Line: 20, Column: 0 }
; CHECK-NEXT: Function: test2
; CHECK-NEXT: Args:
; CHECK-NEXT: - String: 'Annotated '