This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Cleanup: BasicBlock::getInstList() is now private.
ClosedPublic

Authored by vporpo on Dec 12 2022, 6:55 PM.

Details

Summary

We now have an adequate set of API functions that we shouldn't need access
to the underlying instruction list.

Diff Detail

Event Timeline

vporpo created this revision.Dec 12 2022, 6:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2022, 6:55 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
vporpo requested review of this revision.Dec 12 2022, 6:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2022, 6:55 PM
aeubanks added inline comments.Dec 13 2022, 9:33 AM
llvm/include/llvm/IR/BasicBlock.h
92

instruction

386–387

this should also be private, although I'd hope people don't abuse this

looks like it's used as part of ilist_node_with_parent, maybe friend class that?

vporpo marked an inline comment as done.Dec 13 2022, 11:22 AM
vporpo added inline comments.
llvm/include/llvm/IR/BasicBlock.h
386–387

Yeah good point. I made this private too.

vporpo updated this revision to Diff 482570.Dec 13 2022, 11:22 AM

Addressed comments.

presubmit bot is saying there's a missed usage in BPFAbstractMemberAccess.cpp:1147

for changes like this, keep an eye on the presubmit bots ("x64 debian failed")

Oops good catch, thanks! I should have tested with all targets enabled.

vporpo updated this revision to Diff 482667.Dec 13 2022, 5:09 PM

Rebased.

vporpo updated this revision to Diff 482707.Dec 13 2022, 8:57 PM

Rebased.

vporpo updated this revision to Diff 482720.Dec 13 2022, 10:43 PM

The build bots were complaining about a formatting issue in nearby code, so I clang-formatted that too.

aeubanks accepted this revision.Dec 14 2022, 9:15 AM

yay finally

This revision is now accepted and ready to land.Dec 14 2022, 9:15 AM
This revision was landed with ongoing or failed builds.Dec 14 2022, 10:20 AM
This revision was automatically updated to reflect the committed changes.

This breaks llvm/example:

/Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/examples/ModuleMaker/ModuleMaker.cpp:58:7: error: 'getInstList' is a private member of 'llvm::BasicBlock'

See: https://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/33265/console

Thanks for reporting this. I will push a fix soon.

grepping for getInstList shows that BrainF.cpp also uses it
should also update ProgrammersManual.rst

Both examples should now be fixed. Updated the doc too. Thanks for your help @aeubanks .