We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5104e30 commit 21f51b3Copy full SHA for 21f51b3
clang/lib/CodeGen/CGExpr.cpp
@@ -2758,10 +2758,11 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked) {
2758
llvm::CallInst *CodeGenFunction::EmitTrapCall(llvm::Intrinsic::ID IntrID) {
2759
llvm::CallInst *TrapCall = Builder.CreateCall(CGM.getIntrinsic(IntrID));
2760
2761
- if (!CGM.getCodeGenOpts().TrapFuncName.empty())
2762
- TrapCall->addAttribute(llvm::AttributeSet::FunctionIndex,
2763
- "trap-func-name",
2764
- CGM.getCodeGenOpts().TrapFuncName);
+ if (!CGM.getCodeGenOpts().TrapFuncName.empty()) {
+ auto A = llvm::Attribute::get(getLLVMContext(), "trap-func-name",
+ CGM.getCodeGenOpts().TrapFuncName);
+ TrapCall->addAttribute(llvm::AttributeSet::FunctionIndex, A);
2765
+ }
2766
2767
return TrapCall;
2768
}
0 commit comments