Page MenuHomePhabricator

[ASTImporter] Support importing CXXUnresolvedConstructExpr and UnresolvedLookupExpr
ClosedPublic

Authored by a.sidorin on Oct 9 2017, 10:26 AM.

Diff Detail

Repository
rC Clang

Event Timeline

xazax.hun added inline comments.Oct 19 2017, 2:42 AM
lib/AST/ASTImporter.cpp
5899

Use uppercase variable names.

5900

I would eliminate this local variable.

dkrupp added a reviewer: bruno.Nov 3 2017, 8:52 AM
a.sidorin edited edge metadata.Nov 13 2017, 9:35 AM

Hi Peter,

Thank you for the patch. You can find some comments inline.

lib/AST/ASTImporter.cpp
5899

We have implemented ImportContainerChecked helper to avoid such routine code. You can use it.

5907

No need to allocate and copy - CXXUnresolvedConstructExpr::Create allocates the required amount of memory itself.

5933

ImportContainerChecked

5943

Needs to become a common function.

unittests/AST/ASTImporterTest.cpp
676

Code samples need alignment.

szepet updated this revision to Diff 124115.Nov 23 2017, 3:00 PM
szepet marked 7 inline comments as done.

Updates based on review comments.

Hello Aleksei,

Thank you for the review! (and sorry for the late update)

lib/AST/ASTImporter.cpp
5933

Since the operator* is const on UnresolvedSetIterator so returns NameDecl* not NamedDecl*& the ImportContainerChecked can not be use here as I understand (since the left side of the = operator is not an LVal in this case). So we can add elements via the addDecl function call.

szepet updated this revision to Diff 124123.Nov 23 2017, 4:35 PM

Updating the usage of ImportTemplateArgumentListInfo.

xazax.hun added inline comments.Dec 4 2017, 6:16 AM
lib/AST/ASTImporter.cpp
5914

Is this condition correct?

a.sidorin added inline comments.Dec 4 2017, 7:49 AM
lib/AST/ASTImporter.cpp
5914

Looks like it should be E->getName() && !Name.

a.sidorin commandeered this revision.Dec 17 2017, 7:13 AM
a.sidorin edited reviewers, added: szepet; removed: a.sidorin.
a.sidorin updated this revision to Diff 127283.Dec 17 2017, 7:16 AM

Fixed sanity check.

xazax.hun accepted this revision.Jan 9 2018, 6:23 AM
This revision is now accepted and ready to land.Jan 9 2018, 6:23 AM
This revision was automatically updated to reflect the committed changes.