This is an archive of the discontinued LLVM Phabricator instance.

[llvm][NFC][CallSite] Remove CallSite from Evaluator.
ClosedPublic

Authored by mtrofin on Apr 17 2020, 12:33 PM.

Diff Detail

Event Timeline

mtrofin created this revision.Apr 17 2020, 12:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2020, 12:33 PM
dblaikie accepted this revision.Apr 17 2020, 1:02 PM
dblaikie added inline comments.
llvm/lib/Transforms/Utils/Evaluator.cpp
266–269

Looks like this could pass by reference, rather than pointer (since it unconditionally dereferences in the implementation)

281–282

This one's less clear - up to you if you want to look closer to figure out if it could be reference. (the only issue is whether callers actually need to pass null CB when they pass null F - if they still pass non-null CB when F is null, then CB might as well be a reference)

571

No need for the cast here, since CB is already a CallBase?

This revision is now accepted and ready to land.Apr 17 2020, 1:02 PM
mtrofin updated this revision to Diff 258425.Apr 17 2020, 2:22 PM
mtrofin marked 3 inline comments as done.
  • -> &
mtrofin updated this revision to Diff 258445.Apr 17 2020, 4:31 PM

Missed a comment. Fixed.

mtrofin marked an inline comment as done.Apr 17 2020, 4:31 PM
mtrofin added inline comments.
llvm/lib/Transforms/Utils/Evaluator.cpp
281–282

Both members are only used internally, we could make them private.

craig.topper added inline comments.Apr 17 2020, 4:52 PM
llvm/include/llvm/Transforms/Utils/Evaluator.h
90

Can we change these to SmallVectorImpl<Constant *>& while we're already touching these lines? No point in forcing a specific size on the caller or repeating it.

mtrofin updated this revision to Diff 258460.Apr 17 2020, 5:56 PM
mtrofin marked an inline comment as done.

SmallVector -> SmallVectorImpl

This revision was automatically updated to reflect the committed changes.