[clang] [CodeGen] Hidden visibility for prof version var (PR #93496)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 27 18:47:01 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-codegen

Author: None (gulfemsavrun)

<details>
<summary>Changes</summary>

This patch adds hidden visibility to the variable
that is used by the single byte counters mode in
source-based code coverage.

---
Full diff: https://github.com/llvm/llvm-project/pull/93496.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/CodeGenPGO.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index 76704c4d7be4a..db8e6f55302ad 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -1340,7 +1340,7 @@ void CodeGenPGO::setProfileVersion(llvm::Module &M) {
                                         llvm::APInt(64, ProfileVersion)),
         VarName);
 
-    IRLevelVersionVariable->setVisibility(llvm::GlobalValue::DefaultVisibility);
+    IRLevelVersionVariable->setVisibility(llvm::GlobalValue::HiddenVisibility);
     llvm::Triple TT(M.getTargetTriple());
     if (TT.supportsCOMDAT()) {
       IRLevelVersionVariable->setLinkage(llvm::GlobalValue::ExternalLinkage);

``````````

</details>


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


More information about the cfe-commits mailing list