[PATCH] D33162: IR: Give function GlobalValue::getRealLinkageName() a less misleading name: getPGOName().

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 13 14:30:38 PDT 2017


pcc added a comment.

> Most of the uses reads quite wrong since it has nothing to do with PGO.

Yes, that's the point :)

Use of a function named getPGOName() in code that has nothing to do with PGO stands out and makes it more obvious that there is a bug. Using a "better" name would increase the chance of the function being used incorrectly in other places.



================
Comment at: llvm/include/llvm/IR/GlobalValue.h:446
   /// usual symbol prefix before the symbol name is used then return linkage
   /// name after skipping this special LLVM prefix.
+  ///
----------------
mehdi_amini wrote:
> Is this still up to date? How does it play with the `getPGOName` name and the rest of the comment?
That part of the comment is still technically accurate, if a little misleading. I'll reword it.


https://reviews.llvm.org/D33162





More information about the llvm-commits mailing list