summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-07-02 19:56:23 +0000
committerDouglas Gregor <dgregor@apple.com>2012-07-02 19:56:23 +0000
commit271205cedbb47988415a09d2ce7813e2d3b038e7 (patch)
tree60ff54471c69e310cf8783c0d6a027f2efe9c433
parentcac3b9063320fdace01f1e994addf3b6823c8030 (diff)
downloadbcm5719-llvm-271205cedbb47988415a09d2ce7813e2d3b038e7.tar.gz
bcm5719-llvm-271205cedbb47988415a09d2ce7813e2d3b038e7.zip
Reduce default template instantiation depth to 512; we're blowing out
the stack too often with 1024. Fixes <rdar://problem/11678534>. llvm-svn: 159573
-rw-r--r--clang/include/clang/Basic/LangOptions.def2
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def
index b525e43e06a..381b1ba2f0b 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -149,7 +149,7 @@ ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff,
ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined,
"signed integer overflow handling")
-BENIGN_LANGOPT(InstantiationDepth, 32, 1024,
+BENIGN_LANGOPT(InstantiationDepth, 32, 512,
"maximum template instantiation depth")
BENIGN_LANGOPT(ConstexprCallDepth, 32, 512,
"maximum constexpr call depth")
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 391c2d27a80..943cb20e2dd 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2026,7 +2026,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Opts.AccessControl = !Args.hasArg(OPT_fno_access_control);
Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors);
Opts.MathErrno = Args.hasArg(OPT_fmath_errno);
- Opts.InstantiationDepth = Args.getLastArgIntValue(OPT_ftemplate_depth, 1024,
+ Opts.InstantiationDepth = Args.getLastArgIntValue(OPT_ftemplate_depth, 512,
Diags);
Opts.ConstexprCallDepth = Args.getLastArgIntValue(OPT_fconstexpr_depth, 512,
Diags);
OpenPOWER on IntegriCloud