]> granicus.if.org Git - clang/commit
Replace Sema-level implementation of -fassume-sane-operator-new with a
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 7 Apr 2016 21:46:12 +0000 (21:46 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 7 Apr 2016 21:46:12 +0000 (21:46 +0000)
commit11e01c96af3b0f7d566cd47b317d49574161a167
tree1339d665c66e8691c9d0f367deacdfd0be9b447d
parent02c712e05977f0020bc16ad068f0453284b102bc
Replace Sema-level implementation of -fassume-sane-operator-new with a
CodeGen-level implementation. Instead of adding an attribute to clang's
FunctionDecl, add the IR attribute directly. This means a module built with
this flag is now compatible with code built without it and vice versa.

This change also results in the 'noalias' attribute no longer being added to
calls to operator new in the IR; it's now only added to the declaration. It
also fixes a bug where we failed to add the attribute to the 'nothrow' versions
(because we didn't implicitly declare them, there was no good time to inject a
fake attribute).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265728 91177308-0d34-0410-b5e6-96231b3b80d8
25 files changed:
include/clang/Basic/CodeGenOptions.def
include/clang/Basic/LangOptions.def
include/clang/Sema/Sema.h
lib/CodeGen/CodeGenModule.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Sema/SemaExprCXX.cpp
test/CodeGenCXX/align-avx-complete-objects.cpp
test/CodeGenCXX/arm.cpp
test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
test/CodeGenCXX/cxx11-initializer-array-new.cpp
test/CodeGenCXX/delete-two-arg.cpp
test/CodeGenCXX/exceptions.cpp
test/CodeGenCXX/goto.cpp
test/CodeGenCXX/microsoft-abi-array-cookies.cpp
test/CodeGenCXX/mips-size_t-ptrdiff_t.cpp
test/CodeGenCXX/multi-dim-operator-new.cpp
test/CodeGenCXX/new-alias.cpp
test/CodeGenCXX/new-array-init.cpp
test/CodeGenCXX/new-overflow.cpp
test/CodeGenCXX/new.cpp
test/CodeGenCXX/operator-new.cpp
test/CodeGenCXX/static-init.cpp
test/CodeGenObjCXX/arc-new-delete.mm
test/CodeGenObjCXX/copy.mm
test/Modules/explicit-build-flags.cpp