Page MenuHomePhabricator

[Target] Move InferiorCall to Process
ClosedPublic

Authored by xiaobai on Sep 11 2019, 3:37 PM.

Details

Summary

InferiorCall is only ever used in Process, and it is not specific to
POSIX. By moving it to Process, we can remove all dependencies on plugins from
Process. Moving InferiorCall to Process seems to achieve this quite well.
Additionally, the name InferiorCall is a little vague now, so we rename
it something a bit more specific.

Diff Detail

Repository
rL LLVM

Event Timeline

xiaobai created this revision.Sep 11 2019, 3:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 11 2019, 3:37 PM

This seems like the right place to put it, it's clearly something you would do with a process.

I don't see any reason why this should be a private function. It's just a convenience wrapper around a bunch of other public functionality, and doesn't do anything that needs to be hidden from clients of Process. I wouldn't want somebody else to reinvent it if they needed to do the same thing.

However, InferiorCall is a pretty vague name for something that has a very specific task. Once it is part of Process, the "Inferior" bit is unnecessary, the Process IS the inferior... Maybe just CallVoidArgVoidPtrReturn? That's not too hideous.

JDevlieghere accepted this revision.Sep 11 2019, 4:20 PM

I was going to say LGTM unless Jim has concerns, but looks like he cut me to the chase :-)

This revision is now accepted and ready to land.Sep 11 2019, 4:20 PM
clayborg accepted this revision.Sep 12 2019, 2:24 PM

lgtm. Jim?

lgtm. Jim?

I already commented above.

jingham requested changes to this revision.Sep 12 2019, 2:46 PM
This revision now requires changes to proceed.Sep 12 2019, 2:46 PM
xiaobai updated this revision to Diff 220018.Sep 12 2019, 3:32 PM

Rename InferiorCall to CallNoArgNoReturnFunc
make CallNoArgReturnFunc public

xiaobai edited the summary of this revision. (Show Details)Sep 12 2019, 3:33 PM

I don't think CallNoArgNoReturnFunc is the right name. This routine calls a function that takes no arguments but returns a void *.

xiaobai updated this revision to Diff 220023.Sep 12 2019, 3:56 PM

Rename function in question to CallVoidArgVoidPtrReturn

jingham accepted this revision.Sep 12 2019, 4:10 PM

Excellent!

This revision is now accepted and ready to land.Sep 12 2019, 4:10 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2019, 5:01 PM