clang 19.0.0git
ABIInfoImpl.cpp
Go to the documentation of this file.
1//===- ABIInfoImpl.cpp ----------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "ABIInfoImpl.h"
10
11using namespace clang;
12using namespace clang::CodeGen;
13
14// Pin the vtable to this file.
16
19
20 if (isAggregateTypeForABI(Ty)) {
21 // Records with non-trivial destructors/copy-constructors should not be
22 // passed by value.
25
26 return getNaturalAlignIndirect(Ty);
27 }
28
29 // Treat an enum type as its underlying type.
30 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
31 Ty = EnumTy->getDecl()->getIntegerType();
32
33 ASTContext &Context = getContext();
34 if (const auto *EIT = Ty->getAs<BitIntType>())
35 if (EIT->getNumBits() >
36 Context.getTypeSize(Context.getTargetInfo().hasInt128Type()
37 ? Context.Int128Ty
38 : Context.LongLongTy))
39 return getNaturalAlignIndirect(Ty);
40
43}
44
46 if (RetTy->isVoidType())
47 return ABIArgInfo::getIgnore();
48
49 if (isAggregateTypeForABI(RetTy))
50 return getNaturalAlignIndirect(RetTy);
51
52 // Treat an enum type as its underlying type.
53 if (const EnumType *EnumTy = RetTy->getAs<EnumType>())
54 RetTy = EnumTy->getDecl()->getIntegerType();
55
56 if (const auto *EIT = RetTy->getAs<BitIntType>())
57 if (EIT->getNumBits() >
58 getContext().getTypeSize(getContext().getTargetInfo().hasInt128Type()
59 ? getContext().Int128Ty
60 : getContext().LongLongTy))
61 return getNaturalAlignIndirect(RetTy);
62
65}
66
70 for (auto &I : FI.arguments())
71 I.info = classifyArgumentType(I.type);
72}
73
75 QualType Ty) const {
76 return EmitVAArgInstr(CGF, VAListAddr, Ty, classifyArgumentType(Ty));
77}
78
80 llvm::LLVMContext &LLVMContext) {
81 // Alignment and Size are measured in bits.
82 const uint64_t Size = Context.getTypeSize(Ty);
83 const uint64_t Alignment = Context.getTypeAlign(Ty);
84 llvm::Type *IntType = llvm::Type::getIntNTy(LLVMContext, Alignment);
85 const uint64_t NumElements = (Size + Alignment - 1) / Alignment;
86 return ABIArgInfo::getDirect(llvm::ArrayType::get(IntType, NumElements));
87}
88
90 llvm::Value *Array, llvm::Value *Value,
91 unsigned FirstIndex, unsigned LastIndex) {
92 // Alternatively, we could emit this as a loop in the source.
93 for (unsigned I = FirstIndex; I <= LastIndex; ++I) {
94 llvm::Value *Cell =
95 Builder.CreateConstInBoundsGEP1_32(Builder.getInt8Ty(), Array, I);
96 Builder.CreateAlignedStore(Value, Cell, CharUnits::One());
97 }
98}
99
103}
104
106 return CGF.ConvertTypeForMem(
108}
109
111 CGCXXABI &CXXABI) {
112 const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(RT->getDecl());
113 if (!RD) {
114 if (!RT->getDecl()->canPassInRegisters())
117 }
118 return CXXABI.getRecordArgABI(RD);
119}
120
122 const RecordType *RT = T->getAs<RecordType>();
123 if (!RT)
125 return getRecordArgABI(RT, CXXABI);
126}
127
129 const ABIInfo &Info) {
130 QualType Ty = FI.getReturnType();
131
132 if (const auto *RT = Ty->getAs<RecordType>())
133 if (!isa<CXXRecordDecl>(RT->getDecl()) &&
134 !RT->getDecl()->canPassInRegisters()) {
136 return true;
137 }
138
139 return CXXABI.classifyReturnType(FI);
140}
141
143 if (const RecordType *UT = Ty->getAsUnionType()) {
144 const RecordDecl *UD = UT->getDecl();
145 if (UD->hasAttr<TransparentUnionAttr>()) {
146 assert(!UD->field_empty() && "sema created an empty transparent union");
147 return UD->field_begin()->getType();
148 }
149 }
150 return Ty;
151}
152
154 llvm::Value *Ptr,
155 CharUnits Align) {
156 // OverflowArgArea = (OverflowArgArea + Align - 1) & -Align;
157 llvm::Value *RoundUp = CGF.Builder.CreateConstInBoundsGEP1_32(
158 CGF.Builder.getInt8Ty(), Ptr, Align.getQuantity() - 1);
159 return CGF.Builder.CreateIntrinsic(
160 llvm::Intrinsic::ptrmask, {Ptr->getType(), CGF.IntPtrTy},
161 {RoundUp, llvm::ConstantInt::get(CGF.IntPtrTy, -Align.getQuantity())},
162 nullptr, Ptr->getName() + ".aligned");
163}
164
167 llvm::Type *DirectTy, CharUnits DirectSize,
168 CharUnits DirectAlign, CharUnits SlotSize,
169 bool AllowHigherAlign, bool ForceRightAdjust) {
170 // Cast the element type to i8* if necessary. Some platforms define
171 // va_list as a struct containing an i8* instead of just an i8*.
172 if (VAListAddr.getElementType() != CGF.Int8PtrTy)
173 VAListAddr = VAListAddr.withElementType(CGF.Int8PtrTy);
174
175 llvm::Value *Ptr = CGF.Builder.CreateLoad(VAListAddr, "argp.cur");
176
177 // If the CC aligns values higher than the slot size, do so if needed.
178 Address Addr = Address::invalid();
179 if (AllowHigherAlign && DirectAlign > SlotSize) {
180 Addr = Address(emitRoundPointerUpToAlignment(CGF, Ptr, DirectAlign),
181 CGF.Int8Ty, DirectAlign);
182 } else {
183 Addr = Address(Ptr, CGF.Int8Ty, SlotSize);
184 }
185
186 // Advance the pointer past the argument, then store that back.
187 CharUnits FullDirectSize = DirectSize.alignTo(SlotSize);
188 Address NextPtr =
189 CGF.Builder.CreateConstInBoundsByteGEP(Addr, FullDirectSize, "argp.next");
190 CGF.Builder.CreateStore(NextPtr.emitRawPointer(CGF), VAListAddr);
191
192 // If the argument is smaller than a slot, and this is a big-endian
193 // target, the argument will be right-adjusted in its slot.
194 if (DirectSize < SlotSize && CGF.CGM.getDataLayout().isBigEndian() &&
195 (!DirectTy->isStructTy() || ForceRightAdjust)) {
196 Addr = CGF.Builder.CreateConstInBoundsByteGEP(Addr, SlotSize - DirectSize);
197 }
198
199 return Addr.withElementType(DirectTy);
200}
201
203 QualType ValueTy, bool IsIndirect,
204 TypeInfoChars ValueInfo,
205 CharUnits SlotSizeAndAlign,
206 bool AllowHigherAlign,
207 bool ForceRightAdjust) {
208 // The size and alignment of the value that was passed directly.
209 CharUnits DirectSize, DirectAlign;
210 if (IsIndirect) {
211 DirectSize = CGF.getPointerSize();
212 DirectAlign = CGF.getPointerAlign();
213 } else {
214 DirectSize = ValueInfo.Width;
215 DirectAlign = ValueInfo.Align;
216 }
217
218 // Cast the address we've calculated to the right type.
219 llvm::Type *DirectTy = CGF.ConvertTypeForMem(ValueTy), *ElementTy = DirectTy;
220 if (IsIndirect) {
221 unsigned AllocaAS = CGF.CGM.getDataLayout().getAllocaAddrSpace();
222 DirectTy = llvm::PointerType::get(CGF.getLLVMContext(), AllocaAS);
223 }
224
225 Address Addr = emitVoidPtrDirectVAArg(CGF, VAListAddr, DirectTy, DirectSize,
226 DirectAlign, SlotSizeAndAlign,
227 AllowHigherAlign, ForceRightAdjust);
228
229 if (IsIndirect) {
230 Addr = Address(CGF.Builder.CreateLoad(Addr), ElementTy, ValueInfo.Align);
231 }
232
233 return Addr;
234}
235
237 llvm::BasicBlock *Block1, Address Addr2,
238 llvm::BasicBlock *Block2,
239 const llvm::Twine &Name) {
240 assert(Addr1.getType() == Addr2.getType());
241 llvm::PHINode *PHI = CGF.Builder.CreatePHI(Addr1.getType(), 2, Name);
242 PHI->addIncoming(Addr1.emitRawPointer(CGF), Block1);
243 PHI->addIncoming(Addr2.emitRawPointer(CGF), Block2);
244 CharUnits Align = std::min(Addr1.getAlignment(), Addr2.getAlignment());
245 return Address(PHI, Addr1.getElementType(), Align);
246}
247
249 bool AllowArrays, bool AsIfNoUniqueAddr) {
250 if (FD->isUnnamedBitField())
251 return true;
252
253 QualType FT = FD->getType();
254
255 // Constant arrays of empty records count as empty, strip them off.
256 // Constant arrays of zero length always count as empty.
257 bool WasArray = false;
258 if (AllowArrays)
259 while (const ConstantArrayType *AT = Context.getAsConstantArrayType(FT)) {
260 if (AT->isZeroSize())
261 return true;
262 FT = AT->getElementType();
263 // The [[no_unique_address]] special case below does not apply to
264 // arrays of C++ empty records, so we need to remember this fact.
265 WasArray = true;
266 }
267
268 const RecordType *RT = FT->getAs<RecordType>();
269 if (!RT)
270 return false;
271
272 // C++ record fields are never empty, at least in the Itanium ABI.
273 //
274 // FIXME: We should use a predicate for whether this behavior is true in the
275 // current ABI.
276 //
277 // The exception to the above rule are fields marked with the
278 // [[no_unique_address]] attribute (since C++20). Those do count as empty
279 // according to the Itanium ABI. The exception applies only to records,
280 // not arrays of records, so we must also check whether we stripped off an
281 // array type above.
282 if (isa<CXXRecordDecl>(RT->getDecl()) &&
283 (WasArray || (!AsIfNoUniqueAddr && !FD->hasAttr<NoUniqueAddressAttr>())))
284 return false;
285
286 return isEmptyRecord(Context, FT, AllowArrays, AsIfNoUniqueAddr);
287}
288
289bool CodeGen::isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays,
290 bool AsIfNoUniqueAddr) {
291 const RecordType *RT = T->getAs<RecordType>();
292 if (!RT)
293 return false;
294 const RecordDecl *RD = RT->getDecl();
295 if (RD->hasFlexibleArrayMember())
296 return false;
297
298 // If this is a C++ record, check the bases first.
299 if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(RD))
300 for (const auto &I : CXXRD->bases())
301 if (!isEmptyRecord(Context, I.getType(), true, AsIfNoUniqueAddr))
302 return false;
303
304 for (const auto *I : RD->fields())
305 if (!isEmptyField(Context, I, AllowArrays, AsIfNoUniqueAddr))
306 return false;
307 return true;
308}
309
311 const RecordType *RT = T->getAs<RecordType>();
312 if (!RT)
313 return nullptr;
314
315 const RecordDecl *RD = RT->getDecl();
316 if (RD->hasFlexibleArrayMember())
317 return nullptr;
318
319 const Type *Found = nullptr;
320
321 // If this is a C++ record, check the bases first.
322 if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(RD)) {
323 for (const auto &I : CXXRD->bases()) {
324 // Ignore empty records.
325 if (isEmptyRecord(Context, I.getType(), true))
326 continue;
327
328 // If we already found an element then this isn't a single-element struct.
329 if (Found)
330 return nullptr;
331
332 // If this is non-empty and not a single element struct, the composite
333 // cannot be a single element struct.
334 Found = isSingleElementStruct(I.getType(), Context);
335 if (!Found)
336 return nullptr;
337 }
338 }
339
340 // Check for single element.
341 for (const auto *FD : RD->fields()) {
342 QualType FT = FD->getType();
343
344 // Ignore empty fields.
345 if (isEmptyField(Context, FD, true))
346 continue;
347
348 // If we already found an element then this isn't a single-element
349 // struct.
350 if (Found)
351 return nullptr;
352
353 // Treat single element arrays as the element.
354 while (const ConstantArrayType *AT = Context.getAsConstantArrayType(FT)) {
355 if (AT->getZExtSize() != 1)
356 break;
357 FT = AT->getElementType();
358 }
359
360 if (!isAggregateTypeForABI(FT)) {
361 Found = FT.getTypePtr();
362 } else {
363 Found = isSingleElementStruct(FT, Context);
364 if (!Found)
365 return nullptr;
366 }
367 }
368
369 // We don't consider a struct a single-element struct if it has
370 // padding beyond the element type.
371 if (Found && Context.getTypeSize(Found) != Context.getTypeSize(T))
372 return nullptr;
373
374 return Found;
375}
376
378 QualType Ty, const ABIArgInfo &AI) {
379 // This default implementation defers to the llvm backend's va_arg
380 // instruction. It can handle only passing arguments directly
381 // (typically only handled in the backend for primitive types), or
382 // aggregates passed indirectly by pointer (NOTE: if the "byval"
383 // flag has ABI impact in the callee, this implementation cannot
384 // work.)
385
386 // Only a few cases are covered here at the moment -- those needed
387 // by the default abi.
388 llvm::Value *Val;
389
390 if (AI.isIndirect()) {
391 assert(!AI.getPaddingType() &&
392 "Unexpected PaddingType seen in arginfo in generic VAArg emitter!");
393 assert(
394 !AI.getIndirectRealign() &&
395 "Unexpected IndirectRealign seen in arginfo in generic VAArg emitter!");
396
397 auto TyInfo = CGF.getContext().getTypeInfoInChars(Ty);
398 CharUnits TyAlignForABI = TyInfo.Align;
399
400 llvm::Type *ElementTy = CGF.ConvertTypeForMem(Ty);
401 llvm::Type *BaseTy = llvm::PointerType::getUnqual(ElementTy);
402 llvm::Value *Addr =
403 CGF.Builder.CreateVAArg(VAListAddr.emitRawPointer(CGF), BaseTy);
404 return Address(Addr, ElementTy, TyAlignForABI);
405 } else {
406 assert((AI.isDirect() || AI.isExtend()) &&
407 "Unexpected ArgInfo Kind in generic VAArg emitter!");
408
409 assert(!AI.getInReg() &&
410 "Unexpected InReg seen in arginfo in generic VAArg emitter!");
411 assert(!AI.getPaddingType() &&
412 "Unexpected PaddingType seen in arginfo in generic VAArg emitter!");
413 assert(!AI.getDirectOffset() &&
414 "Unexpected DirectOffset seen in arginfo in generic VAArg emitter!");
415 assert(!AI.getCoerceToType() &&
416 "Unexpected CoerceToType seen in arginfo in generic VAArg emitter!");
417
418 Address Temp = CGF.CreateMemTemp(Ty, "varet");
419 Val = CGF.Builder.CreateVAArg(VAListAddr.emitRawPointer(CGF),
420 CGF.ConvertTypeForMem(Ty));
421 CGF.Builder.CreateStore(Val, Temp);
422 return Temp;
423 }
424}
425
427 return Ty->getAs<VectorType>() && Context.getTypeSize(Ty) == 128;
428}
429
431 const RecordType *RT = Ty->getAs<RecordType>();
432 if (!RT)
433 return false;
434 const RecordDecl *RD = RT->getDecl();
435
436 // If this is a C++ record, check the bases first.
437 if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(RD))
438 for (const auto &I : CXXRD->bases())
439 if (!isRecordWithSIMDVectorType(Context, I.getType()))
440 return false;
441
442 for (const auto *i : RD->fields()) {
443 QualType FT = i->getType();
444
445 if (isSIMDVectorType(Context, FT))
446 return true;
447
448 if (isRecordWithSIMDVectorType(Context, FT))
449 return true;
450 }
451
452 return false;
453}
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:182
const ConstantArrayType * getAsConstantArrayType(QualType T) const
Definition: ASTContext.h:2767
CanQualType Int128Ty
Definition: ASTContext.h:1100
QualType getBuiltinVaListType() const
Retrieve the type of the __builtin_va_list type.
Definition: ASTContext.h:2118
TypeInfoChars getTypeInfoInChars(const Type *T) const
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
Definition: ASTContext.h:2340
const TargetInfo & getTargetInfo() const
Definition: ASTContext.h:757
CanQualType LongLongTy
Definition: ASTContext.h:1100
unsigned getTypeAlign(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in bits.
Definition: ASTContext.h:2371
A fixed int type of a specified bitwidth.
Definition: Type.h:7238
Implements C++ ABI-specific semantic analysis functions.
Definition: CXXABI.h:29
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Definition: CharUnits.h:185
static CharUnits One()
One - Construct a CharUnits quantity of one.
Definition: CharUnits.h:58
CharUnits alignTo(const CharUnits &Align) const
alignTo - Returns the next integer (mod 2**64) that is greater than or equal to this quantity and is ...
Definition: CharUnits.h:201
ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to ...
static ABIArgInfo getIgnore()
unsigned getDirectOffset() const
llvm::Type * getPaddingType() const
static ABIArgInfo getDirect(llvm::Type *T=nullptr, unsigned Offset=0, llvm::Type *Padding=nullptr, bool CanBeFlattened=true, unsigned Align=0)
static ABIArgInfo getExtend(QualType Ty, llvm::Type *T=nullptr)
llvm::Type * getCoerceToType() const
ABIInfo - Target specific hooks for defining how a type should be passed or returned from functions.
Definition: ABIInfo.h:45
CodeGen::CGCXXABI & getCXXABI() const
Definition: ABIInfo.cpp:18
ASTContext & getContext() const
Definition: ABIInfo.cpp:20
bool isPromotableIntegerTypeForABI(QualType Ty) const
Definition: ABIInfo.cpp:163
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...
Definition: ABIInfo.cpp:174
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
Definition: Address.h:111
static Address invalid()
Definition: Address.h:153
llvm::Value * emitRawPointer(CodeGenFunction &CGF) const
Return the pointer contained in this class after authenticating it and adding offset to it if necessa...
Definition: Address.h:220
CharUnits getAlignment() const
Definition: Address.h:166
llvm::Type * getElementType() const
Return the type of the values stored in this address.
Definition: Address.h:184
Address withElementType(llvm::Type *ElemTy) const
Return address with different element type, but same pointer and alignment.
Definition: Address.h:241
llvm::PointerType * getType() const
Return the type of the pointer value.
Definition: Address.h:176
llvm::StoreInst * CreateStore(llvm::Value *Val, Address Addr, bool IsVolatile=false)
Definition: CGBuilder.h:136
Address CreateConstInBoundsByteGEP(Address Addr, CharUnits Offset, const llvm::Twine &Name="")
Given a pointer to i8, adjust it by a given constant offset.
Definition: CGBuilder.h:305
llvm::LoadInst * CreateLoad(Address Addr, const llvm::Twine &Name="")
Definition: CGBuilder.h:108
Implements C++ ABI-specific code generation functions.
Definition: CGCXXABI.h:43
RecordArgABI
Specify how one should pass an argument of a record type.
Definition: CGCXXABI.h:150
@ RAA_Default
Pass it using the normal C aggregate rules for the ABI, potentially introducing extra copies and pass...
Definition: CGCXXABI.h:153
@ RAA_Indirect
Pass it as a pointer to temporary memory.
Definition: CGCXXABI.h:161
@ RAA_DirectInMemory
Pass it on the stack using its defined layout.
Definition: CGCXXABI.h:158
CGFunctionInfo - Class to encapsulate the information about a function definition.
CanQualType getReturnType() const
MutableArrayRef< ArgInfo > arguments()
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
static bool hasScalarEvaluationKind(QualType T)
llvm::Type * ConvertTypeForMem(QualType T)
RawAddress CreateMemTemp(QualType T, const Twine &Name="tmp", RawAddress *Alloca=nullptr)
CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignmen and cas...
llvm::LLVMContext & getLLVMContext()
const llvm::DataLayout & getDataLayout() const
ABIArgInfo classifyArgumentType(QualType RetTy) const
Definition: ABIInfoImpl.cpp:17
ABIArgInfo classifyReturnType(QualType RetTy) const
Definition: ABIInfoImpl.cpp:45
void computeInfo(CGFunctionInfo &FI) const override
Definition: ABIInfoImpl.cpp:67
Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty) const override
EmitVAArg - Emit the target dependent code to load a value of.
Definition: ABIInfoImpl.cpp:74
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:3552
bool hasAttr() const
Definition: DeclBase.h:583
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
Definition: Type.h:5571
Represents a member of a struct/union/class.
Definition: Decl.h:3058
bool isUnnamedBitField() const
Determines whether this is an unnamed bitfield.
Definition: Decl.h:3152
A (possibly-)qualified type.
Definition: Type.h:940
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Definition: Type.h:7355
Represents a struct/union/class.
Definition: Decl.h:4169
bool canPassInRegisters() const
Determine whether this class can be passed in registers.
Definition: Decl.h:4298
bool hasFlexibleArrayMember() const
Definition: Decl.h:4202
field_range fields() const
Definition: Decl.h:4375
bool field_empty() const
Definition: Decl.h:4383
field_iterator field_begin() const
Definition: Decl.cpp:5071
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:5545
RecordDecl * getDecl() const
Definition: Type.h:5555
virtual bool hasInt128Type() const
Determine whether the __int128 type is supported on this target.
Definition: TargetInfo.h:635
The base class of the type hierarchy.
Definition: Type.h:1813
bool isVoidType() const
Definition: Type.h:7901
const RecordType * getAsUnionType() const
NOTE: getAs*ArrayType are methods on ASTContext.
Definition: Type.cpp:729
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
Definition: Type.cpp:694
bool isMemberFunctionPointerType() const
Definition: Type.h:7660
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:8119
QualType getType() const
Definition: Decl.h:717
Represents a GCC generic vector type.
Definition: Type.h:3965
CGCXXABI::RecordArgABI getRecordArgABI(const RecordType *RT, CGCXXABI &CXXABI)
bool classifyReturnType(const CGCXXABI &CXXABI, CGFunctionInfo &FI, const ABIInfo &Info)
Address EmitVAArgInstr(CodeGenFunction &CGF, Address VAListAddr, QualType Ty, const ABIArgInfo &AI)
Address emitVoidPtrDirectVAArg(CodeGenFunction &CGF, Address VAListAddr, llvm::Type *DirectTy, CharUnits DirectSize, CharUnits DirectAlign, CharUnits SlotSize, bool AllowHigherAlign, bool ForceRightAdjust=false)
Emit va_arg for a platform using the common void* representation, where arguments are simply emitted ...
Address emitVoidPtrVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType ValueTy, bool IsIndirect, TypeInfoChars ValueInfo, CharUnits SlotSizeAndAlign, bool AllowHigherAlign, bool ForceRightAdjust=false)
Emit va_arg for a platform using the common void* representation, where arguments are simply emitted ...
bool isRecordWithSIMDVectorType(ASTContext &Context, QualType Ty)
Address emitMergePHI(CodeGenFunction &CGF, Address Addr1, llvm::BasicBlock *Block1, Address Addr2, llvm::BasicBlock *Block2, const llvm::Twine &Name="")
bool isEmptyField(ASTContext &Context, const FieldDecl *FD, bool AllowArrays, bool AsIfNoUniqueAddr=false)
isEmptyField - Return true iff a the field is "empty", that is it is an unnamed bit-field or an (arra...
ABIArgInfo coerceToIntArray(QualType Ty, ASTContext &Context, llvm::LLVMContext &LLVMContext)
Definition: ABIInfoImpl.cpp:79
llvm::Value * emitRoundPointerUpToAlignment(CodeGenFunction &CGF, llvm::Value *Ptr, CharUnits Align)
bool isAggregateTypeForABI(QualType T)
const Type * isSingleElementStruct(QualType T, ASTContext &Context)
isSingleElementStruct - Determine if a structure is a "single element struct", i.e.
llvm::Type * getVAListElementType(CodeGenFunction &CGF)
void AssignToArrayRange(CodeGen::CGBuilderTy &Builder, llvm::Value *Array, llvm::Value *Value, unsigned FirstIndex, unsigned LastIndex)
Definition: ABIInfoImpl.cpp:89
QualType useFirstFieldIfTransparentUnion(QualType Ty)
Pass transparent unions as if they were the type of the first element.
bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, bool AsIfNoUniqueAddr=false)
isEmptyRecord - Return true iff a structure contains only empty fields.
bool isSIMDVectorType(ASTContext &Context, QualType Ty)
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64