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
- Repository
- rC Clang
Event Timeline
Hi Peter,
Thank you for the patch. You can find some comments inline.
lib/AST/ASTImporter.cpp | ||
---|---|---|
5897 | We have implemented ImportContainerChecked helper to avoid such routine code. You can use it. | |
5905 | No need to allocate and copy - CXXUnresolvedConstructExpr::Create allocates the required amount of memory itself. | |
5931 | ImportContainerChecked | |
5941 | Needs to become a common function. | |
unittests/AST/ASTImporterTest.cpp | ||
554 | Code samples need alignment. |
Hello Aleksei,
Thank you for the review! (and sorry for the late update)
lib/AST/ASTImporter.cpp | ||
---|---|---|
5931 | 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 | ||
---|---|---|
5912 | Is this condition correct? |
lib/AST/ASTImporter.cpp | ||
---|---|---|
5912 | Looks like it should be E->getName() && !Name. |
Use uppercase variable names.