diff options
author | Manuel Klimek <klimek@google.com> | 2016-03-01 10:56:19 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2016-03-01 10:56:19 +0000 |
commit | ac0a11ae22d93e452b579b2adf6af933c49f9616 (patch) | |
tree | 6ca9dade319f3dc573c057c90fabbe555cb1e75a /include/clang-c | |
parent | 77355c758454c64d032a13df8a51a9ec9840d095 (diff) |
Optionally demote fatal errors to non-fatal errors.
This behavior is enabled when the new CXTranslationUnit_KeepGoing
option is passed to clang_parseTranslationUnit{,2}. It is geared
towards use by IDEs and similar consumers of the clang-c API where
fatal errors may arise when parsing incomplete code mid-edit, or
when include paths are not properly configured yet. In such situations
one still wants to get as much information as possible about a TU.
Previously, the semantic analysis would not instantiate templates
or report additional fatal errors after the first fatal error was
encountered.
Fixes PR24268.
Patch by Milian Wolff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang-c')
-rw-r--r-- | include/clang-c/Index.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 928412682c..a2d220dfd6 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -1208,7 +1208,18 @@ enum CXTranslationUnit_Flags { * trades runtime on the first parse (serializing the preamble takes time) for * reduced runtime on the second parse (can now reuse the preamble). */ - CXTranslationUnit_CreatePreambleOnFirstParse = 0x100 + CXTranslationUnit_CreatePreambleOnFirstParse = 0x100, + + /** + * \brief Do not stop processing when fatal errors are encountered. + * + * When fatal errors are encountered while parsing a translation unit, + * semantic analysis is typically stopped early when compiling code. A common + * source for fatal errors are unresolvable include files. For the + * purposes of an IDE, this is undesirable behavior and as much information + * as possible should be reported. Use this flag to enable this behavior. + */ + CXTranslationUnit_KeepGoing = 0x200 }; /** |