This patch adds support for importing two different kind of C++ AST Node.
Note: This solution is based on https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/AST/ASTImporter.cpp#L7605 .
Details
Diff Detail
Event Timeline
Hi Peter,
Thank you for the patch. You can find some comments inline.
| lib/AST/ASTImporter.cpp | ||
|---|---|---|
| 5862 | We have implemented ImportContainerChecked helper to avoid such routine code. You can use it. | |
| 5870 | No need to allocate and copy - CXXUnresolvedConstructExpr::Create allocates the required amount of memory itself. | |
| 5896 | ImportContainerChecked | |
| 5906 | Needs to become a common function. | |
| unittests/AST/ASTImporterTest.cpp | ||
| 575 | Code samples need alignment. | |
Hello Aleksei,
Thank you for the review! (and sorry for the late update)
| lib/AST/ASTImporter.cpp | ||
|---|---|---|
| 5896 | 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. | |
| lib/AST/ASTImporter.cpp | ||
|---|---|---|
| 5877 | Is this condition correct? | |
| lib/AST/ASTImporter.cpp | ||
|---|---|---|
| 5877 | Looks like it should be E->getName() && !Name. | |
Use uppercase variable names.