Skip to content

Commit 7fec45e

Browse files
committed
Add comment why we unconditionally add nomerge
1 parent e49834b commit 7fec45e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3928,6 +3928,9 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
39283928
CGM.getCodeGenOpts().TrapFuncName);
39293929
TrapCall->addFnAttr(A);
39303930
}
3931+
// We unconditionally add NoMerge, even if this is the first time we've
3932+
// seen this type of trap in this function. This is necessary because
3933+
// inlining may occur in later stages.
39313934
TrapCall->addFnAttr(llvm::Attribute::NoMerge);
39323935
TrapCall->setDoesNotReturn();
39333936
TrapCall->setDoesNotThrow();

0 commit comments

Comments
 (0)