Skip to content

[Instrumentation] Drop "const" from a return type (NFC) #145208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kazutakahirata
Copy link
Contributor

We don't need to put a const on a return type.

We don't need to put a const on a return type.
@llvmbot
Copy link
Member

llvmbot commented Jun 22, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

Changes

We don't need to put a const on a return type.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp (+1-1)
diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
index 4c7b8c69c1bf3..71ab61253e643 100644
--- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
@@ -245,7 +245,7 @@ namespace {
   // to the block.
   class GCOVLines : public GCOVRecord {
   public:
-    const StringRef getFilename() { return Filename; }
+    StringRef getFilename() { return Filename; }
 
     void addLine(uint32_t Line) {
       assert(Line != 0 && "Line zero is not a valid real line number.");

@kazutakahirata kazutakahirata requested a review from MaskRay June 22, 2025 05:46
@kazutakahirata kazutakahirata changed the title [Instrumentation] Drop "const" from "const StringRef" (NFC) [Instrumentation] Drop "const" from a return type (NFC) Jun 22, 2025
@kazutakahirata kazutakahirata merged commit 5d7d8d6 into llvm:main Jun 22, 2025
9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250621_const_StringRef branch June 22, 2025 13:30
Jaddyen pushed a commit to Jaddyen/llvm-project that referenced this pull request Jun 23, 2025
We don't need to put a const on a return type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants