[PATCH] D40024: Fix skipping of flags in getClangStripDependencyFileAdjuster
Dave Lee via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 14 06:04:52 PST 2017
kastiglione created this revision.
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.
https://reviews.llvm.org/D40024
Files:
lib/Tooling/ArgumentsAdjusters.cpp
Index: lib/Tooling/ArgumentsAdjusters.cpp
===================================================================
--- lib/Tooling/ArgumentsAdjusters.cpp
+++ lib/Tooling/ArgumentsAdjusters.cpp
@@ -61,11 +61,9 @@
if (!Arg.startswith("-M"))
AdjustedArgs.push_back(Args[i]);
- 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;
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40024.122828.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171114/aa563a36/attachment.bin>
More information about the cfe-commits
mailing list