[llvm] [IR] Handle `.__uniq.` in `getGlobalIndentifier` for local linkage objects (PR #98163)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 15:53:46 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff ce03155a1bd02fc078f710b5497be4e382bbe5d9 745177d9d3da1c3864fb14d0c89a36c62234ee00 -- llvm/include/llvm/IR/GlobalValue.h llvm/include/llvm/IR/ModuleSummaryIndex.h llvm/include/llvm/ProfileData/SampleProf.h llvm/lib/IR/Globals.cpp llvm/lib/ProfileData/InstrProf.cpp llvm/lib/ProfileData/SampleProfWriter.cpp llvm/tools/dsymutil/MachODebugMapParser.cpp llvm/tools/gold/gold-plugin.cpp llvm/tools/llvm-profdata/llvm-profdata.cpp llvm/unittests/IR/FunctionTest.cpp llvm/unittests/IR/ModuleSummaryIndexTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h
index f5636ddb20..926636d9d5 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndex.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h
@@ -1756,7 +1756,8 @@ public:
   /// because it is possible in certain clients (not clang at the moment) for
   /// two rounds of ThinLTO optimization and therefore promotion to occur.
   static StringRef getOriginalNameBeforePromote(StringRef Name) {
-    std::pair<StringRef, StringRef> Pair = Name.rsplit(NameParticles::LLVMSuffix);
+    std::pair<StringRef, StringRef> Pair =
+        Name.rsplit(NameParticles::LLVMSuffix);
     return Pair.first;
   }
 
diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h
index 2fdd23bccb..a05cd40455 100644
--- a/llvm/include/llvm/ProfileData/SampleProf.h
+++ b/llvm/include/llvm/ProfileData/SampleProf.h
@@ -1107,7 +1107,8 @@ public:
         StringRef Suffix(Suf);
         // If the profile contains ".__uniq." suffix, don't strip the
         // suffix for names in the IR.
-        if (Suffix == NameParticles::UniqSuffix && FunctionSamples::HasUniqSuffix)
+        if (Suffix == NameParticles::UniqSuffix &&
+            FunctionSamples::HasUniqSuffix)
           continue;
         auto It = Cand.rfind(Suffix);
         if (It == StringRef::npos)

``````````

</details>


https://github.com/llvm/llvm-project/pull/98163


More information about the llvm-commits mailing list