This is an archive of the discontinued LLVM Phabricator instance.

Allow reverse iterators for `MachineBasicBlock::findDebugLoc` and `MachineBasicBlock::findPrevDebugLoc`
Needs RevisionPublic

Authored by m4yers on Dec 28 2018, 12:16 PM.

Details

Reviewers
dschuff
fhahn

Diff Detail

Event Timeline

m4yers created this revision.Dec 28 2018, 12:16 PM
m4yers retitled this revision from Allow reverse iterators for `MachineBasicBlock::findDebugLoc` and `DebugLoc MachineBasicBlock::findPrevDebugLoc` to Allow reverse iterators for `MachineBasicBlock::findDebugLoc` and `MachineBasicBlock::findPrevDebugLoc`.Dec 28 2018, 12:17 PM
fhahn added a comment.Jan 2 2019, 8:52 AM

Are there any instances in the current codebase where this would be useful?

lib/CodeGen/MachineBasicBlock.cpp
1293

nit: return on new line.

1318

Should this be std::next here?

m4yers marked 3 inline comments as done.Jan 6 2019, 12:45 PM

Are there any instances in the current codebase where this would be useful?

For example X86InstrInfo::AnalyzeBranchImpl can be rewritten with more natural reverse iterators.

lib/CodeGen/MachineBasicBlock.cpp
1318

ah, true, thanks!

m4yers updated this revision to Diff 180412.Jan 6 2019, 12:49 PM
m4yers marked an inline comment as done.

Change std::prev to std::next

m4yers updated this revision to Diff 180413.Jan 6 2019, 12:54 PM

Newline the returns

fhahn added a comment.Jan 11 2019, 8:39 AM

Are there any instances in the current codebase where this would be useful?

For example X86InstrInfo::AnalyzeBranchImpl can be rewritten with more natural reverse iterators.

Would it be possible to post that as a follow up patch?

Are there any instances in the current codebase where this would be useful?

For example X86InstrInfo::AnalyzeBranchImpl can be rewritten with more natural reverse iterators.

Would it be possible to post that as a follow up patch?

This is for a downstream backend target i'm writing, but yes, I can provide patches for X86 where using this interface is more suitable.

fhahn requested changes to this revision.Sep 6 2020, 7:52 AM

marking as changes requested to clear up review queue. I think it would be good to have at least 1 or 2 in-tree users so this gets at least some test coverage.

This revision now requires changes to proceed.Sep 6 2020, 7:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 6 2020, 7:52 AM