Skip to content

Commit dffcafb

Browse files
committed
IRGen: VarDecls always have an interface type and a contextual type
1 parent 41aebf8 commit dffcafb

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/IRGen/DebugTypeInfo.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ DebugTypeInfo DebugTypeInfo::getLocalVariable(DeclContext *DC,
6565
VarDecl *Decl, swift::Type Ty,
6666
const TypeInfo &Info) {
6767

68-
auto DeclType =
69-
Decl->hasInterfaceType() ? Decl->getInterfaceType() : Decl->getType();
68+
auto DeclType = Decl->getInterfaceType();
7069
auto RealType = Ty;
7170

7271
// DynamicSelfType is also sugar as far as debug info is concerned.
@@ -101,9 +100,7 @@ DebugTypeInfo DebugTypeInfo::getGlobal(SILGlobalVariable *GV,
101100
if (auto *Decl = GV->getDecl()) {
102101
DC = Decl->getDeclContext();
103102
GE = DC->getGenericEnvironmentOfContext();
104-
auto DeclType =
105-
(Decl->hasType() ? Decl->getType()
106-
: DC->mapTypeIntoContext(Decl->getInterfaceType()));
103+
auto DeclType = Decl->getType();
107104
if (DeclType->isEqual(LowTy))
108105
Type = DeclType.getPointer();
109106
}

lib/Sema/PCMacro.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ class Instrumenter : InstrumenterBase {
484484
Context.getIdentifier(NameBuf),
485485
TypeCheckDC);
486486
VD->setType(MaybeLoadInitExpr->getType());
487+
VD->setInterfaceType(MaybeLoadInitExpr->getType()->mapTypeOutOfContext());
487488
VD->setImplicit();
488489

489490
NamedPattern *NP = new (Context) NamedPattern(VD, /*implicit*/ true);

0 commit comments

Comments
 (0)