[PATCH] D56567: [ADT] Force attribute used on functions marked as always_inline.

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 10 16:04:33 PST 2019


dexonsmith added inline comments.


================
Comment at: llvm/include/llvm/ADT/SmallVector.h:128
   // forward iterator creation methods.
-  LLVM_ATTRIBUTE_ALWAYS_INLINE
+  LLVM_ATTRIBUTE_ALWAYS_INLINE LLVM_ATTRIBUTE_USED
   iterator begin() { return (iterator)this->BeginX; }
----------------
I don't think we want this for Release or RelWithDebInfo builds since it will bloat the binaries.  How is `LLVM_ATTRIBUTE_USED` conditionalized in those cases?


================
Comment at: llvm/include/llvm/ADT/StringRef.h:127
     LLVM_NODISCARD
-    LLVM_ATTRIBUTE_ALWAYS_INLINE
+    LLVM_ATTRIBUTE_ALWAYS_INLINE LLVM_ATTRIBUTE_USED
     const char *data() const { return Data; }
----------------
This already has `LLVM_NODISCARD`.  How does that differ from `LLVM_ATTRIBUTE_USED`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56567/new/

https://reviews.llvm.org/D56567





More information about the llvm-commits mailing list