Mark __cfi_check as dso_local.

llvm-svn: 328825
This commit is contained in:
Rafael Espindola 2018-03-29 20:51:30 +00:00
parent 4129308413
commit 54d44bf14c
2 changed files with 4 additions and 0 deletions

View File

@ -3010,6 +3010,7 @@ void CodeGenFunction::EmitCfiCheckStub() {
llvm::Function *F = llvm::Function::Create( llvm::Function *F = llvm::Function::Create(
llvm::FunctionType::get(VoidTy, {Int64Ty, Int8PtrTy, Int8PtrTy}, false), llvm::FunctionType::get(VoidTy, {Int64Ty, Int8PtrTy, Int8PtrTy}, false),
llvm::GlobalValue::WeakAnyLinkage, "__cfi_check", M); llvm::GlobalValue::WeakAnyLinkage, "__cfi_check", M);
CGM.setDSOLocal(F);
llvm::BasicBlock *BB = llvm::BasicBlock::Create(Ctx, "entry", F); llvm::BasicBlock *BB = llvm::BasicBlock::Create(Ctx, "entry", F);
// FIXME: consider emitting an intrinsic call like // FIXME: consider emitting an intrinsic call like
// call void @llvm.cfi_check(i64 %0, i8* %1, i8* %2) // call void @llvm.cfi_check(i64 %0, i8* %1, i8* %2)

View File

@ -66,6 +66,9 @@ Fn h1() {
inline void foo() {} inline void foo() {}
void bar() { 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: !{i32 4, !"Cross-DSO CFI", i32 1}
// Check that the type entries are correct. // Check that the type entries are correct.