[clang] fix: replace report_fatal_error with Diags and exit (PR #147959)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 21 06:11:31 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:

I think this assumes that the first file in the list is the one we cannot read; what happens if we can read that one fine but a subsequent file is where we struggle? We'd report the wrong path to the user in that case, which would be hard for them to reason about.

https://github.com/llvm/llvm-project/pull/147959


More information about the cfe-commits mailing list