[clang] Do not merge traps in functions annotated optnone
authorHenrik G. Olsson <hnrklssn@gmail.com>
Wed, 30 Nov 2022 13:59:49 +0000 (14:59 +0100)
committerHenrik G. Olsson <hnrklssn@gmail.com>
Wed, 30 Nov 2022 14:06:32 +0000 (15:06 +0100)
commit8fa2e93538595e1ff973110cb3f301b65bc9d2eb
tree333ae66b98572e8e2c32bb6f7148789c62400d10
parent5ec9403e79887d68899c7451db11b3fc5f51692b
[clang] Do not merge traps in functions annotated optnone

This aligns the behaviour with that of disabling optimisations for the
translation unit entirely. Not merging the traps allows us to keep
separate debug information for each, improving the debugging experience
when finding the cause for a ubsan trap.

Differential Revision: https://reviews.llvm.org/D137714
clang/lib/CodeGen/CGExpr.cpp
clang/test/CodeGen/ubsan-trap-debugloc.c