Skip to content

Commit 12e3ed8

Browse files
committed
[clang] Avoid possibly expensive SM call when suppression-mappings are off
1 parent 3793dec commit 12e3ed8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Basic/DiagnosticIDs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc,
601601
return diag::Severity::Ignored;
602602

603603
// Clang-diagnostics pragmas always take precedence over suppression mapping.
604-
if (!Mapping.isPragma()) {
604+
if (!Mapping.isPragma() && Diag.DiagSuppressionMapping) {
605605
// We also use presumed locations here to improve reproducibility for
606606
// preprocessed inputs.
607607
if (PresumedLoc PLoc = SM.getPresumedLoc(Loc);

0 commit comments

Comments
 (0)