diff --git a/source/opt/type_manager.cpp b/source/opt/type_manager.cpp index ed8a13c7..8a125278 100644 --- a/source/opt/type_manager.cpp +++ b/source/opt/type_manager.cpp @@ -204,7 +204,7 @@ void TypeManager::AttachIfTypeDecoration(const ir::Instruction& inst) { data.push_back(inst.GetSingleWordOperand(i)); } if (Struct* st = target_type->AsStruct()) { - st->AddMemeberDecoration(index, std::move(data)); + st->AddMemberDecoration(index, std::move(data)); } else { SPIRV_UNIMPLEMENTED(consumer_, "OpMemberDecorate non-struct type"); } diff --git a/source/opt/types.cpp b/source/opt/types.cpp index 285c1488..1d8cad24 100644 --- a/source/opt/types.cpp +++ b/source/opt/types.cpp @@ -220,8 +220,8 @@ Struct::Struct(const std::vector& types) : element_types_(types) { } } -void Struct::AddMemeberDecoration(uint32_t index, - std::vector&& decoration) { +void Struct::AddMemberDecoration(uint32_t index, + std::vector&& decoration) { if (index >= element_types_.size()) { assert(0 && "index out of bound"); return; diff --git a/source/opt/types.h b/source/opt/types.h index a46e4114..fb106154 100644 --- a/source/opt/types.h +++ b/source/opt/types.h @@ -262,7 +262,9 @@ class Struct : public Type { Struct(const std::vector& element_types); Struct(const Struct&) = default; - void AddMemeberDecoration(uint32_t index, std::vector&& decoration); + // Adds a decoration to the member at the given index. The first word is the + // decoration enum, and the remaining words, if any, are its operands. + void AddMemberDecoration(uint32_t index, std::vector&& decoration); bool IsSame(Type* that) const override; std::string str() const override;