Page MenuHomePhabricator

[ASTImporter] Changed use of Import to Import_New in ASTNodeImporter.
ClosedPublic

Authored by balazske on Oct 26 2018, 6:00 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

balazske created this revision.Oct 26 2018, 6:00 AM
balazske updated this revision to Diff 175675.Nov 28 2018, 6:06 AM

Rebase to master.

balazske updated this revision to Diff 175821.Nov 28 2018, 11:53 PM
  • Changed every use of ASTImporter::Import to Import_New
balazske updated this revision to Diff 175822.Nov 28 2018, 11:56 PM

Removing previous wrong update.

Ping. This patch is the next in the series of patches to finish the proper error handling (i.e. using Error and Expected<T>). Please see the "Stack" column above.

Herald added a project: Restricted Project. · View Herald Transcript

This patch is the next in the series of patches to finish the proper error handling (i.e. using Error and Expected<T>). Please see the "Stack" column above.

@balazske Or is it superseded by this one? https://reviews.llvm.org/D53818

balazske updated this revision to Diff 189824.Mar 8 2019, 1:17 AM

Rebase (old patch applied without changes).

This is the next part of the changes for error handling. D53818 was for ASTImporter functions only, this is for ASTNodeImporter (the Import_New functions are not used at many places directly because mostly the few import templates are used). The next part is D55049 which switches to Import_New in every other place (in clang source code only). Next part would be to use Import_New in lldb, then rename all Import_New to Import (and remove old Import).

martong added a subscriber: a_sidorin.

@shafik, @a_sidorin Ping. Could you please take a look?
Guys, this and its child patch are very important patches, because without it the error handling of ASTImporter is not completed. This means we may encounter a nullptr DeclContext in the middle of the import process, etc...

shafik added inline comments.Mar 22 2019, 9:56 AM
lib/AST/ASTImporter.cpp
3418 ↗(On Diff #189824)

Why is this section of code removed?

a_sidorin accepted this revision.Mar 24 2019, 9:53 AM

Hi Balasz,

Sorry, I missed the review accidentally. Thank you for the patch!

lib/AST/ASTImporter.cpp
3418 ↗(On Diff #189824)

I guess the reason is that this import is already done inside GetImportedOrCreateDecl().

This revision is now accepted and ready to land.Mar 24 2019, 9:53 AM
balazske marked an inline comment as done.Mar 25 2019, 12:29 AM
balazske added inline comments.
lib/AST/ASTImporter.cpp
3418 ↗(On Diff #189824)

You are right: This is done in InitializeImportedDecl that is called from GetImportedOrCreateDecl.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2019, 2:15 AM