[cfe-commits] r127183 - /cfe/trunk/lib/Frontend/ASTUnit.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Mar 7 14:45:01 PST 2011
Author: akirtzidis
Date: Mon Mar 7 16:45:01 2011
New Revision: 127183
URL: http://llvm.org/viewvc/llvm-project?rev=127183&view=rev
Log:
Allow passing '-###' to ASTUnit::LoadFromCommandLine to print out the cc1 options.
Modified:
cfe/trunk/lib/Frontend/ASTUnit.cpp
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=127183&r1=127182&r2=127183&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Mon Mar 7 16:45:01 2011
@@ -20,6 +20,8 @@
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/Job.h"
+#include "clang/Driver/ArgList.h"
+#include "clang/Driver/Options.h"
#include "clang/Driver/Tool.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
@@ -1613,6 +1615,12 @@
llvm::OwningPtr<driver::Compilation> C(
TheDriver.BuildCompilation(Args.size(), Args.data()));
+ // Just print the cc1 options if -### was present.
+ if (C->getArgs().hasArg(driver::options::OPT__HASH_HASH_HASH)) {
+ C->PrintJob(llvm::errs(), C->getJobs(), "\n", true);
+ return 0;
+ }
+
// We expect to get back exactly one command job, if we didn't something
// failed.
const driver::JobList &Jobs = C->getJobs();
More information about the cfe-commits
mailing list