[PATCH] D20260: [wip] IR: Introduce local_unnamed_addr attribute.
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Mon May 16 09:25:35 PDT 2016
majnemer added a subscriber: majnemer.
================
Comment at: include/llvm/IR/GlobalValue.h:162-164
@@ +161,5 @@
+
+ bool hasUnnamedAddr() const {
+ return UnnamedAddr == GlobalValue::GlobalUnnamedAddr;
+ }
+
----------------
I think it'd be more clear what this does if it were renamed `hasGlobalUnnamedAddr`. It's current name implies that `UnnamedAddr != NotUnnamedAddr` instead of `UnnamedAddr == GlobalUnnamedAddr`.
================
Comment at: include/llvm/IR/GlobalValue.h:171-173
@@ +170,5 @@
+ /// have uses outside the module; use hasUnnamedAddr() instead.
+ bool hasLocalUnnamedAddr() const {
+ return UnnamedAddr != GlobalValue::NotUnnamedAddr;
+ }
+
----------------
I'd expect this to be `UnnamedAddr == LocalUnnamedAddr`. I'd either choose a better name for this function or change the callers to check for both `UnnamedAddrType` values.
http://reviews.llvm.org/D20260
More information about the llvm-commits
mailing list