LLVM  10.0.0svn
Functions | Variables
DataLayout.cpp File Reference
#include "llvm/IR/DataLayout.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/TypeSize.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <tuple>
#include <utility>
Include dependency graph for DataLayout.cpp:

Go to the source code of this file.

Functions

static std::pair< StringRef, StringRefsplit (StringRef Str, char Separator)
 Checked version of split, to ensure mandatory subparts. More...
 
static unsigned getInt (StringRef R)
 Get an unsigned integer, including error checks. More...
 
static unsigned inBytes (unsigned Bits)
 Convert bits into bytes. Assert if not a byte width multiple. More...
 
static unsigned getAddrSpace (StringRef R)
 

Variables

static const LayoutAlignElem DefaultAlignments []
 

Function Documentation

◆ getAddrSpace()

static unsigned getAddrSpace ( StringRef  R)
static

◆ getInt()

static unsigned getInt ( StringRef  R)
static

◆ inBytes()

static unsigned inBytes ( unsigned  Bits)
static

Convert bits into bytes. Assert if not a byte width multiple.

Definition at line 218 of file DataLayout.cpp.

References llvm::report_fatal_error().

Referenced by getAddrSpace().

◆ split()

static std::pair<StringRef, StringRef> split ( StringRef  Str,
char  Separator 
)
static

Checked version of split, to ensure mandatory subparts.

Definition at line 198 of file DataLayout.cpp.

References assert(), llvm::StringRef::empty(), llvm::report_fatal_error(), and llvm::StringRef::split().

Referenced by getAddrSpace().

Variable Documentation

◆ DefaultAlignments

const LayoutAlignElem DefaultAlignments[]
static
Initial value:
= {
{INTEGER_ALIGN, 1, Align(1), Align(1)},
{INTEGER_ALIGN, 8, Align(1), Align(1)},
{INTEGER_ALIGN, 16, Align(2), Align(2)},
{INTEGER_ALIGN, 32, Align(4), Align(4)},
{INTEGER_ALIGN, 64, Align(4), Align(8)},
{FLOAT_ALIGN, 16, Align(2), Align(2)},
{FLOAT_ALIGN, 32, Align(4), Align(4)},
{FLOAT_ALIGN, 64, Align(8), Align(8)},
{FLOAT_ALIGN, 128, Align(16), Align(16)},
{VECTOR_ALIGN, 64, Align(8), Align(8)},
{VECTOR_ALIGN, 128, Align(16), Align(16)},
{AGGREGATE_ALIGN, 0, Align(1), Align(8)}
}
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.

Definition at line 159 of file DataLayout.cpp.