[libclang] Allow skipping function bodies in preamble only
authorIvan Donchevskii <ivan.donchevskii@qt.io>
Thu, 17 May 2018 07:31:29 +0000 (07:31 +0000)
committerIvan Donchevskii <ivan.donchevskii@qt.io>
Thu, 17 May 2018 07:31:29 +0000 (07:31 +0000)
commitf4b09a3a30875842ea4f8e8fce22936a2a29164e
tree2bb66578ef79379869c71cd47850b712d03ac02e
parent81a76a388a35e4f58c897df328852f7b6482b9eb
[libclang] Allow skipping function bodies in preamble only

As an addition to CXTranslationUnit_SkipFunctionBodies, provide the
new option CXTranslationUnit_LimitSkipFunctionBodiesToPreamble,
which constraints the skipping of functions bodies to the preamble
only. Function bodies in the main file are not affected if this
option is set.

Skipping function bodies only in the preamble is what clangd already
does and the introduced flag implements it for libclang clients.

Patch by Nikolai Kosjar.

Differential Revision: https://reviews.llvm.org/D45815

llvm-svn: 332578
clang/include/clang-c/Index.h
clang/include/clang/Frontend/ASTUnit.h
clang/lib/Frontend/ASTUnit.cpp
clang/test/Parser/skip-function-bodies.h [new file with mode: 0644]
clang/test/Parser/skip-function-bodies.mm
clang/tools/c-index-test/c-index-test.c
clang/tools/libclang/CIndex.cpp