From ff7c46a11787ca6ecebf0a224772a41efef33fc0 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sun, 5 Nov 2017 05:49:42 -0500 Subject: small cleanups --- source/slang/lower-to-ir.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/slang/lower-to-ir.cpp') diff --git a/source/slang/lower-to-ir.cpp b/source/slang/lower-to-ir.cpp index be91b9d3d..2672c5698 100644 --- a/source/slang/lower-to-ir.cpp +++ b/source/slang/lower-to-ir.cpp @@ -2311,8 +2311,11 @@ struct DeclLoweringVisitor : DeclVisitor ensureDecl(context, inheritanceDecl); } - // For now, we don't have an IR-level representation - // for the type itself. + // TODO: we currently store a Decl* in the witness table, which causes this function + // being invoked to translate the witness table entry into an IRValue. + // We should really allow a witness table entry to represent a type and not having to + // construct the type here. The current implementation will not work when the struct type + // is defined in a generic parent (we lose the environmental substitutions). return LoweredValInfo::simple(context->irBuilder->getTypeVal(DeclRefType::Create(context->getSession(), DeclRef(decl, nullptr)))); } -- cgit v1.2.3