Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CFIFixup] Factor logic into helpers and use range-based loops (NFC) #125137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dhoekwater
Copy link
Contributor

runOnMachineFunction is getting long (>100 lines), and the logic
for computing block info and performing block fixup can be abstracted
away.

Reduce nesting in the main block fixup loop and name conditions to
reflect their purpose.

Replace manual usage of iterators with a range-based for loop.

Source:

`runOnMachineFunction` is getting long (>100 lines), and the logic
for computing block info and performing block fixup can be abstracted
away.

Reduce nesting in the main block fixup loop and name conditions to
reflect their purpose.

Replace manual usage of iterators with a range-based for loop.

Source:
- https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
- https://llvm.org/docs/CodingStandards.html#use-range-based-for-loops-wherever-possible
- https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop
Copy link
Contributor

@kazutakahirata kazutakahirata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants