Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-105481: add pseudo-instructions to the cases DSL#105506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
iritkatriel merged 11 commits intopython:mainfromiritkatriel:pseudo
Jun 11, 2023
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
add a few comments
  • Loading branch information
@iritkatriel
iritkatriel committedJun 10, 2023
commit506eda52efaed3577b6ba2d007abde99ca192044
6 changes: 6 additions & 0 deletionsTools/cases_generator/generate_cases.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -818,6 +818,7 @@ def analyze_macro(self, macro: parser.Macro) -> MacroInstruction:
def analyze_pseudo(self, pseudo: parser.Pseudo) -> PseudoInstruction:
targets = [self.instrs[target] for target in pseudo.targets]
assert targets
# Make sure the targets have the same fmt
fmts = list(set([t.instr_fmt for t in targets]))
assert(len(fmts) == 1)
return PseudoInstruction(pseudo.name, fmts[0], targets)
Expand DownExpand Up@@ -960,8 +961,13 @@ def effect_str(effects: list[StackEffect]) -> str:
case parser.Pseudo():
instr = self.pseudos[thing.name]
popped = pushed = None
# Calculate stack effect, and check that it's the the same
# for all targets.
for target in self.pseudos[thing.name].targets:
target_instr = self.instrs.get(target)
# Currently target is always an instr. This could change
# in the future, e.g., if we have a pseudo targetting a
# macro instruction.
assert target_instr
target_popped = effect_str(target_instr.input_effects)
target_pushed = effect_str(target_instr.output_effects)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp