[PATCH] D51314: Parse compile commands lazily in InterpolatingCompilationDatabase

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 28 07:55:46 PDT 2018


sammccall accepted this revision.
sammccall added inline comments.


================
Comment at: lib/Tooling/InterpolatingCompilationDatabase.cpp:127
   // Language detected from -x or the filename.
-  types::ID Type = types::TY_INVALID;
+  // When set, cannot be TY_INVALID.
+  llvm::Optional<types::ID> Type;
----------------
(or just "never TY_INVALID" which would fit on prev line :-)


================
Comment at: lib/Tooling/InterpolatingCompilationDatabase.cpp:175
       Type = toType(LangStandard::getLangStandardForKind(Std).getLanguage());
-    Type = foldType(Type);
+    if (Type)
+      Type = foldType(*Type);
----------------
it's always set here, drop the condition.


================
Comment at: lib/Tooling/InterpolatingCompilationDatabase.cpp:408
   BumpPtrAllocator Arena;
-  StringSaver Strings;
+  llvm::StringSaver Strings;
   // Indexes of candidates by certain substrings.
----------------
nit: no llvm:: :-)


Repository:
  rC Clang

https://reviews.llvm.org/D51314





More information about the cfe-commits mailing list