7 #include <llvm/Support/raw_ostream.h>
8 #include <llvm/Support/MachineValueType.h>
9 #include <llvm/Support/Alignment.h>
34 enum class Kind : uint8_t {
45 static TypeFlag GetByVal(
unsigned size, llvm::Align align);
47 bool IsByVal()
const {
return GetKind() == Kind::BYVAL; }
49 Kind GetKind()
const {
return static_cast<Kind
>(kind_); }
51 bool operator==(
const TypeFlag &that)
const
56 unsigned GetByValSize()
const;
57 llvm::Align GetByValAlign()
const;
79 FlaggedType(Type type) : type_(type), flag_(TypeFlag::GetNone()) {}
82 Type GetType()
const {
return type_; }
83 TypeFlag GetFlag()
const {
return flag_; }
87 return type_ == that.type_ && flag_ == that.flag_;
100 llvm::raw_ostream &operator<<(llvm::raw_ostream &os, Type type);
105 llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
TypeFlag flag);
110 llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
FlaggedType type);
115 bool IsIntegerType(Type type);
120 bool IsFloatType(Type type);
125 unsigned GetSize(Type type);
130 unsigned GetBitWidth(Type type);
135 llvm::Align GetAlignment(Type type);
140 llvm::MVT GetVT(Type type);