52 uint64_t Members)
const {
62 uint64_t &Members)
const {
64 uint64_t NElements = AT->getZExtSize();
71 if (RD->hasFlexibleArrayMember())
78 if (
const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(RD)) {
79 if (!
getCXXABI().isPermittedToBeHomogeneousAggregate(CXXRD))
82 for (
const auto &I : CXXRD->bases()) {
91 Members += FldMembers;
95 for (
const auto *FD : RD->fields()) {
100 if (AT->isZeroSize())
102 FT = AT->getElementType();
108 FD->isZeroLengthBitField())
115 Members = (RD->isUnion() ?
116 std::max(Members, FldMembers) : Members + FldMembers);
130 Ty = CT->getElementType();
146 QualType EltTy = VT->getElementType();
147 unsigned NumElements =
174 bool ByVal,
bool Realign,
175 llvm::Type *Padding)
const {
177 AddrSpace, ByVal, Realign, Padding);
181 bool Realign)
const {
187 raw_ostream &Out)
const {
188 if (
Attr->isDefaultVersion())
194 raw_ostream &Out)
const {
199 raw_ostream &Out)
const {
201 Out <<
'.' <<
Attr->getMangledIndex(Index);
205 raw_ostream &Out)
const {
206 if (AttrStr ==
"default") {
215 llvm::sort(Info.
Features, [&TI](StringRef LHS, StringRef RHS) {
218 assert(LHS.starts_with(
"+") && RHS.starts_with(
"+") &&
219 "Features should always have a prefix.");
220 return TI.getFMVPriority({LHS.substr(1)})
225 if (!Info.CPU.empty()) {
227 Out <<
"arch_" << Info.CPU;
230 for (StringRef Feat : Info.Features) {
234 Out << Feat.substr(1);
238llvm::FixedVectorType *
241 if (
T->getNumElements() == 3 && !Opt.PreserveVec3Type)
242 return llvm::FixedVectorType::get(
T->getElementType(), 4);
271 unsigned maxAllRegisters)
const {
272 unsigned intCount = 0, fpCount = 0;
273 for (llvm::Type *
type : scalarTypes) {
274 if (
type->isPointerTy()) {
276 }
else if (
auto intTy = dyn_cast<llvm::IntegerType>(
type)) {
278 intCount += (intTy->getBitWidth() + ptrWidth - 1) / ptrWidth;
280 assert(
type->isVectorTy() ||
type->isFloatingPointTy());
285 return (intCount + fpCount > maxAllRegisters);
289 bool AsReturnValue)
const {
294 unsigned NumElts)
const {
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
const LangOptions & getLangOpts() const
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
Attr - This represents one attribute.
A fixed int type of a specified bitwidth.
Represents a C++ struct/union/class.
CharUnits - This is an opaque type for sizes expressed in character units.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to ...
static ABIArgInfo getIndirectInReg(CharUnits Alignment, bool ByVal=true, bool Realign=false)
static ABIArgInfo getIndirect(CharUnits Alignment, unsigned AddrSpace, bool ByVal=true, bool Realign=false, llvm::Type *Padding=nullptr)
const llvm::DataLayout & getDataLayout() const
CodeGen::ABIArgInfo getNaturalAlignIndirect(QualType Ty, unsigned AddrSpace, bool ByVal=true, bool Realign=false, llvm::Type *Padding=nullptr) const
A convenience method to return an indirect ABIArgInfo with an expected alignment equal to the ABI ali...
const CodeGenOptions & getCodeGenOpts() const
CodeGen::CodeGenTypes & CGT
bool isHomogeneousAggregate(QualType Ty, const Type *&Base, uint64_t &Members) const
isHomogeneousAggregate - Return true if a type is an ELFv2 homogeneous aggregate.
CodeGen::CGCXXABI & getCXXABI() const
ASTContext & getContext() const
virtual bool isHomogeneousAggregateBaseType(QualType Ty) const
bool isPromotableIntegerTypeForABI(QualType Ty) const
virtual void createCoercedStore(llvm::Value *Val, Address DstAddr, const ABIArgInfo &AI, bool DestIsVolatile, CodeGenFunction &CGF) const
virtual void appendAttributeMangling(TargetAttr *Attr, raw_ostream &Out) const
bool isOHOSFamily() const
virtual RValue EmitMSVAArg(CodeGen::CodeGenFunction &CGF, CodeGen::Address VAListAddr, QualType Ty, AggValueSlot Slot) const
Emit the target dependent code to load a value of.
virtual llvm::Value * createCoercedLoad(Address SrcAddr, const ABIArgInfo &AI, CodeGenFunction &CGF) const
virtual bool isHomogeneousAggregateSmallEnough(const Type *Base, uint64_t Members) const
const TargetInfo & getTarget() const
virtual bool isZeroLengthBitfieldPermittedInHomogeneousAggregate() const
CodeGen::ABIArgInfo getNaturalAlignIndirectInReg(QualType Ty, bool Realign=false) const
llvm::LLVMContext & getVMContext() const
virtual llvm::FixedVectorType * getOptimalVectorMemoryType(llvm::FixedVectorType *T, const LangOptions &Opt) const
Returns the optimal vector memory type based on the given vector type.
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
Implements C++ ABI-specific code generation functions.
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
CGCXXABI & getCXXABI() const
const CodeGenOptions & getCodeGenOpts() const
ASTContext & getContext() const
const TargetInfo & getTarget() const
llvm::LLVMContext & getLLVMContext()
const llvm::DataLayout & getDataLayout() const
RValue - This trivial value class is used to represent the result of an expression that is evaluated.
static RValue getIgnored()
virtual bool isLegalVectorType(CharUnits VectorSize, llvm::Type *EltTy, unsigned NumElts) const
Returns true if the given vector type is legal from Swift's calling convention perspective.
bool occupiesMoreThan(ArrayRef< llvm::Type * > scalarTypes, unsigned maxAllRegisters) const
Does the given lowering require more than the given number of registers when expanded?
virtual bool shouldPassIndirectly(ArrayRef< llvm::Type * > ComponentTys, bool AsReturnValue) const
Returns true if an aggregate which expands to the given type sequence should be passed / returned ind...
Complex values, per C99 6.2.5p11.
Represents the canonical version of C arrays with a specified constant size.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
A (possibly-)qualified type.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Exposes information about the current target.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
uint64_t getPointerWidth(LangAS AddrSpace) const
Return the width of pointers on this target, for the specified address space.
virtual llvm::APInt getFMVPriority(ArrayRef< StringRef > Features) const
virtual ParsedTargetAttr parseTargetAttr(StringRef Str) const
The base class of the type hierarchy.
RecordDecl * getAsRecordDecl() const
Retrieves the RecordDecl this type refers to.
bool isVectorType() const
const T * getAs() const
Member-template getAs<specific type>'.
Represents a GCC generic vector type.
bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, bool AsIfNoUniqueAddr=false)
isEmptyRecord - Return true iff a structure contains only empty fields.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
Contains information gathered from parsing the contents of TargetAttr.
std::vector< std::string > Features