diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-02 05:25:27 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-02 05:25:27 +0000 |
| commit | b049431bece74674269dc2b25b228916ab764cc2 (patch) | |
| tree | b7c14b5207db4285a1423fcc39514faa124f125a | |
| parent | 024a79f78055928ced8f7be620ef5106de80e2bf (diff) | |
| download | bcm5719-llvm-b049431bece74674269dc2b25b228916ab764cc2.tar.gz bcm5719-llvm-b049431bece74674269dc2b25b228916ab764cc2.zip | |
constify GlobalValue::getGUID() and GlobalValue::getGlobalIdentifier() (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 265217
| -rw-r--r-- | llvm/include/llvm/IR/GlobalValue.h | 4 | ||||
| -rw-r--r-- | llvm/lib/IR/Globals.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/IR/GlobalValue.h b/llvm/include/llvm/IR/GlobalValue.h index 987d7482ead..964d5095f34 100644 --- a/llvm/include/llvm/IR/GlobalValue.h +++ b/llvm/include/llvm/IR/GlobalValue.h @@ -318,7 +318,7 @@ public: /// Return the modified name for this global value suitable to be /// used as the key for a global lookup (e.g. profile or ThinLTO). - std::string getGlobalIdentifier(); + std::string getGlobalIdentifier() const; /// Declare a type to represent a global unique identifier for a global value. /// This is a 64 bits hash that is used by PGO and ThinLTO to have a compact @@ -331,7 +331,7 @@ public: /// Return a 64-bit global unique ID constructed from global value name /// (i.e. returned by getGlobalIdentifier()). - GUID getGUID() { return getGUID(getGlobalIdentifier()); } + GUID getGUID() const { return getGUID(getGlobalIdentifier()); } /// @name Materialization /// Materialization is used to construct functions only as they're needed. diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index 47827fb9999..bf86db2e98d 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -123,7 +123,7 @@ std::string GlobalValue::getGlobalIdentifier(StringRef Name, return NewName; } -std::string GlobalValue::getGlobalIdentifier() { +std::string GlobalValue::getGlobalIdentifier() const { return getGlobalIdentifier(getName(), getLinkage(), getParent()->getSourceFileName()); } |

