Skip to content

Commit

Permalink
Raise analysis_error instead of ValueError
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasr8 committed Oct 21, 2024
1 parent 33343dd commit f9ecb16
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Tools/cases_generator/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,8 +1105,7 @@ def get_instruction_size_for_uop(instructions: dict[str, Instruction], uop: Uop)
f"must have the same size: {size} != {inst.size}"
)
if size is None:
msg = f"No instruction containing the uop '{uop.name}' was found"
raise ValueError(msg)
raise analysis_error(f"No instruction containing the uop '{uop.name}' was found")
return size


Expand Down
3 changes: 2 additions & 1 deletion Tools/cases_generator/generators_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ def instruction_size(self,
inst: Instruction | None,
) -> bool:
"""Replace the INSTRUCTION_SIZE macro with the size of the current instruction."""
assert uop.instruction_size is not None, "INSTRUCTION_SIZE macro requires uop.instruction_size to be set"
if uop.instruction_size is None:
raise analysis_error("INSTRUCTION_SIZE macro requires uop.instruction_size to be set", tkn)
self.out.emit(f" {uop.instruction_size} ")
return True

Expand Down

0 comments on commit f9ecb16

Please sign in to comment.