summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-04-08 21:13:13 +0000
committerDouglas Gregor <dgregor@apple.com>2013-04-08 21:13:13 +0000
commit0ad5e2aa35755e7538c72198c07274deb7d89e19 (patch)
treebd3fb8388f63990792ebada7cbd75bdc9aa6eb44
parente373235c7cf8e32dd9fff2dfb9d0e8bd6ee26835 (diff)
downloadbcm5719-llvm-0ad5e2aa35755e7538c72198c07274deb7d89e19.tar.gz
bcm5719-llvm-0ad5e2aa35755e7538c72198c07274deb7d89e19.zip
<rdar://problem/13559825> Further reduce template instantiation depth down to 256, since we're blowing the stack for a trivial "factorial" class template.
llvm-svn: 179057
-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 3de0107dff6..b17dfbc9b52 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -156,7 +156,7 @@ ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff,
ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined,
"signed integer overflow handling")
-BENIGN_LANGOPT(InstantiationDepth, 32, 512,
+BENIGN_LANGOPT(InstantiationDepth, 32, 256,
"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 41f941729a6..324b6e38306 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1244,7 +1244,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, 512,
+ Opts.InstantiationDepth = Args.getLastArgIntValue(OPT_ftemplate_depth, 256,
Diags);
Opts.ConstexprCallDepth = Args.getLastArgIntValue(OPT_fconstexpr_depth, 512,
Diags);
OpenPOWER on IntegriCloud