================ @@ -39,7 +40,25 @@ class MockDirectoryCompilationDatabase : public MockCompilationDatabase { void addFile(llvm::StringRef Path, llvm::StringRef Contents); std::unique_ptr<ProjectModules> getProjectModules(PathRef) const override { - return scanningProjectModules(MockedCDBPtr, TFS); + auto Modules = scanningProjectModules(MockedCDBPtr, TFS); + Modules->setCommandProvider( + [this](tooling::CompileCommand &Command, PathRef) { + for (auto &Flag : ExcludeFlags) { + auto const It = std::find(Command.CommandLine.begin(), + Command.CommandLine.end(), Flag); + if (It != Command.CommandLine.end()) + Command.CommandLine.erase(It); + } + }); + return Modules; + } + + void addExtraClangFlag(std::string Flag) { + this->ExtraClangFlags.push_back(std::move(Flag)); ---------------- kadircet wrote:
`ExtraClangFlags` are already public, you can directly update them un the relevant tests. https://github.com/llvm/llvm-project/pull/122606 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits