[PATCH] D20078: PGO] Fix __llvm_profile_raw_version linkage in MACHO

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 14:09:21 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL268969: [PGO] Fix __llvm_profile_raw_version linkage in MACHO (authored by xur).

Changed prior to commit:
  http://reviews.llvm.org/D20078?vs=56616&id=56629#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20078

Files:
  llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/trunk/test/Transforms/PGOProfile/macho.ll

Index: llvm/trunk/test/Transforms/PGOProfile/macho.ll
===================================================================
--- llvm/trunk/test/Transforms/PGOProfile/macho.ll
+++ llvm/trunk/test/Transforms/PGOProfile/macho.ll
@@ -0,0 +1,9 @@
+; RUN: opt < %s -mtriple=x86_64-apple-macosx10.11.0 -pgo-instr-gen -instrprof -S | llc | FileCheck %s --check-prefix=MACHO-DIRECTIVE
+
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+
+; MACHO-DIRECTIVE: .weak_definition        ___llvm_profile_raw_version
+define i32 @test_macho(i32 %i) {
+entry:
+  ret i32 %i
+}
Index: llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -776,7 +776,7 @@
   IRLevelVersionVariable->setVisibility(GlobalValue::DefaultVisibility);
   Triple TT(M.getTargetTriple());
   if (TT.isOSBinFormatMachO())
-    IRLevelVersionVariable->setLinkage(GlobalValue::LinkOnceODRLinkage);
+    IRLevelVersionVariable->setLinkage(GlobalValue::LinkOnceAnyLinkage);
   else
     IRLevelVersionVariable->setComdat(M.getOrInsertComdat(
         StringRef(INSTR_PROF_QUOTE(IR_LEVEL_PROF_VERSION_VAR))));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20078.56629.patch
Type: text/x-patch
Size: 1292 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160509/ffb29212/attachment.bin>


More information about the llvm-commits mailing list