diff options
Diffstat (limited to 'source/slang/lower-to-ir.cpp')
| -rw-r--r-- | source/slang/lower-to-ir.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/slang/lower-to-ir.cpp b/source/slang/lower-to-ir.cpp index cfd1c89a4..428044830 100644 --- a/source/slang/lower-to-ir.cpp +++ b/source/slang/lower-to-ir.cpp @@ -2004,17 +2004,12 @@ struct StmtLoweringVisitor : StmtVisitor<StmtLoweringVisitor> IRInst* inst, Stmt* stmt) { - for(auto attr : stmt->GetModifiersOfType<HLSLUncheckedAttribute>()) + if( stmt->FindModifier<UnrollAttribute>() ) { - // TODO: We should actually catch these attributes during - // semantic checking, so that they have a strongly-typed - // representation in the AST. - if(getText(attr->getName()) == "unroll") - { - auto decoration = getBuilder()->addDecoration<IRLoopControlDecoration>(inst); - decoration->mode = kIRLoopControl_Unroll; - } + auto decoration = getBuilder()->addDecoration<IRLoopControlDecoration>(inst); + decoration->mode = kIRLoopControl_Unroll; } + // TODO: handle other cases here } void visitForStmt(ForStmt* stmt) @@ -2794,6 +2789,11 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> return LoweredValInfo(); } + LoweredValInfo visitAttributeDecl(AttributeDecl* /*decl*/) + { + return LoweredValInfo(); + } + LoweredValInfo visitTypeDefDecl(TypeDefDecl * decl) { return LoweredValInfo::simple(context->irBuilder->getTypeVal(decl->type.type)); |
