diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-22 01:59:51 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-22 01:59:51 +0000 |
commit | b3a145293dc800bb5bfc8031892713227e686e7e (patch) | |
tree | 282c8af52c67dbce5e39e5787bd8bfeb15806456 /clang/lib/Driver/Tools.cpp | |
parent | 5772f82d1eaf8284fe2f2d637282091a484c13a4 (diff) | |
download | bcm5719-llvm-b3a145293dc800bb5bfc8031892713227e686e7e.tar.gz bcm5719-llvm-b3a145293dc800bb5bfc8031892713227e686e7e.zip |
Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting
levels for parentheses, brackets and braces.
Some code with heavy macro use exceeds the default limit of 256, but we don't
want to increase it generally to avoid stack overflow on stack-constrained
systems.
llvm-svn: 175855
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index ebbabcfdf9c..c26b20d4366 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -2520,6 +2520,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(A->getValue()); } + if (Arg *A = Args.getLastArg(options::OPT_fbracket_depth_EQ)) { + CmdArgs.push_back("-fbracket-depth"); + CmdArgs.push_back(A->getValue()); + } + if (Arg *A = Args.getLastArg(options::OPT_Wlarge_by_value_copy_EQ, options::OPT_Wlarge_by_value_copy_def)) { if (A->getNumValues()) { |