[PATCH] D32009: Allow attributes with global variables

Tobias Edler von Koch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 10:32:05 PDT 2017


tobiasvk added a comment.

This is very useful, thanks for working on it!

I believe there are some passes that may not currently call GV::copyAttributesFrom when they probably should be (GlobalOpt has some cases IIRC), but that can be looked into when you actually implement the proposed section attributes.



================
Comment at: include/llvm/IR/GlobalVariable.h:208
+  void setAttributes(AttributeListType A) { Attrs = A; }
+
   // Methods for support type inquiry through isa, cast, and dyn_cast:
----------------
hasAttribute() functions would be useful here (I see you already have them in SingleSlotAttributeList).


https://reviews.llvm.org/D32009





More information about the llvm-commits mailing list