[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 10 04:23:49 PDT 2024


================
@@ -152,6 +152,41 @@ def b(x: str | bytes) -> bytes:
 ### Exception Classes ###
 
 
+class CXError(Exception):
----------------
TsXor wrote:

I looked at C header and found that `clang_parseTranslationUnit` and `clang_createTranslationUnit` actually swallows error code. To be unified, we should use `clang_parseTranslationUnit2` and `clang_createTranslationUnit2` which outputs value with pointers and return error code.

https://github.com/llvm/llvm-project/pull/102410


More information about the cfe-commits mailing list