summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-01-04 13:40:34 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-01-04 13:40:34 +0000
commitc1608f7f691438d6d457b317c681775621aeac7c (patch)
treed2c423d3ad6fefcb41862808037f0087736192fe /llvm/lib/Target/X86/X86TargetTransformInfo.cpp
parentaf16c50639289fd0875100519a1161bc7058f215 (diff)
downloadbcm5719-llvm-c1608f7f691438d6d457b317c681775621aeac7c.tar.gz
bcm5719-llvm-c1608f7f691438d6d457b317c681775621aeac7c.zip
Add -f[no-]strict-return flag that can be used to avoid undefined behaviour
in non-void functions that fall off at the end without returning a value when compiling C++. Clang uses the new compiler flag to determine when it should treat control flow paths that fall off the end of a non-void function as unreachable. If -fno-strict-return is on, the code generator emits the ureachable and trap IR only when the function returns either a record type with a non-trivial destructor or another non-trivially copyable type. The primary goal of this flag is to avoid treating falling off the end of a non-void function as undefined behaviour. The burden of undefined behaviour is placed on the caller instead: if the caller ignores the returned value then the undefined behaviour is avoided. This kind of behaviour is useful in several cases, e.g. when compiling C code in C++ mode. rdar://13102603 Differential Revision: https://reviews.llvm.org/D27163 llvm-svn: 290960
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetTransformInfo.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud