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());
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());
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits