[PATCH] D45815: [libclang] Allow skipping function bodies in preamble only

Nikolai Kosjar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 8 01:56:39 PDT 2018


nik added inline comments.


================
Comment at: include/clang/Frontend/ASTUnit.h:370
+      IntrusiveRefCntPtr<vfs::FileSystem> VFS,
+      SkipFunctionBodiesScope SkipFunctionBodiesScp =
+          SkipFunctionBodiesScope::None,
----------------
ilya-biryukov wrote:
> NIT: Maybe keep the name `SkipFunctionBodies`? It seems that putting `Scp` at the end does not add any clarity.
IIRC I've done that to better distinguish it from e.g. "getFrontendOpts().SkipFunctionBodies", but yes, they are not so often used together, removed "Scp" suffix.


================
Comment at: include/clang/Frontend/ASTUnit.h:831
                ArrayRef<RemappedFile> RemappedFiles = None,
+               SkipFunctionBodiesScope SkipFunctionBodiesScp =
+                   SkipFunctionBodiesScope::None,
----------------
ilya-biryukov wrote:
> 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`.
Agree, this makes the change significantly shorter :)


Repository:
  rC Clang

https://reviews.llvm.org/D45815





More information about the cfe-commits mailing list