This is an archive of the discontinued LLVM Phabricator instance.

[IR] Create new method in the Function class (NFC)
ClosedPublic

Authored by evandro on Mar 26 2019, 3:40 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

evandro created this revision.Mar 26 2019, 3:40 PM
evandro retitled this revision from [IR] Create new method in `Function` class (NFC) to [IR] Create new method in the Function class (NFC).Mar 27 2019, 2:33 PM
spatel added inline comments.Apr 2 2019, 1:32 PM
llvm/include/llvm/IR/Function.h
594

I understand that we're trying to mimic the existing 'optForSize' naming, but "optForNaught" is not obvious.
How about "isOptNone()"?

evandro marked an inline comment as done.Apr 2 2019, 2:20 PM
evandro added inline comments.
llvm/include/llvm/IR/Function.h
594

optForNone()? Though I don't feel strongly about it.

spatel added inline comments.Apr 2 2019, 3:01 PM
llvm/include/llvm/IR/Function.h
594

I'm still not reading that as obvious. When I see this in IR, I'm used to seeing the string "optnone", so it makes more sense to me that the query includes that string exactly. If others disagree, I won't block it though.

evandro marked an inline comment as done.Apr 3 2019, 11:54 AM
evandro added inline comments.
llvm/include/llvm/IR/Function.h
594

In an OCD way, I'm trying to preserve the existing pattern for such methods. 😌

spatel accepted this revision.Apr 3 2019, 1:16 PM

Ok, LGTM...it's just a convenience wrapper, so if anyone feels like the name can be improved, feel free. My vote would still be "isOptNone" or "hasOptNone". If that doesn't match the existing API, then I'd say fix that too: "hasOptSize".

This revision is now accepted and ready to land.Apr 3 2019, 1:16 PM

That's a good idea to follow up on, following the pattern of hasOptNone().

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2019, 2:25 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript