[llvm] b4de30f - [Support] Drop unnecessary const from return types (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 20:41:56 PST 2021


Author: Kazu Hirata
Date: 2021-02-03T20:41:16-08:00
New Revision: b4de30f6afe446a38c30626e611daa5509f19b92

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

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

Identified with const-return-type.

Added: 
    

Modified: 
    llvm/include/llvm/Support/ScopedPrinter.h
    llvm/lib/Support/ScopedPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/ScopedPrinter.h b/llvm/include/llvm/Support/ScopedPrinter.h
index 88daedc8713b..c5e5386ce21d 100644
--- a/llvm/include/llvm/Support/ScopedPrinter.h
+++ b/llvm/include/llvm/Support/ScopedPrinter.h
@@ -56,9 +56,9 @@ struct HexNumber {
 };
 
 raw_ostream &operator<<(raw_ostream &OS, const HexNumber &Value);
-const std::string to_hexString(uint64_t Value, bool UpperCase = true);
+std::string to_hexString(uint64_t Value, bool UpperCase = true);
 
-template <class T> const std::string to_string(const T &Value) {
+template <class T> std::string to_string(const T &Value) {
   std::string number;
   llvm::raw_string_ostream stream(number);
   stream << Value;

diff  --git a/llvm/lib/Support/ScopedPrinter.cpp b/llvm/lib/Support/ScopedPrinter.cpp
index 981dfbff520a..779c6c45257d 100644
--- a/llvm/lib/Support/ScopedPrinter.cpp
+++ b/llvm/lib/Support/ScopedPrinter.cpp
@@ -12,7 +12,7 @@ raw_ostream &operator<<(raw_ostream &OS, const HexNumber &Value) {
   return OS;
 }
 
-const std::string to_hexString(uint64_t Value, bool UpperCase) {
+std::string to_hexString(uint64_t Value, bool UpperCase) {
   std::string number;
   llvm::raw_string_ostream stream(number);
   stream << format_hex_no_prefix(Value, 1, UpperCase);


        


More information about the llvm-commits mailing list