clang_reparseTranslationUnit

\brief Reparse the source files that produced this translation unit.

This routine can be used to re-parse the source files that originally created the given translation unit, for example because those source files have changed (either on disk or as passed via \p unsaved_files). The source code will be reparsed with the same command-line options as it was originally parsed.

Reparsing a translation unit invalidates all cursors and source locations that refer into that translation unit. This makes reparsing a translation unit semantically equivalent to destroying the translation unit and then creating a new translation unit with the same command-line arguments. However, it may be more efficient to reparse a translation unit using this routine.

\param TU The translation unit whose contents will be re-parsed. The translation unit must originally have been built with \c clang_createTranslationUnitFromSourceFile().

\param num_unsaved_files The number of unsaved file entries in \p unsaved_files.

\param unsaved_files The files that have not yet been saved to disk but may be required for parsing, including the contents of those files. The contents and name of these files (as specified by CXUnsavedFile) are copied when necessary, so the client only needs to guarantee their validity until the call to this function returns.

\param options A bitset of options composed of the flags in CXReparse_Flags. The function \c clang_defaultReparseOptions() produces a default set of options recommended for most uses, based on the translation unit.

\returns 0 if the sources could be reparsed. A non-zero error code will be returned if reparsing was impossible, such that the translation unit is invalid. In such cases, the only valid call for \c TU is \c clang_disposeTranslationUnit(TU). The error codes returned by this routine are described by the \c CXErrorCode enum.

extern (C)
int
clang_reparseTranslationUnit

Meta