summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2017-11-17 16:27:21 +0000
committerDave Lee <davelee.com@gmail.com>2017-11-17 16:27:21 +0000
commit984964a04f5fa6e957f632e61987861605e60213 (patch)
treef8ae1634affc4baa232d4f5aa41e5f7009c90fc7 /clang/lib
parentac358137f7395b4217eb65a1a860ed2eecf1d70e (diff)
downloadbcm5719-llvm-984964a04f5fa6e957f632e61987861605e60213.tar.gz
bcm5719-llvm-984964a04f5fa6e957f632e61987861605e60213.zip
Fix skipping of flags in getClangStripDependencyFileAdjuster
Summary: The ArgumentsAdjuster returned from `getClangStripDependencyFileAdjuster` will skip dependency flags, and also their associated values for those flags that take an argument. This change corrects the handling of the `-MD` and `-MMD` flags, which do not take an argument. Reviewers: saugustine, klimek, alexshap Reviewed By: alexshap Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40024 llvm-svn: 318529
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Tooling/ArgumentsAdjusters.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Tooling/ArgumentsAdjusters.cpp b/clang/lib/Tooling/ArgumentsAdjusters.cpp
index 962ea452585..7068ec2c401 100644
--- a/clang/lib/Tooling/ArgumentsAdjusters.cpp
+++ b/clang/lib/Tooling/ArgumentsAdjusters.cpp
@@ -58,14 +58,14 @@ ArgumentsAdjuster getClangStripDependencyFileAdjuster() {
StringRef Arg = Args[i];
// All dependency-file options begin with -M. These include -MM,
// -MF, -MG, -MP, -MT, -MQ, -MD, and -MMD.
- if (!Arg.startswith("-M"))
+ if (!Arg.startswith("-M")) {
AdjustedArgs.push_back(Args[i]);
+ continue;
+ }
- if ((Arg == "-MF") || (Arg == "-MT") || (Arg == "-MQ") ||
- (Arg == "-MD") || (Arg == "-MMD")) {
- // Output is specified as -MX foo. Skip the next argument also.
+ if (Arg == "-MF" || Arg == "-MT" || Arg == "-MQ")
+ // These flags take an argument: -MX foo. Skip the next argument also.
++i;
- }
}
return AdjustedArgs;
};
OpenPOWER on IntegriCloud