[PATCH] D56516: [SanitizerCoverage] Don't create comdat for interposable functions.
Matt Morehouse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 15 13:25:01 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL351247: [SanitizerCoverage] Don't create comdat for interposable functions. (authored by morehouse, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D56516?vs=181869&id=181870#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56516/new/
https://reviews.llvm.org/D56516
Files:
llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/trunk/test/Instrumentation/SanitizerCoverage/interposable-symbol-nocomdat.ll
Index: llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -568,7 +568,7 @@
*CurModule, ArrayTy, false, GlobalVariable::PrivateLinkage,
Constant::getNullValue(ArrayTy), "__sancov_gen_");
- if (TargetTriple.supportsCOMDAT())
+ if (TargetTriple.supportsCOMDAT() && !F.isInterposable())
if (auto Comdat =
GetOrCreateFunctionComdat(F, TargetTriple, CurModuleUniqueId))
Array->setComdat(Comdat);
Index: llvm/trunk/test/Instrumentation/SanitizerCoverage/interposable-symbol-nocomdat.ll
===================================================================
--- llvm/trunk/test/Instrumentation/SanitizerCoverage/interposable-symbol-nocomdat.ll
+++ llvm/trunk/test/Instrumentation/SanitizerCoverage/interposable-symbol-nocomdat.ll
@@ -0,0 +1,37 @@
+; Test that interposable symbols do not get put in comdats.
+; RUN: opt < %s -sancov -sanitizer-coverage-level=3 -sanitizer-coverage-trace-pc-guard -mtriple x86_64-linux-gnu -S | FileCheck %s
+; RUN: opt < %s -sancov -sanitizer-coverage-level=3 -sanitizer-coverage-trace-pc-guard -mtriple x86_64-windows-msvc -S | FileCheck %s
+
+define void @Vanilla() {
+entry:
+ ret void
+}
+
+define linkonce void @LinkOnce() {
+entry:
+ ret void
+}
+
+define weak void @Weak() {
+entry:
+ ret void
+}
+
+declare extern_weak void @ExternWeak()
+
+define linkonce_odr void @LinkOnceOdr() {
+entry:
+ ret void
+}
+
+define weak_odr void @WeakOdr() {
+entry:
+ ret void
+}
+
+; CHECK: define void @Vanilla() comdat {
+; CHECK: define linkonce void @LinkOnce() {
+; CHECK: define weak void @Weak() {
+; CHECK: declare extern_weak void @ExternWeak()
+; CHECK: define linkonce_odr void @LinkOnceOdr() comdat {
+; CHECK: define weak_odr void @WeakOdr() comdat {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56516.181870.patch
Type: text/x-patch
Size: 1947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190115/790cd6da/attachment.bin>
More information about the llvm-commits
mailing list