[PATCH] D78929: [AIX][XCOFF]emit extern linkage for the llvm intrinsic symbol

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 13:28:54 PDT 2020


DiggerLin marked 3 inline comments as done.
DiggerLin added inline comments.


================
Comment at: llvm/include/llvm/MC/MCContext.h:105
+    /// linkage.
+    std::vector<MCSymbol *> XCOFFIntrinsicSymbols;
+    using XCOFFIntrinsicSym_iterator = std::vector<MCSymbol *>::iterator;
----------------
jasonliu wrote:
> Just a general comment on the data structure that's using here.
> Have we thought about using using a SmallPtrSet so that you don't need to worry about inserting the duplicated value into the vector?
/// SmallPtrSet - This class implements a set which is optimized for holding
 /// SmallSize or less elements.  This internally rounds up SmallSize to the next
 /// power of two if it is not already a power of two.  See the comments above
 /// SmallPtrSetImplBase for details of the algorithm.
 template<class PtrType, unsigned SmallSize>
 class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
   // In small mode SmallPtrSet uses linear search for the elements, so it is
   // not a good idea to choose this value too high. You may consider using a
   // DenseSet<> instead if you expect many elements in the set.
   static_assert(SmallSize <= 32, "SmallSize should be small");

There are hundreds llvm intrinsic function. I will use std::set   


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78929





More information about the llvm-commits mailing list