Skip to content

Commit f288ab4

Browse files
committed
[nfc][cxx-interop] Add more info to request dumps and add a few pretty stack traces.
1 parent d5e88d9 commit f288ab4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5809,6 +5809,10 @@ static bool hasIteratorAPIAttr(const clang::Decl *decl) {
58095809
/// Recursively checks that there are no pointers in any fields or base classes.
58105810
/// Does not check C++ records with specific API annotations.
58115811
static bool hasPointerInSubobjects(const clang::CXXRecordDecl *decl) {
5812+
clang::PrettyStackTraceDecl trace(decl, clang::SourceLocation(),
5813+
decl->getASTContext().getSourceManager(),
5814+
"checking if pointer in subobjects");
5815+
58125816
// Probably a class template that has not yet been specialized:
58135817
if (!decl->getDefinition())
58145818
return false;
@@ -5868,6 +5872,10 @@ static bool copyAssignOperatorIsDefaulted(const clang::CXXRecordDecl *decl) {
58685872
/// destructors in any fields or base classes.
58695873
/// Does not check C++ records with specific API annotations.
58705874
static bool isSufficientlyTrivial(const clang::CXXRecordDecl *decl) {
5875+
clang::PrettyStackTraceDecl trace(decl, clang::SourceLocation(),
5876+
decl->getASTContext().getSourceManager(),
5877+
"checking if sufficently trivial");
5878+
58715879
// Probably a class template that has not yet been specialized:
58725880
if (!decl->getDefinition())
58735881
return true;
@@ -5912,6 +5920,10 @@ static bool isSufficientlyTrivial(const clang::CXXRecordDecl *decl) {
59125920
/// Checks if a record provides the required value type lifetime operations
59135921
/// (copy and destroy).
59145922
static bool hasRequiredValueTypeOperations(const clang::CXXRecordDecl *decl) {
5923+
clang::PrettyStackTraceDecl trace(decl, clang::SourceLocation(),
5924+
decl->getASTContext().getSourceManager(),
5925+
"checking if has required lifetime ops");
5926+
59155927
if (auto dtor = decl->getDestructor()) {
59165928
if (dtor->isDeleted() || dtor->getAccess() != clang::AS_public) {
59175929
return false;
@@ -6037,6 +6049,8 @@ void swift::simple_display(llvm::raw_ostream &out,
60376049
CxxRecordSemanticsDescriptor desc) {
60386050
out << "Matching API semantics of C++ record '"
60396051
<< desc.decl->getNameAsString() << "'.\n";
6052+
6053+
desc.decl->dump();
60406054
}
60416055

60426056
SourceLoc swift::extractNearestSourceLoc(CxxRecordSemanticsDescriptor desc) {
@@ -6051,6 +6065,8 @@ void swift::simple_display(llvm::raw_ostream &out,
60516065
else
60526066
out << "<invalid decl>";
60536067
out << "' is safe to use in context.\n";
6068+
6069+
desc.decl->dump();
60546070
}
60556071

60566072
SourceLoc swift::extractNearestSourceLoc(SafeUseOfCxxDeclDescriptor desc) {

0 commit comments

Comments
 (0)