Skip to content

Commit 2433646

Browse files
committed
Add debug output for vtable layout
1 parent be8674e commit 2433646

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17+
#define DEBUG_TYPE "type-metadata-layout"
18+
1719
#include "swift/ABI/MetadataValues.h"
1820
#include "swift/ABI/TypeIdentity.h"
1921
#include "swift/AST/ASTContext.h"
@@ -1520,6 +1522,15 @@ namespace {
15201522
void addVTable() {
15211523
if (VTableEntries.empty())
15221524
return;
1525+
1526+
LLVM_DEBUG(
1527+
llvm::dbgs() << "VTable entries for " << getType()->getName() << ":\n";
1528+
for (auto entry : VTableEntries) {
1529+
llvm::dbgs() << " ";
1530+
entry.print(llvm::dbgs());
1531+
llvm::dbgs() << '\n';
1532+
}
1533+
);
15231534

15241535
// Only emit a method lookup function if the class is resilient
15251536
// and has a non-empty vtable.

0 commit comments

Comments
 (0)