diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-11-18 16:14:27 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-11-18 16:14:27 +0000 |
commit | b1dfd660998cc98c27541047a6f255808c232d62 (patch) | |
tree | 3b5989a86a26a44c538d3866940247cbe58f4180 /include/clang-c | |
parent | 980d9c87b942f16521e39fd308bdc7f6aef78da2 (diff) |
[libclang] Add entry points that take a full command line including argv[0].
This provides both a more uniform interface and makes libclang behave like
clang tooling wrt relative paths against argv[0]. This is necessary for
finding paths to a c++ standard library relative to a clang binary given
in a compilation database. It can also be used to find paths relative to
libclang.so if the full path to it is passed in.
Differential Revision: http://reviews.llvm.org/D14695
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang-c')
-rw-r--r-- | include/clang-c/Index.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 98278515e5..97d1ddecd9 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -1289,6 +1289,17 @@ clang_parseTranslationUnit2(CXIndex CIdx, CXTranslationUnit *out_TU); /** + * \brief Same as clang_parseTranslationUnit2 but requires a full command line + * for \c command_line_args including argv[0]. This is useful if the standard + * library paths are relative to the binary. + */ +CINDEX_LINKAGE enum CXErrorCode clang_parseTranslationUnit2FullArgv( + CXIndex CIdx, const char *source_filename, + const char *const *command_line_args, int num_command_line_args, + struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, + unsigned options, CXTranslationUnit *out_TU); + +/** * \brief Flags that control how translation units are saved. * * The enumerators in this enumeration type are meant to be bitwise @@ -5681,6 +5692,18 @@ CINDEX_LINKAGE int clang_indexSourceFile(CXIndexAction, unsigned TU_options); /** + * \brief Same as clang_indexSourceFile but requires a full command line + * for \c command_line_args including argv[0]. This is useful if the standard + * library paths are relative to the binary. + */ +CINDEX_LINKAGE int clang_indexSourceFileFullArgv( + CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, + unsigned index_callbacks_size, unsigned index_options, + const char *source_filename, const char *const *command_line_args, + int num_command_line_args, struct CXUnsavedFile *unsaved_files, + unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options); + +/** * \brief Index the given translation unit via callbacks implemented through * #IndexerCallbacks. * |