This is an archive of the discontinued LLVM Phabricator instance.

[CallSite removal] Add and flesh out APIs on the new `CallBase` base class that previously were only available on the `CallSite` wrapper.
ClosedPublic

Authored by chandlerc on Dec 12 2018, 7:13 PM.

Details

Summary

This will make migrating code easier and generally seems like a good collection
of API improvements.

Some of these APIs seem like more consistent / better naming of existing
ones. I've retained the old names for migration simplicit and am just
adding the new ones in this commit. I'll try to garbage collect these
once CallSite is gone.

Diff Detail

Repository
rL LLVM

Event Timeline

chandlerc created this revision.Dec 12 2018, 7:13 PM
compnerd accepted this revision.Dec 27 2018, 8:30 AM
compnerd added a subscriber: compnerd.

The only minor nit is the preference for Known in some of the operand checks. IIRC clang doesn't get 100% of the annotations, so even if something is not marked as noread, it may be noread. Yes, its nit-picky, but, I think it helps when dealing with code that you are unfamiliar with (or happen to page out the context from clang).

llvm/include/llvm/IR/InstrTypes.h
1388 ↗(On Diff #177993)

Can we name this isKnownNonCapture? The attributes aren't guaranteed to be emitted by the frontend.

1393 ↗(On Diff #177993)

Can we name this isKnownByValArgument?

1414 ↗(On Diff #177993)

Can we name this with Known in the name as well?

1418 ↗(On Diff #177993)

Similar

1423 ↗(On Diff #177993)

Similar

llvm/lib/IR/Instructions.cpp
269 ↗(On Diff #177993)

Unnecessary else.

This revision is now accepted and ready to land.Dec 27 2018, 8:30 AM

The only minor nit is the preference for Known in some of the operand checks. IIRC clang doesn't get 100% of the annotations, so even if something is not marked as noread, it may be noread. Yes, its nit-picky, but, I think it helps when dealing with code that you are unfamiliar with (or happen to page out the context from clang).

I totally agree w/ your suggestion, but I'd like to do this after CallSite is gone. My goal is to make the APIs interchangable first, and then we can do updates to them. Does that make sense? I'm happy to add a FIXME comment to this effect.

chandlerc updated this revision to Diff 179588.Dec 27 2018, 3:26 PM
chandlerc marked 6 inline comments as done.

Address review feedback.

Added FIXMEs for future renaming and corrected the other comment mentioned.

llvm/include/llvm/IR/InstrTypes.h
1393 ↗(On Diff #177993)

Here I don't think we should rename -- byval is a fundamental property of whether an attribute was placed there or not. If the attribute is missing, it will not get those semantics. So I think the wording of this is actually fine.

(confirmed w/ reviewer on IRC that he's fine w/ the FIXMEs, landing...)

This revision was automatically updated to reflect the committed changes.