LLVM: lib/IR/DataLayout.cpp File Reference (original) (raw)

Go to the source code of this file.

Functions
static Error createSpecFormatError (Twine Format)
static Error parseAddrSpace (StringRef Str, unsigned &AddrSpace)
Attempts to parse an address space component of a specification.
static Error parseSize (StringRef Str, unsigned &BitWidth, StringRef Name="size")
Attempts to parse a size component of a specification.
static Error parseAlignment (StringRef Str, Align &Alignment, StringRef Name, bool AllowZero=false)
Attempts to parse an alignment component of a specification.
static APInt getElementIndex (TypeSize ElemSize, APInt &Offset)
Variables
constexpr DataLayout::PrimitiveSpec DefaultIntSpecs []
constexpr DataLayout::PrimitiveSpec DefaultFloatSpecs []
constexpr DataLayout::PrimitiveSpec DefaultVectorSpecs []
constexpr DataLayout::PointerSpec DefaultPointerSpecs []

createSpecFormatError()

static Error createSpecFormatError ( Twine Format) static

getElementIndex()

Definition at line 920 of file DataLayout.cpp.

References assert(), llvm::BitWidth, llvm::APInt::getZero(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::isUIntN(), and llvm::Offset.

Referenced by areTwoInsertFromSameBuildVector(), findBuildAggregate_rec(), llvm::DataLayout::getGEPIndexForOffset(), llvm::DataLayout::getGEPIndicesForOffset(), llvm::slpvectorizer::BoUpSLP::getReorderingData(), llvm::slpvectorizer::BoUpSLP::getTreeCost(), isFirstInsertElement(), and llvm::slpvectorizer::BoUpSLP::vectorizeTree().

parseAddrSpace()

parseAlignment()

Attempts to parse an alignment component of a specification.

On success, returns the value converted to byte amount in Alignment. If the value is zero and AllowZero is true, Alignment is set to one.

Return an error in a number of cases:

Definition at line 310 of file DataLayout.cpp.

References llvm::createStringError(), llvm::isPowerOf2_32(), Name, and llvm::Error::success().

parseSize()

DefaultFloatSpecs

Initial value:

= {

{16, Align::Constant<2>(), Align::Constant<2>()},

{32, Align::Constant<4>(), Align::Constant<4>()},

{64, Align::Constant<8>(), Align::Constant<8>()},

{128, Align::Constant<16>(), Align::Constant<16>()},

}

Definition at line 197 of file DataLayout.cpp.

DefaultIntSpecs

Initial value:

= {

{1, Align::Constant<1>(), Align::Constant<1>()},

{8, Align::Constant<1>(), Align::Constant<1>()},

{16, Align::Constant<2>(), Align::Constant<2>()},

{32, Align::Constant<4>(), Align::Constant<4>()},

{64, Align::Constant<4>(), Align::Constant<8>()},

}

Definition at line 190 of file DataLayout.cpp.

DefaultPointerSpecs

Initial value:

= {

{0, 64, Align::Constant<8>(), Align::Constant<8>(), 64, false},

}

Definition at line 209 of file DataLayout.cpp.

DefaultVectorSpecs

Initial value:

= {

{64, Align::Constant<8>(), Align::Constant<8>()},

{128, Align::Constant<16>(), Align::Constant<16>()},

}

Definition at line 203 of file DataLayout.cpp.