@@ -5850,6 +5850,8 @@ static bool hasPointerInSubobjects(const clang::CXXRecordDecl *decl) {
5850
5850
}
5851
5851
5852
5852
static bool copyConstructorIsDefaulted (const clang::CXXRecordDecl *decl) {
5853
+ llvm::dbgs () << " copy ctor is default\n " ;
5854
+
5853
5855
auto ctor = llvm::find_if (decl->ctors (), [](clang::CXXConstructorDecl *ctor) {
5854
5856
return ctor->isCopyConstructor ();
5855
5857
});
@@ -5859,9 +5861,12 @@ static bool copyConstructorIsDefaulted(const clang::CXXRecordDecl *decl) {
5859
5861
}
5860
5862
5861
5863
static bool copyAssignOperatorIsDefaulted (const clang::CXXRecordDecl *decl) {
5864
+ llvm::dbgs () << " copy assign is default\n " ;
5865
+
5862
5866
auto copyAssignOp = llvm::find_if (decl->decls (), [](clang::Decl *member) {
5863
5867
if (auto method = dyn_cast<clang::CXXMethodDecl>(member))
5864
5868
return method->isCopyAssignmentOperator ();
5869
+ return false ;
5865
5870
});
5866
5871
5867
5872
assert (copyAssignOp != decl->decls_end ());
@@ -5880,6 +5885,8 @@ static bool isSufficientlyTrivial(const clang::CXXRecordDecl *decl) {
5880
5885
if (!decl->getDefinition ())
5881
5886
return true ;
5882
5887
5888
+ llvm::dbgs () << " has dtor = " << (decl->getDestructor () == nullptr ? " NO" : " YES" ) << " \n " ;
5889
+
5883
5890
if ((decl->hasUserDeclaredCopyConstructor () &&
5884
5891
!copyConstructorIsDefaulted (decl)) ||
5885
5892
(decl->hasUserDeclaredCopyAssignment () &&
@@ -5888,10 +5895,17 @@ static bool isSufficientlyTrivial(const clang::CXXRecordDecl *decl) {
5888
5895
!decl->getDestructor ()->isDefaulted ()))
5889
5896
return false ;
5890
5897
5891
- auto checkType = [](clang::QualType t) {
5898
+ llvm::dbgs () << " checking subtypes...\n " ;
5899
+
5900
+ auto checkType = [decl](clang::QualType t) {
5901
+ PrettyStackTraceClangType trace (decl->getASTContext (), " checking subtype if sufficently trivial" , t.getTypePtr ());
5902
+
5892
5903
if (auto recordType = dyn_cast<clang::RecordType>(t.getCanonicalType ())) {
5893
5904
if (auto cxxRecord =
5894
5905
dyn_cast<clang::CXXRecordDecl>(recordType->getDecl ())) {
5906
+ clang::PrettyStackTraceDecl trace (cxxRecord, clang::SourceLocation (),
5907
+ cxxRecord->getASTContext ().getSourceManager (),
5908
+ " checking subtype recrod if sufficently trivial" );
5895
5909
if (hasImportAsRefAttr (cxxRecord) || hasOwnedValueAttr (cxxRecord) ||
5896
5910
hasUnsafeAPIAttr (cxxRecord))
5897
5911
return true ;
0 commit comments