Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/IR/DataLayout.h
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | enum class FunctionPtrAlignType { | ||||
/// The function pointer alignment is independent of the function alignment. | /// The function pointer alignment is independent of the function alignment. | ||||
Independent, | Independent, | ||||
/// The function pointer alignment is a multiple of the function alignment. | /// The function pointer alignment is a multiple of the function alignment. | ||||
MultipleOfFunctionAlign, | MultipleOfFunctionAlign, | ||||
}; | }; | ||||
private: | private: | ||||
/// Defaults to false. | /// Defaults to false. | ||||
bool BigEndian; | bool BigEndian; | ||||
bool ConsidersElementAlignment; | |||||
unsigned AllocaAddrSpace; | unsigned AllocaAddrSpace; | ||||
MaybeAlign StackNaturalAlign; | MaybeAlign StackNaturalAlign; | ||||
unsigned ProgramAddrSpace; | unsigned ProgramAddrSpace; | ||||
unsigned DefaultGlobalsAddrSpace; | unsigned DefaultGlobalsAddrSpace; | ||||
MaybeAlign FunctionPtrAlign; | MaybeAlign FunctionPtrAlign; | ||||
FunctionPtrAlignType TheFunctionPtrAlignType; | FunctionPtrAlignType TheFunctionPtrAlignType; | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | public: | ||||
DataLayout(const DataLayout &DL) { *this = DL; } | DataLayout(const DataLayout &DL) { *this = DL; } | ||||
~DataLayout(); // Not virtual, do not subclass this class | ~DataLayout(); // Not virtual, do not subclass this class | ||||
DataLayout &operator=(const DataLayout &DL) { | DataLayout &operator=(const DataLayout &DL) { | ||||
clear(); | clear(); | ||||
StringRepresentation = DL.StringRepresentation; | StringRepresentation = DL.StringRepresentation; | ||||
BigEndian = DL.isBigEndian(); | BigEndian = DL.isBigEndian(); | ||||
ConsidersElementAlignment = DL.considersElementAlignment(); | |||||
AllocaAddrSpace = DL.AllocaAddrSpace; | AllocaAddrSpace = DL.AllocaAddrSpace; | ||||
StackNaturalAlign = DL.StackNaturalAlign; | StackNaturalAlign = DL.StackNaturalAlign; | ||||
FunctionPtrAlign = DL.FunctionPtrAlign; | FunctionPtrAlign = DL.FunctionPtrAlign; | ||||
TheFunctionPtrAlignType = DL.TheFunctionPtrAlignType; | TheFunctionPtrAlignType = DL.TheFunctionPtrAlignType; | ||||
ProgramAddrSpace = DL.ProgramAddrSpace; | ProgramAddrSpace = DL.ProgramAddrSpace; | ||||
DefaultGlobalsAddrSpace = DL.DefaultGlobalsAddrSpace; | DefaultGlobalsAddrSpace = DL.DefaultGlobalsAddrSpace; | ||||
ManglingMode = DL.ManglingMode; | ManglingMode = DL.ManglingMode; | ||||
LegalIntWidths = DL.LegalIntWidths; | LegalIntWidths = DL.LegalIntWidths; | ||||
Show All 14 Lines | public: | ||||
/// Parse a data layout string and return the layout. Return an error | /// Parse a data layout string and return the layout. Return an error | ||||
/// description on failure. | /// description on failure. | ||||
static Expected<DataLayout> parse(StringRef LayoutDescription); | static Expected<DataLayout> parse(StringRef LayoutDescription); | ||||
/// Layout endianness... | /// Layout endianness... | ||||
bool isLittleEndian() const { return !BigEndian; } | bool isLittleEndian() const { return !BigEndian; } | ||||
bool isBigEndian() const { return BigEndian; } | bool isBigEndian() const { return BigEndian; } | ||||
/// Returns true if the data layout considers vector element type alignment | |||||
/// when determining vector alignments. | |||||
bool considersElementAlignment() const { return ConsidersElementAlignment; } | |||||
/// Returns the string representation of the DataLayout. | /// Returns the string representation of the DataLayout. | ||||
/// | /// | ||||
/// This representation is in the same format accepted by the string | /// This representation is in the same format accepted by the string | ||||
/// constructor above. This should not be used to compare two DataLayout as | /// constructor above. This should not be used to compare two DataLayout as | ||||
/// different string can represent the same layout. | /// different string can represent the same layout. | ||||
const std::string &getStringRepresentation() const { | const std::string &getStringRepresentation() const { | ||||
return StringRepresentation; | return StringRepresentation; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 469 Lines • Show Last 20 Lines |