ilya-biryukov added inline comments.

================
Comment at: include/clang/Frontend/ASTUnit.h:104
 
+  enum class SkipFunctionBodiesScope { None, MainFileAndPreamble, Preamble };
+
----------------
Maybe move this out of `ASTUnit`? Would allow removing the first qualifier in 
usages outside the class itself (i.e. 
`ASTUnit::SkipFunctionBodiesScope::Preamble` will be shorter!)


================
Comment at: include/clang/Frontend/ASTUnit.h:370
+      IntrusiveRefCntPtr<vfs::FileSystem> VFS,
+      SkipFunctionBodiesScope SkipFunctionBodiesScp =
+          SkipFunctionBodiesScope::None,
----------------
NIT: Maybe keep the name `SkipFunctionBodies`? It seems that putting `Scp` at 
the end does not add any clarity.


================
Comment at: include/clang/Frontend/ASTUnit.h:831
                ArrayRef<RemappedFile> RemappedFiles = None,
+               SkipFunctionBodiesScope SkipFunctionBodiesScp =
+                   SkipFunctionBodiesScope::None,
----------------
This parameter seems slightly out of place.
The scope of skipped function bodies should be a property of the whole 
`ASTUnit`, changing it on every reparse would mean more complexity and wouldn't 
be used anyway.

I suggest storing a field of type `SkipFunctionBodiesScope` instead of adding 
parameters to `Reparse` and `LoadFromCompilerInvocation`.


Repository:
  rC Clang

https://reviews.llvm.org/D45815



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to