diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-09-19 15:27:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-19 15:27:50 -0400 |
| commit | 653fe976af88fcf86162ca5bb1b46d4378864572 (patch) | |
| tree | 882307a3377e6a4587231721d681daa061a56c78 /source/slang/emit.cpp | |
| parent | a37b3539d94c434c5d74ab524eae2988e48e0756 (diff) | |
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.
Diffstat (limited to 'source/slang/emit.cpp')
| -rw-r--r-- | source/slang/emit.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 2d774d8d8..74678ef94 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -1015,7 +1015,7 @@ struct EmitVisitor } const IRConstant* irConst = (const IRConstant*)elementCountInst; - const IRIntegerValue elementCount = irConst->u.intVal; + const IRIntegerValue elementCount = irConst->value.intVal; if (elementCount <= 0) { SLANG_DIAGNOSE_UNEXPECTED(getSink(), SourceLoc(), "Vector size must be greater than 0"); @@ -2277,16 +2277,16 @@ struct EmitVisitor switch(inst->op) { case kIROp_IntLit: - emit(((IRConstant*) inst)->u.intVal); + emit(((IRConstant*) inst)->value.intVal); break; case kIROp_FloatLit: - Emit(((IRConstant*) inst)->u.floatVal); + Emit(((IRConstant*) inst)->value.floatVal); break; case kIROp_boolConst: { - bool val = ((IRConstant*)inst)->u.intVal != 0; + bool val = ((IRConstant*)inst)->value.intVal != 0; emit(val ? "true" : "false"); } break; @@ -3611,7 +3611,7 @@ struct EmitVisitor SLANG_RELEASE_ASSERT(irElementIndex->op == kIROp_IntLit); IRConstant* irConst = (IRConstant*)irElementIndex; - UInt elementIndex = (UInt)irConst->u.intVal; + UInt elementIndex = (UInt)irConst->value.intVal; SLANG_RELEASE_ASSERT(elementIndex < 4); char const* kComponents[] = { "x", "y", "z", "w" }; @@ -3767,7 +3767,7 @@ struct EmitVisitor SLANG_RELEASE_ASSERT(irElementIndex->op == kIROp_IntLit); IRConstant* irConst = (IRConstant*)irElementIndex; - UInt elementIndex = (UInt)irConst->u.intVal; + UInt elementIndex = (UInt)irConst->value.intVal; SLANG_RELEASE_ASSERT(elementIndex < 4); char const* kComponents[] = { "x", "y", "z", "w" }; @@ -3792,7 +3792,7 @@ struct EmitVisitor SLANG_RELEASE_ASSERT(irElementIndex->op == kIROp_IntLit); IRConstant* irConst = (IRConstant*)irElementIndex; - UInt elementIndex = (UInt)irConst->u.intVal; + UInt elementIndex = (UInt)irConst->value.intVal; SLANG_RELEASE_ASSERT(elementIndex < 4); char const* kComponents[] = { "x", "y", "z", "w" }; |
