simark created this revision. Herald added subscribers: cfe-commits, ioeric, ilya-biryukov.
It does the obvious thing of comparing all fields. This will be needed for a clangd patch I have in the pipeline. Repository: rC Clang https://reviews.llvm.org/D49265 Files: include/clang/Tooling/CompilationDatabase.h Index: include/clang/Tooling/CompilationDatabase.h =================================================================== --- include/clang/Tooling/CompilationDatabase.h +++ include/clang/Tooling/CompilationDatabase.h @@ -59,6 +59,11 @@ /// The output file associated with the command. std::string Output; + + bool operator==(const CompileCommand &RHS) const { + return Directory == RHS.Directory && Filename == RHS.Filename && + CommandLine == RHS.CommandLine && Output == RHS.Output; + } }; /// Interface for compilation databases.
Index: include/clang/Tooling/CompilationDatabase.h =================================================================== --- include/clang/Tooling/CompilationDatabase.h +++ include/clang/Tooling/CompilationDatabase.h @@ -59,6 +59,11 @@ /// The output file associated with the command. std::string Output; + + bool operator==(const CompileCommand &RHS) const { + return Directory == RHS.Directory && Filename == RHS.Filename && + CommandLine == RHS.CommandLine && Output == RHS.Output; + } }; /// Interface for compilation databases.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits