summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-05-04 05:57:24 +0000
committerAlexis Hunt <alercah@gmail.com>2011-05-04 05:57:24 +0000
commit6118d6642b8f49a4cb2f07ccf241f4feb3f09c4f (patch)
treea590c4ef436a47584c05f05a0edcd1f626d624c4 /clang/lib/Frontend/CompilerInvocation.cpp
parent6d9f061a6ba3d1bb653ca0e966a921fd5fe923af (diff)
downloadbcm5719-llvm-6118d6642b8f49a4cb2f07ccf241f4feb3f09c4f.tar.gz
bcm5719-llvm-6118d6642b8f49a4cb2f07ccf241f4feb3f09c4f.zip
Implement a better version of delegating constructor cycle detection.
This is more efficient as it's all done at once at the end of the TU. This could still get expensive, so a flag is provided to disable it. As an added bonus, the diagnostics will now print out a cycle. The PCH test is XFAILed because we currently can't deal with a note emitted in the header and I, being tired, see no other way to verify the serialization of delegating constructors. We should probably address this problem /somehow/ but no good solution comes to mind. llvm-svn: 130836
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index b84e4c82b30..eadf1b39dcc 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -698,6 +698,9 @@ static void LangOptsToArgs(const LangOptions &Opts,
Res.push_back("-fdelayed-template-parsing");
if (Opts.Deprecated)
Res.push_back("-fdeprecated-macro");
+
+ if (Opts.CheckDelegatingCtorCycles)
+ Res.push_back("-fcheck-delegating-ctor-cycles");
}
static void PreprocessorOptsToArgs(const PreprocessorOptions &Opts,
@@ -1565,6 +1568,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Opts.MRTD = Args.hasArg(OPT_mrtd);
Opts.FakeAddressSpaceMap = Args.hasArg(OPT_ffake_address_space_map);
Opts.ParseUnknownAnytype = Args.hasArg(OPT_funknown_anytype);
+ Opts.CheckDelegatingCtorCycles
+ = !Args.hasArg(OPT_fno_check_delegating_ctor_cycles);
// Record whether the __DEPRECATED define was requested.
Opts.Deprecated = Args.hasFlag(OPT_fdeprecated_macro,
OpenPOWER on IntegriCloud