[PATCH] D15833: [PGO] Enable clang to pass compiler-rt profile support library to linker on Windows
Nathan Slingerland via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 4 15:16:12 PST 2016
slingn updated this revision to Diff 43932.
slingn added a comment.
Updated for davidxl's comments:
-Added test for linker flag in test/Driver/instrprof-ld.c
http://reviews.llvm.org/D15833
Files:
lib/Driver/Tools.cpp
test/Driver/instrprof-ld.c
Index: test/Driver/instrprof-ld.c
===================================================================
--- test/Driver/instrprof-ld.c
+++ test/Driver/instrprof-ld.c
@@ -105,3 +105,17 @@
//
// CHECK-WATCHOS-ARMV7: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-WATCHOS-ARMV7: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_watchos.a"
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target i386-pc-win32 -fprofile-instr-generate \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: | FileCheck --check-prefix=CHECK-WINDOWS --check-prefix=CHECK-WINDOWS-I386 %s
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-pc-win32 -fprofile-instr-generate \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: | FileCheck --check-prefix=CHECK-WINDOWS --check-prefix=CHECK-WINDOWS-X86-64 %s
+//
+// CHECK-WINDOWS: "{{(.*[^-.0-9A-Z_a-z])?}}link{{(.exe)?}}"
+// CHECK-WINDOWS-I386: "{{.*}}clang_rt.profile-i386.lib"
+// CHECK-WINDOWS-X86-64: "{{.*}}clang_rt.profile-x86_64.lib"
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -9473,6 +9473,8 @@
A.renderAsInput(Args, CmdArgs);
}
+ TC.addProfileRTLibs(Args, CmdArgs);
+
// We need to special case some linker paths. In the case of lld, we need to
// translate 'lld' into 'lld-link', and in the case of the regular msvc
// linker, we need to use a special search algorithm.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15833.43932.patch
Type: text/x-patch
Size: 1569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160104/31e1390e/attachment.bin>
More information about the llvm-commits
mailing list