14#ifndef CLANG_LIB_CIR_CIRGENVALUE_H
15#define CLANG_LIB_CIR_CIRGENVALUE_H
23#include "mlir/IR/Value.h"
34 enum Flavor { Scalar, Complex, Aggregate };
43 unsigned isVolatile : 1;
49 bool isScalar()
const {
return flavor == Scalar; }
50 bool isComplex()
const {
return flavor == Complex; }
57 assert(
isScalar() &&
"Not a scalar!");
86 er.isVolatile =
false;
94 er.isVolatile =
false;
107 er.flavor = Aggregate;
108 er.isVolatile = isVolatile;
144 : alignSource(source) {}
169 mlir::Value vectorIdx;
170 mlir::Type elementType;
176 assert((!alignment.isZero() ||
type->isIncompleteType()) &&
177 "initializing l-value with zero alignment!");
180 const unsigned maxAlign = 1U << 31;
181 this->alignment = alignment.getQuantity() <= maxAlign
182 ? alignment.getQuantity()
184 assert(this->alignment == alignment.getQuantity() &&
185 "Alignment exceeds allowed max!");
186 this->baseInfo = baseInfo;
260 r.lvType = VectorElt;
280 return *bitFieldInfo;
295 r.bitFieldInfo = &info;
310 LLVM_PREFERRED_TYPE(
bool)
311 LLVM_ATTRIBUTE_UNUSED
unsigned destructedFlag : 1;
315 LLVM_PREFERRED_TYPE(
bool)
316 unsigned zeroedFlag : 1;
329 LLVM_PREFERRED_TYPE(
bool)
330 LLVM_ATTRIBUTE_UNUSED
unsigned aliasedFlag : 1;
337 LLVM_PREFERRED_TYPE(
bool)
338 LLVM_ATTRIBUTE_UNUSED
unsigned overlapFlag : 1;
354 bool zeroedFlag,
bool aliasedFlag,
bool overlapFlag)
355 : addr(addr), quals(quals), destructedFlag(destructedFlag),
356 zeroedFlag(zeroedFlag), aliasedFlag(aliasedFlag),
357 overlapFlag(overlapFlag) {}
C Language Family Type Representation.
mlir::Value getPointer() const
mlir::Type getElementType() const
clang::CharUnits getAlignment() const
IsZeroed_t isZeroed() const
static AggValueSlot forAddr(Address addr, clang::Qualifiers quals, IsDestructed_t isDestructed, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed)
AggValueSlot(Address addr, clang::Qualifiers quals, bool destructedFlag, bool zeroedFlag, bool aliasedFlag, bool overlapFlag)
static AggValueSlot forLValue(const LValue &LV, IsDestructed_t isDestructed, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed)
Address getAddress() const
static AggValueSlot ignored()
Returns an aggregate value slot indicating that the aggregate value is being ignored.
mlir::Value getPointer() const
clang::Qualifiers getQualifiers() const
AlignmentSource getAlignmentSource() const
void mergeForCast(const LValueBaseInfo &info)
LValueBaseInfo(AlignmentSource source=AlignmentSource::Type)
void setAlignmentSource(AlignmentSource source)
mlir::Value getBitFieldPointer() const
mlir::Value getVectorPointer() const
const clang::Qualifiers & getQuals() const
mlir::Value getVectorIdx() const
Address getAddress() const
static LValue makeAddr(Address address, clang::QualType t, LValueBaseInfo baseInfo)
static LValue makeVectorElt(Address vecAddress, mlir::Value index, clang::QualType t, LValueBaseInfo baseInfo)
unsigned getVRQualifiers() const
clang::QualType getType() const
static LValue makeBitfield(Address addr, const CIRGenBitFieldInfo &info, clang::QualType type, LValueBaseInfo baseInfo)
Create a new object to represent a bit-field access.
mlir::Value getPointer() const
clang::Qualifiers & getQuals()
bool isVolatileQualified() const
void setAlignment(clang::CharUnits a)
Address getVectorAddress() const
clang::CharUnits getAlignment() const
LValueBaseInfo getBaseInfo() const
void setBaseInfo(LValueBaseInfo info)
const CIRGenBitFieldInfo & getBitFieldInfo() const
Address getBitFieldAddress() const
void setAddress(Address address)
This trivial value class is used to represent the result of an expression that is evaluated.
Address getAggregateAddress() const
Return the value of the address of the aggregate.
static RValue get(mlir::Value v)
static RValue getAggregate(Address addr, bool isVolatile=false)
Convert an Address to an RValue.
mlir::Value getAggregatePointer(QualType pointeeType) const
static RValue getComplex(mlir::Value v)
bool isVolatileQualified() const
mlir::Value getValue() const
Return the value of this scalar value.
mlir::Value getComplexValue() const
Return the value of this complex value.
static RValue getIgnored()
CharUnits - This is an opaque type for sizes expressed in character units.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
A (possibly-)qualified type.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
The collection of all-type qualifiers we support.
unsigned getCVRQualifiers() const
The base class of the type hierarchy.
AlignmentSource
The source of the alignment of an l-value; an expression of confidence in the alignment actually matc...
@ AttributedType
The l-value was considered opaque, so the alignment was determined from a type, but that type was an ...
@ Type
The l-value was considered opaque, so the alignment was determined from a type.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
static AlignmentSource getFieldAlignmentSource(AlignmentSource source)
Given that the base address has the given alignment source, what's our confidence in the alignment of...
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
The JSON file list parser is used to communicate input to InstallAPI.
static bool aggValueSlot()
static bool addressIsKnownNonNull()
Record with information about how a bitfield should be accessed.