Skip to content

Commit

Permalink
rewriter: avoid warnings from multiple -DIA2_ENABLE= flags
Browse files Browse the repository at this point in the history
  • Loading branch information
fw-immunant committed Sep 21, 2023
1 parent 1d44f58 commit 4764e13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rewriter/SourceRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,10 @@ int main(int argc, const char **argv) {
options_parser.getSourcePathList());
tool.appendArgumentsAdjuster([&](const CommandLineArguments &args, llvm::StringRef filename) {
CommandLineArguments new_args(args);
// Try to remove existing definition from command line to avoid warnings.
new_args.erase(std::remove_if(new_args.begin(), new_args.end(),
[](std::string &x) { return x.starts_with("-DIA2_ENABLE="); }),
new_args.end());
new_args.push_back("-DIA2_ENABLE=0"s);
return new_args;
});
Expand Down

0 comments on commit 4764e13

Please sign in to comment.