[PATCH] D61140: Copy Argument Passing Restrictions setting when importing a CXXRecordDecl definition
Shafik Yaghmour via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 25 16:41:34 PDT 2019
shafik updated this revision to Diff 196757.
shafik added a comment.
Added test
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61140/new/
https://reviews.llvm.org/D61140
Files:
lib/AST/ASTImporter.cpp
test/Import/cxx-record-flags/Inputs/F.cpp
test/Import/cxx-record-flags/test.cpp
Index: test/Import/cxx-record-flags/test.cpp
===================================================================
--- /dev/null
+++ test/Import/cxx-record-flags/test.cpp
@@ -0,0 +1,14 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
+
+// CHECK: FTrivial
+// CHECK: DefinitionData
+// CHECK-SAME: pass_in_registers
+
+// CHECK: FNonTrivial
+// CHECK-NOT: pass_in_registers
+// CHECK: DefaultConstructor
+
+void expr() {
+ FTrivial f1;
+ FNonTrivial f2;
+}
Index: test/Import/cxx-record-flags/Inputs/F.cpp
===================================================================
--- /dev/null
+++ test/Import/cxx-record-flags/Inputs/F.cpp
@@ -0,0 +1,9 @@
+class FTrivial {
+ int i;
+};
+
+struct FNonTrivial {
+ virtual ~FNonTrivial() = default;
+ int i;
+};
+
Index: lib/AST/ASTImporter.cpp
===================================================================
--- lib/AST/ASTImporter.cpp
+++ lib/AST/ASTImporter.cpp
@@ -1767,6 +1767,9 @@
ToData.HasDeclaredCopyAssignmentWithConstParam
= FromData.HasDeclaredCopyAssignmentWithConstParam;
+ // Copy over the data stored in RecordDeclBits
+ ToCXX->setArgPassingRestrictions(FromCXX->getArgPassingRestrictions());
+
SmallVector<CXXBaseSpecifier *, 4> Bases;
for (const auto &Base1 : FromCXX->bases()) {
ExpectedType TyOrErr = import(Base1.getType());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61140.196757.patch
Type: text/x-patch
Size: 1377 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190425/a47d57b5/attachment-0001.bin>
More information about the cfe-commits
mailing list