[PATCH] D51633: [ASTImporter] Added error handling for AST import.

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 4 09:28:00 PDT 2018


martong added a comment.

This patch is huge, but we change here almost all implementation functions of `ASTNodeImporter` to return with either `Error` or with `Expected<T>`.
We could not really come up with a cohesive but smaller patch because of the recursive nature of the importer. (We are open to ideas about how to cut this patch into smaller parts.)
Most of the changes are trivial: we always have to check the return value of any import function and pass on the error to the caller if there was any.
In my opinion one great simplification is the introduction of the auxiliary `importSeq` function. It imports each entity one-by-one after each other and in case of any error it returns with that error and does not continue with the subsequent import operations.


Repository:
  rC Clang

https://reviews.llvm.org/D51633





More information about the cfe-commits mailing list