diff options
author | Balazs Keri <1.int32@gmail.com> | 2018-10-19 13:32:20 +0000 |
---|---|---|
committer | Balazs Keri <1.int32@gmail.com> | 2018-10-19 13:32:20 +0000 |
commit | 3b30d658dc5a9eb349e94b039c796993c87b8877 (patch) | |
tree | be486ae9f934f636dbec2540b1d7c52bfeef6268 /clang/lib/AST/ExternalASTMerger.cpp | |
parent | 8d0dd0ba0ecabb8e3f5322101ad87b608ab86fc9 (diff) | |
download | bcm5719-llvm-3b30d658dc5a9eb349e94b039c796993c87b8877.tar.gz bcm5719-llvm-3b30d658dc5a9eb349e94b039c796993c87b8877.zip |
[ASTImporter] Added error handling for AST import.
Summary:
The goal of this change is to make the ASTImporter::Import functions return
llvm::Expected instead of the imported type.
As first part the ASTNodeImporter visit functions are updated to return with
llvm::Expected. Various `import` functions are added to ASTNodeImporter to
simplify the code and have a common place for interface towards ASTImporter
(from ASTNodeImporter). There is some temporary code that is needed before
ASTImporter is updated.
Reviewers: a.sidorin, a_sidorin, xazax.hun
Reviewed By: a_sidorin
Subscribers: dkrupp, Szelethus, rnkovacs, martong, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D51633
llvm-svn: 344783
Diffstat (limited to 'clang/lib/AST/ExternalASTMerger.cpp')
-rw-r--r-- | clang/lib/AST/ExternalASTMerger.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/ExternalASTMerger.cpp b/clang/lib/AST/ExternalASTMerger.cpp index ae28c588ca3..e7ca3ac1459 100644 --- a/clang/lib/AST/ExternalASTMerger.cpp +++ b/clang/lib/AST/ExternalASTMerger.cpp @@ -230,7 +230,8 @@ void ExternalASTMerger::CompleteType(TagDecl *Tag) { if (!SourceTag->getDefinition()) return false; Forward.MapImported(SourceTag, Tag); - Forward.ImportDefinition(SourceTag); + if (llvm::Error Err = Forward.ImportDefinition_New(SourceTag)) + llvm::consumeError(std::move(Err)); Tag->setCompleteDefinition(SourceTag->isCompleteDefinition()); return true; }); @@ -249,7 +250,8 @@ void ExternalASTMerger::CompleteType(ObjCInterfaceDecl *Interface) { if (!SourceInterface->getDefinition()) return false; Forward.MapImported(SourceInterface, Interface); - Forward.ImportDefinition(SourceInterface); + if (llvm::Error Err = Forward.ImportDefinition_New(SourceInterface)) + llvm::consumeError(std::move(Err)); return true; }); } |