Skip to content

Conversation

@bricknerb
Copy link
Contributor

No description provided.

…lls in SourceManager, and use the equivalent Report() overload instead
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Nov 20, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 20, 2024

@llvm/pr-subscribers-clang

Author: Boaz Brickner (bricknerb)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/116937.diff

1 Files Affected:

  • (modified) clang/lib/Basic/SourceManager.cpp (+3-3)
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 9b983cefbcf4ca..6e588ce63d813f 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -665,7 +665,7 @@ SourceManager::createExpansionLocImpl(const ExpansionInfo &Info,
   LocalSLocEntryTable.push_back(SLocEntry::get(NextLocalOffset, Info));
   if (NextLocalOffset + Length + 1 <= NextLocalOffset ||
       NextLocalOffset + Length + 1 > CurrentLoadedOffset) {
-    Diag.Report(SourceLocation(), diag::err_sloc_space_too_large);
+    Diag.Report(diag::err_sloc_space_too_large);
     // FIXME: call `noteSLocAddressSpaceUsage` to report details to users and
     // use a source location from `Info` to point at an error.
     // Currently, both cause Clang to run indefinitely, this needs to be fixed.
@@ -2295,7 +2295,7 @@ void SourceManager::noteSLocAddressSpaceUsage(
   uint64_t LoadedUsage = MaxLoadedOffset - CurrentLoadedOffset;
   int UsagePercent = static_cast<int>(100.0 * double(LocalUsage + LoadedUsage) /
                                       MaxLoadedOffset);
-  Diag.Report(SourceLocation(), diag::note_total_sloc_usage)
+  Diag.Report(diag::note_total_sloc_usage)
       << LocalUsage << LoadedUsage << (LocalUsage + LoadedUsage)
       << UsagePercent;
 
@@ -2311,7 +2311,7 @@ void SourceManager::noteSLocAddressSpaceUsage(
 
   // Describe any remaining usage not reported in the per-file usage.
   if (ReportedSize != CountedSize) {
-    Diag.Report(SourceLocation(), diag::note_file_misc_sloc_usage)
+    Diag.Report(diag::note_file_misc_sloc_usage)
         << (SortedUsage.end() - SortedEnd) << CountedSize - ReportedSize;
   }
 }

@bricknerb bricknerb requested a review from usx95 November 21, 2024 08:34
@bricknerb bricknerb merged commit bc7f24c into llvm:main Nov 21, 2024
11 checks passed
@bricknerb bricknerb deleted the source branch January 14, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants