[libclang] Allow skipping function bodies in preamble only
authorIvan Donchevskii <ivan.donchevskii@qt.io>
Thu, 17 May 2018 09:24:37 +0000 (09:24 +0000)
committerIvan Donchevskii <ivan.donchevskii@qt.io>
Thu, 17 May 2018 09:24:37 +0000 (09:24 +0000)
commit6e89528c557fe7e41b2c4946d75d1e5b36f62fd5
tree2f8458fec27372b1304faa4349faef6897b602a1
parent270ef5b85c9c0898ef76fee3e4ba5e3e5cb46c29
[libclang] Allow skipping function bodies in preamble only

Second attempt. Fix line endings and warning.

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: 332587
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