aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2022-06-09 16:58:09 +0200
committerJan Svoboda <jan_svoboda@apple.com>2022-06-13 13:30:56 +0200
commitc12577c61dbf37b1b6ae25ed422a900ac71f18fe (patch)
tree8e1b78c1d2ab7f7db1f9e47eaa6fb60013c6f8e5 /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
parent84b9ae662419ce97b3cb13879be431f6a0c9eaa4 (diff)
downloadllvm-c12577c61dbf37b1b6ae25ed422a900ac71f18fe.zip
llvm-c12577c61dbf37b1b6ae25ed422a900ac71f18fe.tar.gz
llvm-c12577c61dbf37b1b6ae25ed422a900ac71f18fe.tar.bz2
[clang][driver] Introduce new -fdriver-only flag
This patch introduces the new -fdriver-only flag which instructs Clang to only execute the driver logic without running individual jobs. In a way, this is very similar to -###, with the following differences: * it doesn't automatically print all jobs, * it doesn't avoid side effects (e.g. it will generate compilation database when -MJ is specified). This flag will be useful in testing D121997. Reviewed By: dexonsmith, egorzhdan Differential Revision: https://reviews.llvm.org/D127408
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r--clang/lib/Frontend/CreateInvocationFromCommandLine.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
index 49e814b..35b5e21 100644
--- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
+++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
@@ -54,6 +54,9 @@ clang::createInvocation(ArrayRef<const char *> ArgList,
if (!C)
return nullptr;
+ if (C->getArgs().hasArg(driver::options::OPT_fdriver_only))
+ return nullptr;
+
// Just print the cc1 options if -### was present.
if (C->getArgs().hasArg(driver::options::OPT__HASH_HASH_HASH)) {
C->getJobs().Print(llvm::errs(), "\n", true);