aboutsummaryrefslogtreecommitdiff
path: root/Driver/clang.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Driver/clang.cpp')
-rw-r--r--Driver/clang.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 59c3799023..72d2b9c1db 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -515,7 +515,10 @@ static llvm::cl::list<std::string>
TargetFeatures("mattr", llvm::cl::CommaSeparated,
llvm::cl::desc("Target specific attributes (-mattr=help for details)"));
-
+static llvm::cl::opt<unsigned>
+TemplateDepth("ftemplate-depth", llvm::cl::init(99),
+ llvm::cl::desc("Maximum depth of recursive template "
+ "instantiation"));
// FIXME: add:
// -fdollars-in-identifiers
@@ -642,6 +645,8 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
Options.MathErrno = MathErrno;
+ Options.InstantiationDepth = TemplateDepth;
+
// Override the default runtime if the user requested it.
if (NeXTRuntime)
Options.NeXTRuntime = 1;