This is an archive of the discontinued LLVM Phabricator instance.

[MachineInstr] make getCalledFunction method of MachineInstr
Needs RevisionPublic

Authored by nickdesaulniers on Mar 20 2023, 4:02 PM.

Details

Reviewers
arsenm
Summary

This will be useful in other places in a follow up commit.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2023, 4:02 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
nickdesaulniers requested review of this revision.Mar 20 2023, 4:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2023, 4:02 PM
arsenm added a subscriber: arsenm.Mar 20 2023, 4:05 PM

It's a sketchy function to begin with, making a lot of assumptions about what a call looks like.

llvm/include/llvm/CodeGen/MachineInstr.h
876

This doesn't check it's a call

llvm/lib/CodeGen/MachineInstr.cpp
2383

Preserve the braces

2385

This also misses aliases, maybe it should just return the GlobalValue?

arsenm requested changes to this revision.Jun 9 2023, 6:39 PM
This revision now requires changes to proceed.Jun 9 2023, 6:39 PM