[cfe-commits] r159573 - in /cfe/trunk: include/clang/Basic/LangOptions.def lib/Frontend/CompilerInvocation.cpp

Douglas Gregor dgregor at apple.com
Mon Jul 2 12:56:23 PDT 2012


Author: dgregor
Date: Mon Jul  2 14:56:23 2012
New Revision: 159573

URL: http://llvm.org/viewvc/llvm-project?rev=159573&view=rev
Log:
Reduce default template instantiation depth to 512; we're blowing out
the stack too often with 1024. Fixes <rdar://problem/11678534>.

Modified:
    cfe/trunk/include/clang/Basic/LangOptions.def
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/Basic/LangOptions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=159573&r1=159572&r2=159573&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/LangOptions.def (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.def Mon Jul  2 14:56:23 2012
@@ -149,7 +149,7 @@
 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")

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=159573&r1=159572&r2=159573&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Jul  2 14:56:23 2012
@@ -2026,7 +2026,7 @@
   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);





More information about the cfe-commits mailing list