This is an archive of the discontinued LLVM Phabricator instance.

[TI removal] Update the C API for the move away from `TerminatorInst`.
ClosedPublic

Authored by chandlerc on Oct 7 2018, 2:05 AM.

Details

Summary

This updates the C API for the removal of TerminatorInst. It converts
the type query to a predicate query and moves the generic methods to
work on Instruction instances that satisfy this predicate rather than
requiring a specific type. It also clarifies that the C API wrapping
BasicBlock::getTerminator just returns an Instruction. Because this
was always wrapped opaquely as a value and the functions consuming these
values will work on Instruction objects, this shouldn't break any
clients.

This is a completely compatible change to the C API.

Diff Detail

Event Timeline

chandlerc created this revision.Oct 7 2018, 2:05 AM

Sending this for pre-commit review as I want to be sure I'm doing the right thing w/ the C-API here.

Ping? Would be really nice to get a review here.

Ping again! Also rebase...

chandlerc updated this revision to Diff 170057.Oct 18 2018, 2:39 AM

Ping, rebase, and update to remove all but the type system bits to match the
progress outside of the C API.

jyknight added inline comments.
llvm/include/llvm-c/Core.h
2958

I would actually make this function "LLVMIsATerminatorInst", *replacing* the LLVMIsATermiantorInst function defined using "macro" at the top. (A similar thing was done with e.g. LLVMIsAMDNode). With that, I think this change will be 100% compatible in the C API.

3102–3103

(LLVMIsATerminator)

chandlerc updated this revision to Diff 170128.Oct 18 2018, 3:46 PM
chandlerc edited the summary of this revision. (Show Details)
chandlerc edited reviewers, added: jyknight; removed: echristo, deadalnix.
chandlerc removed a subscriber: jyknight.

Update based on Jame's suggestion.

chandlerc updated this revision to Diff 170129.Oct 18 2018, 3:46 PM

Fix one more place.

chandlerc marked 2 inline comments as done.Oct 18 2018, 3:47 PM

Done.

Harbormaster completed remote builds in B23917: Diff 170129.
jyknight accepted this revision.Oct 18 2018, 3:53 PM
This revision is now accepted and ready to land.Oct 18 2018, 3:53 PM

LGTM.

llvm/include/llvm-c/Core.h
3103

Typo: "eturns"

This revision was automatically updated to reflect the committed changes.
chandlerc marked an inline comment as done.