summaryrefslogtreecommitdiffstats
path: root/source/slang/emit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/emit.cpp')
-rw-r--r--source/slang/emit.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp
index 1f0436d8a..6440c63a3 100644
--- a/source/slang/emit.cpp
+++ b/source/slang/emit.cpp
@@ -3827,6 +3827,11 @@ emitDeclImpl(decl, nullptr);
String getName(IRInst* inst)
{
+ if(auto decoration = inst->findDecoration<IRHighLevelDeclDecoration>())
+ {
+ return getText(decoration->decl->getName());
+ }
+
StringBuilder sb;
sb << "_S";
sb << inst->id;
@@ -4038,6 +4043,17 @@ emitDeclImpl(decl, nullptr);
}
}
+ void emitIRSemantics(
+ EmitContext* context,
+ IRInst* inst)
+ {
+ auto decoration = inst->findDecoration<IRHighLevelDeclDecoration>();
+ if( decoration )
+ {
+ EmitSemantics(decoration->decl);
+ }
+ }
+
void emitIRFunc(
EmitContext* context,
IRFunc* func)
@@ -4061,6 +4077,9 @@ emitDeclImpl(decl, nullptr);
}
emit(")");
+
+ emitIRSemantics(context, func);
+
// TODO: encode declaration vs. definition
bool isDefinition = true;
if(isDefinition)
@@ -4097,6 +4116,9 @@ emitDeclImpl(decl, nullptr);
{
auto fieldType = ff->getFieldType();
emitIRType(context, fieldType, getName(ff));
+
+ emitIRSemantics(context, ff);
+
emit(";\n");
}
emit("};\n");
@@ -4250,7 +4272,7 @@ String emitEntryPoint(
//
// We'll try to detect the cases here:
//
-#if 1
+#if 0
if(!(translationUnit->compileFlags & SLANG_COMPILE_FLAG_NO_CHECKING ))
{
// This seems to be case (3), because the user is asking for full