Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhangNV committed Feb 12, 2025
1 parent 4c3692c commit 21c13f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
6 changes: 1 addition & 5 deletions source/slang/slang-diagnostic-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2551,11 +2551,7 @@ DIAGNOSTIC(
attemptToQuerySizeOfUnsizedArray,
"cannot obtain the size of an unsized array.")

DIAGNOSTIC(
56003,
Error,
useOfUninitializedResouceType,
"use of uninitialized resource type '$0'.")
DIAGNOSTIC(56003, Error, useOfUninitializedResourceType, "use of uninitialized resource type '$0'.")

// Metal
DIAGNOSTIC(
Expand Down
17 changes: 13 additions & 4 deletions source/slang/slang-ir-legalize-types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ LegalVal LegalVal::wrappedBuffer(LegalVal const& baseVal, LegalElementWrapping c

//

IRTypeLegalizationContext::IRTypeLegalizationContext(TargetProgram* target, IRModule* inModule, DiagnosticSink* sink)
IRTypeLegalizationContext::IRTypeLegalizationContext(
TargetProgram* target,
IRModule* inModule,
DiagnosticSink* sink)
{
targetProgram = target;

Expand Down Expand Up @@ -2052,11 +2055,14 @@ static LegalVal legalizeUndefined(IRTypeLegalizationContext* context, IRInst* in
{
if (auto structType = as<IRStructType>(inst->getFullType()))
{
for (auto field: structType->getFields())
for (auto field : structType->getFields())
{
if (isResourceType(field->getFieldType()))
{
context->m_sink->diagnose(field, Diagnostics::useOfUninitializedResouceType, field->getFieldType());
context->m_sink->diagnose(
field,
Diagnostics::useOfUninitializedResourceType,
field->getFieldType());
SLANG_ABORT_COMPILATION("use of uninitialized resource type");
}
}
Expand Down Expand Up @@ -4064,7 +4070,10 @@ struct IRResourceTypeLegalizationContext : IRTypeLegalizationContext
//
struct IRExistentialTypeLegalizationContext : IRTypeLegalizationContext
{
IRExistentialTypeLegalizationContext(TargetProgram* target, IRModule* module, DiagnosticSink* sink)
IRExistentialTypeLegalizationContext(
TargetProgram* target,
IRModule* module,
DiagnosticSink* sink)
: IRTypeLegalizationContext(target, module, sink)
{
}
Expand Down

0 comments on commit 21c13f4

Please sign in to comment.