diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-13 05:36:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-13 05:36:37 +0000 |
commit | e93866800330987d31579ae2fb2a323ba46ffecf (patch) | |
tree | d1694e5a6171be6672aa217838df92177499fcb6 /clang/include/clang-c | |
parent | 568b7500febfd2da88edf36e9aa0c89a9a6be1e8 (diff) | |
download | bcm5719-llvm-e93866800330987d31579ae2fb2a323ba46ffecf.tar.gz bcm5719-llvm-e93866800330987d31579ae2fb2a323ba46ffecf.zip |
Implement clang_saveTranslationUnit(), which saves a translation unit
into a PCH/AST file.
llvm-svn: 111006
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r-- | clang/include/clang-c/Index.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index b3141f2dfe9..4216e96c604 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -765,6 +765,26 @@ CINDEX_LINKAGE CXTranslationUnit clang_parseTranslationUnit(CXIndex CIdx, unsigned options); /** + * \brief Saves a translation unit into a serialized representation of + * that translation unit on disk. + * + * Any translation unit that was parsed without error can be saved + * into a file. The translation unit can then be deserialized into a + * new \c CXTranslationUnit with \c clang_createTranslationUnit() or, + * if it is an incomplete translation unit that corresponds to a + * header, used as a precompiled header when parsing other translation + * units. + * + * \param TU The translation unit to save. + * \param FileName The file to which the translation unit will be saved. + * + * \returns Zero if the translation unit was saved successfully, a + * non-zero value otherwise. + */ +CINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU, + const char *FileName); + +/** * \brief Destroy the specified CXTranslationUnit object. */ CINDEX_LINKAGE void clang_disposeTranslationUnit(CXTranslationUnit); |