Skip to content

Commit 20ffe0b

Browse files
committed
[do not merge] add some debug prints for linux bot failures.
1 parent f288ab4 commit 20ffe0b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5850,6 +5850,8 @@ static bool hasPointerInSubobjects(const clang::CXXRecordDecl *decl) {
58505850
}
58515851

58525852
static bool copyConstructorIsDefaulted(const clang::CXXRecordDecl *decl) {
5853+
llvm::dbgs() << "copy ctor is default\n";
5854+
58535855
auto ctor = llvm::find_if(decl->ctors(), [](clang::CXXConstructorDecl *ctor) {
58545856
return ctor->isCopyConstructor();
58555857
});
@@ -5859,9 +5861,12 @@ static bool copyConstructorIsDefaulted(const clang::CXXRecordDecl *decl) {
58595861
}
58605862

58615863
static bool copyAssignOperatorIsDefaulted(const clang::CXXRecordDecl *decl) {
5864+
llvm::dbgs() << "copy assign is default\n";
5865+
58625866
auto copyAssignOp = llvm::find_if(decl->decls(), [](clang::Decl *member) {
58635867
if (auto method = dyn_cast<clang::CXXMethodDecl>(member))
58645868
return method->isCopyAssignmentOperator();
5869+
return false;
58655870
});
58665871

58675872
assert(copyAssignOp != decl->decls_end());
@@ -5880,6 +5885,8 @@ static bool isSufficientlyTrivial(const clang::CXXRecordDecl *decl) {
58805885
if (!decl->getDefinition())
58815886
return true;
58825887

5888+
llvm::dbgs() << "has dtor = " << (decl->getDestructor() == nullptr ? "NO" : "YES") << "\n";
5889+
58835890
if ((decl->hasUserDeclaredCopyConstructor() &&
58845891
!copyConstructorIsDefaulted(decl)) ||
58855892
(decl->hasUserDeclaredCopyAssignment() &&
@@ -5888,10 +5895,17 @@ static bool isSufficientlyTrivial(const clang::CXXRecordDecl *decl) {
58885895
!decl->getDestructor()->isDefaulted()))
58895896
return false;
58905897

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+
58925903
if (auto recordType = dyn_cast<clang::RecordType>(t.getCanonicalType())) {
58935904
if (auto cxxRecord =
58945905
dyn_cast<clang::CXXRecordDecl>(recordType->getDecl())) {
5906+
clang::PrettyStackTraceDecl trace(cxxRecord, clang::SourceLocation(),
5907+
cxxRecord->getASTContext().getSourceManager(),
5908+
"checking subtype recrod if sufficently trivial");
58955909
if (hasImportAsRefAttr(cxxRecord) || hasOwnedValueAttr(cxxRecord) ||
58965910
hasUnsafeAPIAttr(cxxRecord))
58975911
return true;

0 commit comments

Comments
 (0)