aboutsummaryrefslogtreecommitdiff
path: root/tools/driver/cc1_main.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-08-02 15:31:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-08-02 15:31:28 +0000
commitf56a488a6bdfe56ca814f37d384afa67c67f9dd5 (patch)
tree31319eac06d434a1e21fe4314ea1c1199e649e01 /tools/driver/cc1_main.cpp
parent9c1845dbed9817520f5a7db8bd80a560c6c6ae6b (diff)
Frontend: Change PluginASTAction::ParseArgs to take a CompilerInstance object
for use in reporting diagnostics. - We don't want to use the Action's own CompilerInstance, because that is only initialized during file processing and I like that invariant. Also, if ParseArgs returns false then abandon execution. Also, remove unused PluginASTAction::PrintHelp virtual method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110039 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/cc1_main.cpp')
-rw-r--r--tools/driver/cc1_main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp
index 0942be1e46..0699b7f48d 100644
--- a/tools/driver/cc1_main.cpp
+++ b/tools/driver/cc1_main.cpp
@@ -83,14 +83,14 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
case ParseSyntaxOnly: return new SyntaxOnlyAction();
case PluginAction: {
-
for (FrontendPluginRegistry::iterator it =
FrontendPluginRegistry::begin(), ie = FrontendPluginRegistry::end();
it != ie; ++it) {
if (it->getName() == CI.getFrontendOpts().ActionName) {
- PluginASTAction* plugin = it->instantiate();
- plugin->ParseArgs(CI.getFrontendOpts().PluginArgs);
- return plugin;
+ llvm::OwningPtr<PluginASTAction> P(it->instantiate());
+ if (!P->ParseArgs(CI, CI.getFrontendOpts().PluginArgs))
+ return 0;
+ return P.take();
}
}
@@ -287,7 +287,7 @@ int cc1_main(const char **ArgBegin, const char **ArgEnd,
// If any timers were active but haven't been destroyed yet, print their
// results now. This happens in -disable-free mode.
llvm::TimerGroup::printAll(llvm::errs());
-
+
// When running with -disable-free, don't do any destruction or shutdown.
if (Clang->getFrontendOpts().DisableFree) {
if (Clang->getFrontendOpts().ShowStats)