52 uint64_t Members)
const {
62 uint64_t &Members)
const {
64 uint64_t NElements = AT->getZExtSize();
79 if (
const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(RD)) {
80 if (!
getCXXABI().isPermittedToBeHomogeneousAggregate(CXXRD))
83 for (
const auto &I : CXXRD->bases()) {
92 Members += FldMembers;
96 for (
const auto *FD : RD->
fields()) {
101 if (AT->isZeroSize())
103 FT = AT->getElementType();
117 std::max(Members, FldMembers) : Members + FldMembers);
131 Ty = CT->getElementType();
147 QualType EltTy = VT->getElementType();
148 unsigned NumElements =
176 llvm::Type *Padding)
const {
182 bool Realign)
const {
188 raw_ostream &Out)
const {
189 if (
Attr->isDefaultVersion())
195 raw_ostream &Out)
const {
200 raw_ostream &Out)
const {
202 Out <<
'.' <<
Attr->getMangledIndex(Index);
206 raw_ostream &Out)
const {
207 if (AttrStr ==
"default") {
216 llvm::sort(Info.
Features, [&TI](StringRef LHS, StringRef RHS) {
219 assert(LHS.starts_with(
"+") && RHS.starts_with(
"+") &&
220 "Features should always have a prefix.");
221 return TI.getFMVPriority({LHS.substr(1)}) >
226 if (!Info.CPU.empty()) {
228 Out <<
"arch_" << Info.CPU;
231 for (StringRef Feat : Info.Features) {
235 Out << Feat.substr(1);
256 unsigned maxAllRegisters)
const {
257 unsigned intCount = 0, fpCount = 0;
258 for (llvm::Type *
type : scalarTypes) {
259 if (
type->isPointerTy()) {
261 }
else if (
auto intTy = dyn_cast<llvm::IntegerType>(
type)) {
263 intCount += (intTy->getBitWidth() + ptrWidth - 1) / ptrWidth;
265 assert(
type->isVectorTy() ||
type->isFloatingPointTy());
270 return (intCount + fpCount > maxAllRegisters);
274 bool AsReturnValue)
const {
279 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, bool ByVal=true, bool Realign=false, llvm::Type *Padding=nullptr)
const llvm::DataLayout & getDataLayout() const
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 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.
CodeGen::ABIArgInfo getNaturalAlignIndirect(QualType Ty, 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...
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
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.
A (possibly-)qualified type.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Represents a struct/union/class.
bool hasFlexibleArrayMember() const
field_range fields() const
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
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 unsigned getFMVPriority(ArrayRef< StringRef > Features) const
virtual ParsedTargetAttr parseTargetAttr(StringRef Str) const
The base class of the type hierarchy.
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.
Contains information gathered from parsing the contents of TargetAttr.
std::vector< std::string > Features