From 3e3e2473bf85365593629bd1f6f070d11f0b8ab2 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 13 Oct 2017 22:39:15 -0700 Subject: Get rid of the `-slang-ir-asm` target (#212) * Get rid of the `-slang-ir-asm` target This is really only useful for debugging, so I've replaced the functionality with a `-dump-ir` command line option (which dump's the IR for an entry point before doing codegen). * fixup: use HLSL target, not DXBC, so test can run on Linux --- source/slang/emit.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/slang/emit.cpp') diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 7d7553bc5..8dcbcdbf4 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -1224,6 +1224,12 @@ struct EmitVisitor emitTypeImpl(arrayType->baseType, &arrayDeclarator); } + void visitGroupSharedType(GroupSharedType* type, TypeEmitArg const& arg) + { + Emit("groupshared "); + emitTypeImpl(type->valueType, arg.declarator); + } + void EmitType( RefPtr type, SourceLoc const& typeLoc, @@ -4492,6 +4498,9 @@ emitDeclImpl(decl, nullptr); if(!type) return; + if (type->Equals(getSession()->getVoidType())) + return; + emitIRType(context, type, getIRName(inst)); emit(" = "); } @@ -6266,7 +6275,10 @@ String emitEntryPoint( auto lowered = lowerEntryPointToIR(entryPoint, programLayout, target); // debugging: -// dumpIR(lowered); + if (translationUnit->compileRequest->shouldDumpIR) + { + dumpIR(lowered); + } // TODO: depending on the target we are trying to generate code for, // we may need to apply certain transformations, and we may also -- cgit v1.2.3