[llvm] r265217 - constify GlobalValue::getGUID() and GlobalValue::getGlobalIdentifier() (NFC)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 1 22:25:27 PDT 2016
Author: mehdi_amini
Date: Sat Apr 2 00:25:27 2016
New Revision: 265217
URL: http://llvm.org/viewvc/llvm-project?rev=265217&view=rev
Log:
constify GlobalValue::getGUID() and GlobalValue::getGlobalIdentifier() (NFC)
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
llvm/trunk/include/llvm/IR/GlobalValue.h
llvm/trunk/lib/IR/Globals.cpp
Modified: llvm/trunk/include/llvm/IR/GlobalValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/GlobalValue.h?rev=265217&r1=265216&r2=265217&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/GlobalValue.h (original)
+++ llvm/trunk/include/llvm/IR/GlobalValue.h Sat Apr 2 00:25:27 2016
@@ -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.
Modified: llvm/trunk/lib/IR/Globals.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Globals.cpp?rev=265217&r1=265216&r2=265217&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Globals.cpp (original)
+++ llvm/trunk/lib/IR/Globals.cpp Sat Apr 2 00:25:27 2016
@@ -123,7 +123,7 @@ std::string GlobalValue::getGlobalIdenti
return NewName;
}
-std::string GlobalValue::getGlobalIdentifier() {
+std::string GlobalValue::getGlobalIdentifier() const {
return getGlobalIdentifier(getName(), getLinkage(),
getParent()->getSourceFileName());
}
More information about the llvm-commits
mailing list