File tree Expand file tree Collapse file tree 3 files changed +21
-13
lines changed
Transforms/Instrumentation Expand file tree Collapse file tree 3 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ enum DiagnosticKind {
65
65
DK_Lowering,
66
66
DK_DebugMetadataVersion,
67
67
DK_DebugMetadataInvalid,
68
+ DK_Instrumentation,
68
69
DK_ISelFallback,
69
70
DK_SampleProfile,
70
71
DK_OptimizationRemark,
@@ -950,6 +951,22 @@ class DiagnosticInfoMIRParser : public DiagnosticInfo {
950
951
}
951
952
};
952
953
954
+ // / Diagnostic information for IR instrumentation reporting.
955
+ class DiagnosticInfoInstrumentation : public DiagnosticInfo {
956
+ const Twine &Msg;
957
+
958
+ public:
959
+ DiagnosticInfoInstrumentation (const Twine &DiagMsg,
960
+ DiagnosticSeverity Severity = DS_Warning)
961
+ : DiagnosticInfo(DK_Instrumentation, Severity), Msg(DiagMsg) {}
962
+
963
+ void print (DiagnosticPrinter &DP) const override ;
964
+
965
+ static bool classof (const DiagnosticInfo *DI) {
966
+ return DI->getKind () == DK_Instrumentation;
967
+ }
968
+ };
969
+
953
970
// / Diagnostic information for ISel fallback path.
954
971
class DiagnosticInfoISelFallback : public DiagnosticInfo {
955
972
// / The function that is concerned by this diagnostic.
Original file line number Diff line number Diff line change @@ -375,6 +375,10 @@ void DiagnosticInfoUnsupported::print(DiagnosticPrinter &DP) const {
375
375
DP << Str;
376
376
}
377
377
378
+ void DiagnosticInfoInstrumentation::print (DiagnosticPrinter &DP) const {
379
+ DP << Msg;
380
+ }
381
+
378
382
void DiagnosticInfoISelFallback::print (DiagnosticPrinter &DP) const {
379
383
DP << " Instruction selection used fallback path for " << getFunction ();
380
384
}
Original file line number Diff line number Diff line change @@ -24,19 +24,6 @@ static cl::opt<bool> ClIgnoreRedundantInstrumentation(
24
24
" ignore-redundant-instrumentation" ,
25
25
cl::desc (" Ignore redundant instrumentation" ), cl::Hidden, cl::init(false ));
26
26
27
- namespace {
28
- // / Diagnostic information for IR instrumentation reporting.
29
- class DiagnosticInfoInstrumentation : public DiagnosticInfo {
30
- const Twine &Msg;
31
-
32
- public:
33
- DiagnosticInfoInstrumentation (const Twine &DiagMsg,
34
- DiagnosticSeverity Severity = DS_Warning)
35
- : DiagnosticInfo(DK_Linker, Severity), Msg(DiagMsg) {}
36
- void print (DiagnosticPrinter &DP) const override { DP << Msg; }
37
- };
38
- } // namespace
39
-
40
27
// / Check if module has flag attached, if not add the flag.
41
28
bool llvm::checkIfAlreadyInstrumented (Module &M, StringRef Flag) {
42
29
if (!M.getModuleFlag (Flag)) {
You can’t perform that action at this time.
0 commit comments