diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2009-12-16 16:59:22 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2009-12-16 16:59:22 +0000 |
commit | fc2844846e91398205fddc71196fe9dda04e105f (patch) | |
tree | ac559da7abd78c1dc3d305257a1c726c6046f222 /lib/Driver/Tools.cpp | |
parent | 52bb5d2a1474460707e5ca11656b2749a7a33a82 (diff) |
implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.
feel free to chage the name to this lengthy argument
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 70597ab913..8d82318127 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -945,6 +945,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (!Args.hasFlag(options::OPT_fbuiltin, options::OPT_fno_builtin)) CmdArgs.push_back("-fno-builtin"); + if (!Args.hasFlag(options::OPT_fassume_sane_operator_new, + options::OPT_fno_assume_sane_operator_new)) + CmdArgs.push_back("-fno-assume-sane-operator-new"); + // -fblocks=0 is default. if (Args.hasFlag(options::OPT_fblocks, options::OPT_fno_blocks, getToolChain().IsBlocksDefault())) { |