[clang] e6e7bdd - Drop unnecessary const from return types (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 28 10:01:48 PST 2021


Author: Kazu Hirata
Date: 2021-12-28T10:01:39-08:00
New Revision: e6e7bdd6a90ca8ba896fb92f6e0e642d42c84efc

URL: https://github.com/llvm/llvm-project/commit/e6e7bdd6a90ca8ba896fb92f6e0e642d42c84efc
DIFF: https://github.com/llvm/llvm-project/commit/e6e7bdd6a90ca8ba896fb92f6e0e642d42c84efc.diff

LOG: Drop unnecessary const from return types (NFC)

Identified with readability-const-return-type.

Added: 
    

Modified: 
    clang/lib/Frontend/CompilerInvocation.cpp
    llvm/include/llvm/Passes/StandardInstrumentations.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index b71addd84bfd9..7727d70adfb1e 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -438,7 +438,7 @@ static T extractMaskValue(T KeyPath) {
     }(EXTRACTOR(KEYPATH));                                                     \
   }
 
-static const StringRef GetInputKindName(InputKind IK);
+static StringRef GetInputKindName(InputKind IK);
 
 static bool FixupInvocation(CompilerInvocation &Invocation,
                             DiagnosticsEngine &Diags, const ArgList &Args,
@@ -3291,7 +3291,7 @@ static bool IsInputCompatibleWithStandard(InputKind IK,
 }
 
 /// Get language name for given input kind.
-static const StringRef GetInputKindName(InputKind IK) {
+static StringRef GetInputKindName(InputKind IK) {
   switch (IK.getLanguage()) {
   case Language::C:
     return "C";

diff  --git a/llvm/include/llvm/Passes/StandardInstrumentations.h b/llvm/include/llvm/Passes/StandardInstrumentations.h
index 6cab4ce7d138b..9eb754a4d8245 100644
--- a/llvm/include/llvm/Passes/StandardInstrumentations.h
+++ b/llvm/include/llvm/Passes/StandardInstrumentations.h
@@ -432,7 +432,7 @@ class DCData {
   }
 
   // Return the label of the basic block reached on a transition on \p S.
-  const StringRef getSuccessorLabel(StringRef S) const {
+  StringRef getSuccessorLabel(StringRef S) const {
     assert(Successors.count(S) == 1 && "Expected to find successor.");
     return Successors.find(S)->getValue();
   }


        


More information about the cfe-commits mailing list