diff options
author | Nikolas Klauser <nikolasklauser@berlin.de> | 2024-09-12 20:15:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-12 20:15:01 +0200 |
commit | 030c6da7af826b641db005be925b20f956c3a6bb (patch) | |
tree | a1311c8a6c9724ce980fb67960e6247a024d00f2 /clang/lib/Sema/Sema.cpp | |
parent | 2670565afc4ec855fa406b8f582dde44ce1739fb (diff) | |
download | llvm-030c6da7af826b641db005be925b20f956c3a6bb.zip llvm-030c6da7af826b641db005be925b20f956c3a6bb.tar.gz llvm-030c6da7af826b641db005be925b20f956c3a6bb.tar.bz2 |
[clang] Extend diagnose_if to accept more detailed warning information (#70976)
This implements parts of the extension proposed in
https://discourse.llvm.org/t/exposing-the-diagnostic-engine-to-c/73092/7.
Specifically, this makes it possible to specify a diagnostic group in an
optional third argument.
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 46ddd36..d567de7 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -1683,7 +1683,7 @@ void Sema::EmitCurrentDiagnostic(unsigned DiagID) { // that is different from the last template instantiation where // we emitted an error, print a template instantiation // backtrace. - if (!DiagnosticIDs::isBuiltinNote(DiagID)) + if (!Diags.getDiagnosticIDs()->isNote(DiagID)) PrintContextStack(); } @@ -1697,7 +1697,8 @@ bool Sema::hasUncompilableErrorOccurred() const { if (Loc == DeviceDeferredDiags.end()) return false; for (auto PDAt : Loc->second) { - if (DiagnosticIDs::isDefaultMappingAsError(PDAt.second.getDiagID())) + if (Diags.getDiagnosticIDs()->isDefaultMappingAsError( + PDAt.second.getDiagID())) return true; } return false; |