From 41311209af4963f44acf34942d42828590d4b156 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Sun, 21 Jan 2018 18:05:39 -0800 Subject: Fix legalization of generic types (#377) Previously, all legalizations of a generic type would use the name of the original decl for the "ordinary" part of things, and this would lead to collisions because the names didn't include the mangled generic arguments. This is now fixed by storing the mangled name of the original inside of `struct` declarations created for legalization, and using those names instead. Also adds support for `getElementPtr` instructions when doing IR type legalization. Also tries to make a `DeclRefType` convert to a string using the underlying `DeclRef`. This doesn't help because `DeclRef::toString` doesn't actually include generic arguments either. --- source/slang/syntax.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/slang/syntax.cpp') diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp index 3bccf51ce..0428246db 100644 --- a/source/slang/syntax.cpp +++ b/source/slang/syntax.cpp @@ -433,7 +433,7 @@ void Type::accept(IValVisitor* visitor, void* extra) String DeclRefType::ToString() { - return getText(declRef.GetName()); + return declRef.toString(); } int DeclRefType::GetHashCode() -- cgit v1.2.3