We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2f05f0 commit 5504a18Copy full SHA for 5504a18
lib/IRGen/IRGenDebugInfo.cpp
@@ -1408,11 +1408,15 @@ llvm::DIType *IRGenDebugInfo::createType(DebugTypeInfo DbgTy,
1408
auto *StructTy = BaseTy->castTo<StructType>();
1409
auto *Decl = StructTy->getDecl();
1410
auto L = getDebugLoc(SM, Decl);
1411
- return createStructType(DbgTy, Decl, StructTy, Scope,
1412
- getOrCreateFile(L.Filename), L.Line, SizeInBits,
1413
- AlignInBits, Flags,
1414
- nullptr, // DerivedFrom
1415
- llvm::dwarf::DW_LANG_Swift, MangledName);
+ auto *File = getOrCreateFile(L.Filename);
+ if (Opts.DebugInfoKind > IRGenDebugInfoKind::ASTTypes)
+ return createStructType(DbgTy, Decl, StructTy, Scope, File, L.Line,
+ SizeInBits, AlignInBits, Flags,
+ nullptr, // DerivedFrom
1416
+ llvm::dwarf::DW_LANG_Swift, MangledName);
1417
+ else
1418
+ return createOpaqueStruct(Scope, Decl->getName().str(), File, L.Line,
1419
+ SizeInBits, AlignInBits, Flags, MangledName);
1420
}
1421
1422
case TypeKind::Class: {
test/DebugInfo/bool.swift
@@ -1,4 +1,4 @@
1
-// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
+// RUN: %target-swift-frontend %s -emit-ir -gdwarf-types -o - | FileCheck %s
2
3
func markUsed<T>(_ t: T) {}
4
0 commit comments