Skip to content

Commit 7a84c37

Browse files
committed
fix: use err_sanitize_ignorelist_failure
1 parent db77535 commit 7a84c37

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ def warn_profile_data_misexpect : Warning<
370370
"potential performance regression from use of __builtin_expect(): "
371371
"annotation was correct on %0 of profiled executions">,
372372
BackendInfo, InGroup<MisExpect>;
373+
def err_sanitize_ignorelist_failure : Error<
374+
"failed to sanitizer ignorelist file: %0">;
373375
} // end of instrumentation issue category
374376

375377
def err_extract_api_ignores_file_not_found :

clang/lib/AST/ASTContext.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,9 +1702,7 @@ void ASTContext::initSanitizers(const LangOptions &LangOpts,
17021702
SourceManager &SM) {
17031703
std::string Error;
17041704
if (!NoSanitizeL->init(LangOpts.NoSanitizeFiles, Error)) {
1705-
auto &Diags = SM.getDiagnostics();
1706-
Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0"))
1707-
<< Error;
1705+
SM.getDiagnostics().Report(diag::err_sanitize_ignorelist_failure) << Error;
17081706
}
17091707
}
17101708

clang/test/Driver/fsanitize-ignorelist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
// Check that a missing file passed to -fsanitize-system-ignorelist triggers a clean error without crashing.
7676
// RUN: not %clang --target=x86_64-linux-gnu -Xclang -fsanitize-system-ignorelist=%t.nonexistent %s -c -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-SYSTEM-IGNORELIST-NOFILE
77-
// CHECK-SYSTEM-IGNORELIST-NOFILE: error: can't open file '{{.*[\\/]fsanitize-ignorelist\.c\.tmp\.nonexistent}}': {{[Nn]o such file or directory}}
77+
// CHECK-SYSTEM-IGNORELIST-NOFILE: error: failed to sanitizer ignorelist file: can't open file '{{.*[\\/]fsanitize-ignorelist\.c\.tmp\.nonexistent}}': {{[Nn]o such file or directory}}
7878
// CHECK-SYSTEM-IGNORELIST-NOFILE-NOT: Stack dump:
7979
// CHECK-SYSTEM-IGNORELIST-NOFILE-NOT: PLEASE submit a bug report
8080
// CHECK-SYSTEM-IGNORELIST-NOFILE-NOT: diagnostic msg:

0 commit comments

Comments
 (0)