[clang] fix: replace report_fatal_error with Diags and exit (PR #147959)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 22 23:30:34 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();
----------------
woruyu wrote:
> Custom diagnostics are not an acceptable solution IMO;
Thanks for the feedback! To confirm: is the correct fix to define dedicated diagnostics in a `.td` file like this:
```
def err_no_sanitize_file_open_fail : Error<
"failed to load NoSanitize file: can't open file '%0'">;
def err_no_sanitize_file_parse_fail : Error<
"failed to load NoSanitize file: error parsing file '%0'">;
def SanitizeIgnorelist : DiagGroup<"sanitize-ignorelist">;
```
Then use them accordingly in `ASTContext::initSanitizers`.
https://github.com/llvm/llvm-project/pull/147959
More information about the cfe-commits
mailing list