[llvm] fb28d6f - [DebugInfo] Drop unnecessary const from return types (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 27 15:42:59 PST 2021


Author: Kazu Hirata
Date: 2021-12-27T15:42:52-08:00
New Revision: fb28d6fb5ffc3c58b30467ef3f59cd2891be7a65

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

LOG: [DebugInfo] Drop unnecessary const from return types (NFC)

Identified with readability-const-return-type.

Added: 
    

Modified: 
    llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp b/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
index 555d29fe184b8..e29968d113bd9 100644
--- a/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
@@ -33,8 +33,8 @@ namespace symbolize {
 class SourceCode {
   std::unique_ptr<MemoryBuffer> MemBuf;
 
-  const Optional<StringRef> load(StringRef FileName,
-                                 const Optional<StringRef> &EmbeddedSource) {
+  Optional<StringRef> load(StringRef FileName,
+                           const Optional<StringRef> &EmbeddedSource) {
     if (Lines <= 0)
       return None;
 
@@ -50,7 +50,7 @@ class SourceCode {
     }
   }
 
-  const Optional<StringRef> pruneSource(const Optional<StringRef> &Source) {
+  Optional<StringRef> pruneSource(const Optional<StringRef> &Source) {
     if (!Source)
       return None;
     size_t FirstLinePos = StringRef::npos, Pos = 0;


        


More information about the llvm-commits mailing list