From 653fe976af88fcf86162ca5bb1b46d4378864572 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 19 Sep 2018 15:27:50 -0400 Subject: Support for IRStringLit (#645) * * Added support for strings in IR with IRStringLit - with storage of chars after it * Added kIRDecorationOp_Transitory - can be used for detecting instructions constructed on stack * Made IRConstant hashing work off type * Fix comment that is out of date about how an instruction is determines to hold a transitory string. --- source/slang/bytecode.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/slang/bytecode.cpp') diff --git a/source/slang/bytecode.cpp b/source/slang/bytecode.cpp index 63af9512a..b92476cb1 100644 --- a/source/slang/bytecode.cpp +++ b/source/slang/bytecode.cpp @@ -382,7 +382,7 @@ void generateBytecodeForInst( // TODO: probably want distinct encodings // for signed vs. unsigned here. - encodeUInt(context, UInt(ii->u.intVal)); + encodeUInt(context, UInt(ii->value.intVal)); // destination: encodeOperand(context, inst); @@ -397,7 +397,7 @@ void generateBytecodeForInst( static const UInt size = sizeof(IRFloatingPointValue); unsigned char buffer[size]; - memcpy(buffer, &cInst->u.floatVal, sizeof(buffer)); + memcpy(buffer, &cInst->value.floatVal, sizeof(buffer)); for(UInt ii = 0; ii < size; ++ii) { @@ -413,7 +413,7 @@ void generateBytecodeForInst( { auto ii = (IRConstant*) inst; encodeUInt(context, ii->op); - encodeUInt(context, ii->u.intVal ? 1 : 0); + encodeUInt(context, ii->value.intVal ? 1 : 0); // destination: encodeOperand(context, inst); @@ -962,7 +962,7 @@ BytecodeGenerationPtr generateBytecodeForModule( case kIROp_IntLit: { auto ptr = allocate(context); - *ptr = irConstant->u.intVal; + *ptr = irConstant->value.intVal; bcConstants[cc].ptr = ptr.bitCast(); } break; -- cgit v1.2.3