[PATCH] D45052: Mark __cfi_check as dso_local
Rafael Avila de Espindola via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 29 10:02:51 PDT 2018
espindola created this revision.
espindola added reviewers: rnk, echristo.
https://reviews.llvm.org/D45052
Files:
lib/CodeGen/CGExpr.cpp
test/CodeGen/cfi-icall-cross-dso.c
Index: test/CodeGen/cfi-icall-cross-dso.c
===================================================================
--- test/CodeGen/cfi-icall-cross-dso.c
+++ test/CodeGen/cfi-icall-cross-dso.c
@@ -66,6 +66,9 @@
inline void foo() {}
void bar() { foo(); }
+// ITANIUM: define weak void @__cfi_check
+// MS: define weak dso_local void @__cfi_check
+
// CHECK: !{i32 4, !"Cross-DSO CFI", i32 1}
// Check that the type entries are correct.
Index: lib/CodeGen/CGExpr.cpp
===================================================================
--- lib/CodeGen/CGExpr.cpp
+++ lib/CodeGen/CGExpr.cpp
@@ -3010,6 +3010,7 @@
llvm::Function *F = llvm::Function::Create(
llvm::FunctionType::get(VoidTy, {Int64Ty, Int8PtrTy, Int8PtrTy}, false),
llvm::GlobalValue::WeakAnyLinkage, "__cfi_check", M);
+ CGM.setDSOLocal(F);
llvm::BasicBlock *BB = llvm::BasicBlock::Create(Ctx, "entry", F);
// FIXME: consider emitting an intrinsic call like
// call void @llvm.cfi_check(i64 %0, i8* %1, i8* %2)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45052.140277.patch
Type: text/x-patch
Size: 1002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180329/cd84edc7/attachment-0001.bin>
More information about the cfe-commits
mailing list