llvm.org GIT mirror llvm / 55adf17
[LLVM][NFC] Removing unused functions Summary: Removes a not so useful function from DataLayout and cleans up Support/MathExtras.h Reviewers: courbet Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66691 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369824 91177308-0d34-0410-b5e6-96231b3b80d8 Guillaume Chatelet 29 days ago
4 changed file(s) with 1 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
492492 ///
493493 /// This is always at least as good as the ABI alignment.
494494 unsigned getPrefTypeAlignment(Type *Ty) const;
495
496 /// Returns the preferred alignment for the specified type, returned as
497 /// log2 of the value (a shift amount).
498 unsigned getPreferredTypeAlignmentShift(Type *Ty) const;
499495
500496 /// Returns an integer type with size at least as big as that of a
501497 /// pointer in the given address space.
703703 return alignTo(Numerator, Denominator) / Denominator;
704704 }
705705
706 /// \c alignTo for contexts where a constant expression is required.
707 /// \sa alignTo
708 ///
709 /// \todo FIXME: remove when \c constexpr becomes really \c constexpr
710 template
711 struct AlignTo {
712 static_assert(Align != 0u, "Align must be non-zero");
713 template
714 struct from_value {
715 static const uint64_t value = (Value + Align - 1) / Align * Align;
716 };
717 };
718
719706 /// Returns the largest uint64_t less than or equal to \p Value and is
720707 /// \p Skew mod \p Align. \p Align must be non-zero
721708 inline uint64_t alignDown(uint64_t Value, uint64_t Align, uint64_t Skew = 0) {
762762 return getAlignment(Ty, false);
763763 }
764764
765 unsigned DataLayout::getPreferredTypeAlignmentShift(Type *Ty) const {
766 unsigned Align = getPrefTypeAlignment(Ty);
767 assert(!(Align & (Align-1)) && "Alignment is not a power of two!");
768 return Log2_32(Align);
769 }
770
771765 IntegerType *DataLayout::getIntPtrType(LLVMContext &C,
772766 unsigned AddressSpace) const {
773767 return IntegerType::get(C, getIndexSizeInBits(AddressSpace));
114114
115115 MCSymbol *GVSym = getSymbol(GV);
116116 const Constant *C = GV->getInitializer();
117 unsigned Align = (unsigned)DL.getPreferredTypeAlignmentShift(C->getType());
117 unsigned Align = Log2_32(DL.getPrefTypeAlignment(C->getType()));
118118
119119 // Mark the start of the global
120120 getTargetStreamer().emitCCTopData(GVSym->getName());