[PATCH] D39799: [Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 8 06:32:54 PST 2017

sammccall added inline comments.

Comment at: include/clang/Tooling/CompilationDatabase.h:188
+  static std::unique_ptr<FixedCompilationDatabase>
+  loadFromFile(StringRef Path, std::string &ErrorMsg);
klimek wrote:
> Perhaps loadFromTextFile?
This mirrors JSONCompilationDatabase for consistency.
Happy to change this one, change both, or leave as-is. WDYT?

Comment at: lib/Tooling/CompilationDatabase.cpp:312
+FixedCompilationDatabase::loadFromFile(StringRef Path, std::string &ErrorMsg) {
+  ErrorMsg.clear();
+  llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
klimek wrote:
> I assume we can't use ErrorOr as return value?
Again this mirrors JSONCompilationDatabase. (And also CompilationDatabasePlugin, which is harder to change)
Change this one, change both, or leave as-is?


More information about the cfe-commits mailing list