summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-04-22 22:18:13 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-04-22 22:18:13 +0000
commit1c229c0472edfd59ce61ba063a93517df609ceb4 (patch)
tree1e04ded322353a75ad11c8a4abc2062bda412992 /clang/lib/Driver/Tools.cpp
parent91956aba03217e41b7664cdfc575907593067f39 (diff)
downloadbcm5719-llvm-1c229c0472edfd59ce61ba063a93517df609ceb4.tar.gz
bcm5719-llvm-1c229c0472edfd59ce61ba063a93517df609ceb4.zip
Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.
Using this flag is necessary for compatibility with Microsoft template code. This also provides some parsing speed improvement. llvm-svn: 130022
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index c1f7e15c88e..4e94346de13 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -1605,6 +1605,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_fno_borland_extensions, false))
CmdArgs.push_back("-fborland-extensions");
+ // -fno-delayed-template-parsing is default.
+ if (Args.hasFlag(options::OPT_fdelayed_template_parsing,
+ options::OPT_fno_delayed_template_parsing,
+ false))
+ CmdArgs.push_back("-fdelayed-template-parsing");
+
// -fgnu-keywords default varies depending on language; only pass if
// specified.
if (Arg *A = Args.getLastArg(options::OPT_fgnu_keywords,
OpenPOWER on IntegriCloud