[clang] fix: replace report_fatal_error with Diags and exit (PR #147959)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 22 04:19:47 PDT 2025
================
@@ -1697,6 +1698,15 @@ ASTContext::getRelocationInfoForCXXRecord(const CXXRecordDecl *RD) const {
return std::nullopt;
}
+void ASTContext::initSanitizers(const LangOptions &LangOpts,
+ SourceManager &SM) {
+ std::string Error;
+ if (!NoSanitizeL->init(LangOpts.NoSanitizeFiles, Error)) {
+ const std::string &Path = LangOpts.NoSanitizeFiles.front();
----------------
AaronBallman wrote:
> so I think using CustomDiagID is better!
Custom diagnostics are not an acceptable solution IMO; the reason is because they don't get a warning group associated with them and so users have no way to silence those diagnostics. We have some uses of the API in Clang but in every case they're the wrong tool to use.
We actually document this on the API itself, but not very clearly: https://github.com/llvm/llvm-project/blob/b3e016e05f1d21428298760db82b26fd0266f8bb/clang/include/clang/Basic/Diagnostic.h#L898 (I'll fix up the comment)
https://github.com/llvm/llvm-project/pull/147959
More information about the cfe-commits
mailing list