This is an archive of the discontinued LLVM Phabricator instance.

[NFCI][IR] Introduce CallBase::Create() wrapper
ClosedPublic

Authored by lebedev.ri on Jul 6 2020, 12:06 PM.

Details

Summary

It is reasonably common to want to clone some call with different bundles.
Let's actually provide an interface to do that.

Diff Detail

Event Timeline

lebedev.ri created this revision.Jul 6 2020, 12:06 PM
llvm/include/llvm/IR/InstrTypes.h
1145

No call sites make use of this default value (nullptr). Is it the right value? I'm not sure if you can default it to CB, but if not, should it just be a required parameter with no default value?

lebedev.ri marked 2 inline comments as done.Jul 6 2020, 12:12 PM
lebedev.ri added inline comments.
llvm/include/llvm/IR/InstrTypes.h
1145

This is a direct wrapper over all the subclasses Create() function with the same signature.
They all follow this pattern. I'm not sure why we should deviate here.

nickdesaulniers accepted this revision.Jul 6 2020, 12:14 PM
nickdesaulniers added inline comments.
llvm/include/llvm/IR/InstrTypes.h
1145

Ah, I missed the use in the child patch.

This revision is now accepted and ready to land.Jul 6 2020, 12:14 PM
lebedev.ri marked 3 inline comments as done.Jul 6 2020, 12:24 PM
lebedev.ri added inline comments.
llvm/include/llvm/IR/InstrTypes.h
1145

Hm, that use wasn't supposed to be there.

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