Skip to content

Commit

Permalink
Check for KVAnnotation instead of deferring to annotationKind().
Browse files Browse the repository at this point in the history
Signed-off-by: fruffy <[email protected]>
  • Loading branch information
fruffy committed Dec 5, 2024
1 parent 006177f commit 4ff9cd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ir/base.def
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@ class Annotation {
return expr[idx];
}
inline auto &getKV() {
BUG_CHECK(annotationKind() == Kind::StructuredKVList, "Annotation does not contain a key-value list.");
BUG_CHECK(std::holds_alternative<KVAnnotation>(body), "Annotation does not contain a key-value list.");
return std::get<KVAnnotation>(body);
}
inline const auto &getKV() const {
BUG_CHECK(annotationKind() == Kind::StructuredKVList, "Annotation does not contain a key-value list.");
BUG_CHECK(std::holds_alternative<KVAnnotation>(body), "Annotation does not contain a key-value list.");
return std::get<KVAnnotation>(body);
}

Expand Down

0 comments on commit 4ff9cd5

Please sign in to comment.