[llvm] afbd7d1 - [NFC] Coding style: drop `k` in `kGlobalIdentifierDelimiter` (#98230)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 9 15:44:58 PDT 2024
Author: Mircea Trofin
Date: 2024-07-09T15:44:55-07:00
New Revision: afbd7d1e7c7155b07561e46275a451fec917c34c
URL: https://github.com/llvm/llvm-project/commit/afbd7d1e7c7155b07561e46275a451fec917c34c
DIFF: https://github.com/llvm/llvm-project/commit/afbd7d1e7c7155b07561e46275a451fec917c34c.diff
LOG: [NFC] Coding style: drop `k` in `kGlobalIdentifierDelimiter` (#98230)
Added:
Modified:
llvm/include/llvm/IR/GlobalValue.h
llvm/lib/IR/Globals.cpp
llvm/lib/ProfileData/InstrProf.cpp
llvm/lib/ProfileData/InstrProfReader.cpp
llvm/tools/llvm-profdata/llvm-profdata.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/GlobalValue.h b/llvm/include/llvm/IR/GlobalValue.h
index 540a21c1118b8..53eddebdd6ae6 100644
--- a/llvm/include/llvm/IR/GlobalValue.h
+++ b/llvm/include/llvm/IR/GlobalValue.h
@@ -43,7 +43,7 @@ typedef unsigned ID;
// Choose ';' as the delimiter. ':' was used once but it doesn't work well for
// Objective-C functions which commonly have :'s in their names.
-inline constexpr char kGlobalIdentifierDelimiter = ';';
+inline constexpr char GlobalIdentifierDelimiter = ';';
class GlobalValue : public Constant {
public:
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp
index c51852987614c..cc37d7371cce3 100644
--- a/llvm/lib/IR/Globals.cpp
+++ b/llvm/lib/IR/Globals.cpp
@@ -169,7 +169,7 @@ std::string GlobalValue::getGlobalIdentifier(StringRef Name,
else
GlobalName += FileName;
- GlobalName += kGlobalIdentifierDelimiter;
+ GlobalName += GlobalIdentifierDelimiter;
}
GlobalName += Name;
return GlobalName;
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index 3c8bf1b962860..93876e87f20b3 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -401,7 +401,7 @@ std::string getPGOName(const GlobalVariable &V, bool InLTO) {
// See getIRPGOObjectName() for a discription of the format.
std::pair<StringRef, StringRef> getParsedIRPGOName(StringRef IRPGOName) {
- auto [FileName, MangledName] = IRPGOName.split(kGlobalIdentifierDelimiter);
+ auto [FileName, MangledName] = IRPGOName.split(GlobalIdentifierDelimiter);
if (MangledName.empty())
return std::make_pair(StringRef(), IRPGOName);
return std::make_pair(FileName, MangledName);
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index e18ce5d373d1c..e7b843362e5b3 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -1049,7 +1049,7 @@ class llvm::InstrProfReaderItaniumRemapper
// '_Z'; we'll assume that's the mangled name we want.
std::pair<StringRef, StringRef> Parts = {StringRef(), Name};
while (true) {
- Parts = Parts.second.split(kGlobalIdentifierDelimiter);
+ Parts = Parts.second.split(GlobalIdentifierDelimiter);
if (Parts.first.starts_with("_Z"))
return Parts.first;
if (Parts.second.empty())
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index 39cc87cc4cc65..1f6c4c604d57b 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -1123,7 +1123,7 @@ adjustInstrProfile(std::unique_ptr<WriterContext> &WC,
std::string FilePrefixes[] = {".cpp", "cc", ".c", ".hpp", ".h"};
size_t PrefixPos = StringRef::npos;
for (auto &FilePrefix : FilePrefixes) {
- std::string NamePrefix = FilePrefix + kGlobalIdentifierDelimiter;
+ std::string NamePrefix = FilePrefix + GlobalIdentifierDelimiter;
PrefixPos = Name.find_insensitive(NamePrefix);
if (PrefixPos == StringRef::npos)
continue;
More information about the llvm-commits
mailing list