Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
clang 20.0.0git
Mips.cpp
Go to the documentation of this file.
1//===- Mips.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#include "TargetInfo.h"
11
12using namespace clang;
13using namespace clang::CodeGen;
14
15//===----------------------------------------------------------------------===//
16// MIPS ABI Implementation. This works for both little-endian and
17// big-endian variants.
18//===----------------------------------------------------------------------===//
19
20namespace {
21class MipsABIInfo : public ABIInfo {
22 bool IsO32;
23 const unsigned MinABIStackAlignInBytes, StackAlignInBytes;
24 void CoerceToIntArgs(uint64_t TySize,
25 SmallVectorImpl<llvm::Type *> &ArgList) const;
26 llvm::Type* HandleAggregates(QualType Ty, uint64_t TySize) const;
27 llvm::Type* returnAggregateInRegs(QualType RetTy, uint64_t Size) const;
28 llvm::Type* getPaddingType(uint64_t Align, uint64_t Offset) const;
29public:
30 MipsABIInfo(CodeGenTypes &CGT, bool _IsO32) :
31 ABIInfo(CGT), IsO32(_IsO32), MinABIStackAlignInBytes(IsO32 ? 4 : 8),
32 StackAlignInBytes(IsO32 ? 8 : 16) {}
33
35 ABIArgInfo classifyArgumentType(QualType RetTy, uint64_t &Offset) const;
36 void computeInfo(CGFunctionInfo &FI) const override;
37 RValue EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty,
38 AggValueSlot Slot) const override;
39 ABIArgInfo extendType(QualType Ty) const;
40};
41
42class MIPSTargetCodeGenInfo : public TargetCodeGenInfo {
43 unsigned SizeOfUnwindException;
44public:
45 MIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32)
46 : TargetCodeGenInfo(std::make_unique<MipsABIInfo>(CGT, IsO32)),
47 SizeOfUnwindException(IsO32 ? 24 : 32) {}
48
49 int getDwarfEHStackPointer(CodeGen::CodeGenModule &CGM) const override {
50 return 29;
51 }
52
53 void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
54 CodeGen::CodeGenModule &CGM) const override {
55 const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D);
56 if (!FD) return;
57 llvm::Function *Fn = cast<llvm::Function>(GV);
58
59 if (FD->hasAttr<MipsLongCallAttr>())
60 Fn->addFnAttr("long-call");
61 else if (FD->hasAttr<MipsShortCallAttr>())
62 Fn->addFnAttr("short-call");
63
64 // Other attributes do not have a meaning for declarations.
65 if (GV->isDeclaration())
66 return;
67
68 if (FD->hasAttr<Mips16Attr>()) {
69 Fn->addFnAttr("mips16");
70 }
71 else if (FD->hasAttr<NoMips16Attr>()) {
72 Fn->addFnAttr("nomips16");
73 }
74
75 if (FD->hasAttr<MicroMipsAttr>())
76 Fn->addFnAttr("micromips");
77 else if (FD->hasAttr<NoMicroMipsAttr>())
78 Fn->addFnAttr("nomicromips");
79
80 const MipsInterruptAttr *Attr = FD->getAttr<MipsInterruptAttr>();
81 if (!Attr)
82 return;
83
84 const char *Kind;
85 switch (Attr->getInterrupt()) {
86 case MipsInterruptAttr::eic: Kind = "eic"; break;
87 case MipsInterruptAttr::sw0: Kind = "sw0"; break;
88 case MipsInterruptAttr::sw1: Kind = "sw1"; break;
89 case MipsInterruptAttr::hw0: Kind = "hw0"; break;
90 case MipsInterruptAttr::hw1: Kind = "hw1"; break;
91 case MipsInterruptAttr::hw2: Kind = "hw2"; break;
92 case MipsInterruptAttr::hw3: Kind = "hw3"; break;
93 case MipsInterruptAttr::hw4: Kind = "hw4"; break;
94 case MipsInterruptAttr::hw5: Kind = "hw5"; break;
95 }
96
97 Fn->addFnAttr("interrupt", Kind);
98
99 }
100
102 llvm::Value *Address) const override;
103
104 unsigned getSizeOfUnwindException() const override {
105 return SizeOfUnwindException;
106 }
107};
108
109class WindowsMIPSTargetCodeGenInfo : public MIPSTargetCodeGenInfo {
110public:
111 WindowsMIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32)
112 : MIPSTargetCodeGenInfo(CGT, IsO32) {}
113
114 void getDependentLibraryOption(llvm::StringRef Lib,
115 llvm::SmallString<24> &Opt) const override {
116 Opt = "/DEFAULTLIB:";
117 Opt += qualifyWindowsLibrary(Lib);
118 }
119
120 void getDetectMismatchOption(llvm::StringRef Name, llvm::StringRef Value,
121 llvm::SmallString<32> &Opt) const override {
122 Opt = "/FAILIFMISMATCH:\"" + Name.str() + "=" + Value.str() + "\"";
123 }
124};
125}
126
127void MipsABIInfo::CoerceToIntArgs(
128 uint64_t TySize, SmallVectorImpl<llvm::Type *> &ArgList) const {
129 llvm::IntegerType *IntTy =
130 llvm::IntegerType::get(getVMContext(), MinABIStackAlignInBytes * 8);
131
132 // Add (TySize / MinABIStackAlignInBytes) args of IntTy.
133 for (unsigned N = TySize / (MinABIStackAlignInBytes * 8); N; --N)
134 ArgList.push_back(IntTy);
135
136 // If necessary, add one more integer type to ArgList.
137 unsigned R = TySize % (MinABIStackAlignInBytes * 8);
138
139 if (R)
140 ArgList.push_back(llvm::IntegerType::get(getVMContext(), R));
141}
142
143// In N32/64, an aligned double precision floating point field is passed in
144// a register.
145llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty, uint64_t TySize) const {
146 SmallVector<llvm::Type*, 8> ArgList, IntArgList;
147
148 if (IsO32) {
149 CoerceToIntArgs(TySize, ArgList);
150 return llvm::StructType::get(getVMContext(), ArgList);
151 }
152
153 if (Ty->isComplexType())
154 return CGT.ConvertType(Ty);
155
156 const RecordType *RT = Ty->getAs<RecordType>();
157
158 // Unions/vectors are passed in integer registers.
159 if (!RT || !RT->isStructureOrClassType()) {
160 CoerceToIntArgs(TySize, ArgList);
161 return llvm::StructType::get(getVMContext(), ArgList);
162 }
163
164 const RecordDecl *RD = RT->getDecl();
165 const ASTRecordLayout &Layout = getContext().getASTRecordLayout(RD);
166 assert(!(TySize % 8) && "Size of structure must be multiple of 8.");
167
168 uint64_t LastOffset = 0;
169 unsigned idx = 0;
170 llvm::IntegerType *I64 = llvm::IntegerType::get(getVMContext(), 64);
171
172 // Iterate over fields in the struct/class and check if there are any aligned
173 // double fields.
174 for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end();
175 i != e; ++i, ++idx) {
176 const QualType Ty = i->getType();
177 const BuiltinType *BT = Ty->getAs<BuiltinType>();
178
179 if (!BT || BT->getKind() != BuiltinType::Double)
180 continue;
181
182 uint64_t Offset = Layout.getFieldOffset(idx);
183 if (Offset % 64) // Ignore doubles that are not aligned.
184 continue;
185
186 // Add ((Offset - LastOffset) / 64) args of type i64.
187 for (unsigned j = (Offset - LastOffset) / 64; j > 0; --j)
188 ArgList.push_back(I64);
189
190 // Add double type.
191 ArgList.push_back(llvm::Type::getDoubleTy(getVMContext()));
192 LastOffset = Offset + 64;
193 }
194
195 CoerceToIntArgs(TySize - LastOffset, IntArgList);
196 ArgList.append(IntArgList.begin(), IntArgList.end());
197
198 return llvm::StructType::get(getVMContext(), ArgList);
199}
200
201llvm::Type *MipsABIInfo::getPaddingType(uint64_t OrigOffset,
202 uint64_t Offset) const {
203 if (OrigOffset + MinABIStackAlignInBytes > Offset)
204 return nullptr;
205
206 return llvm::IntegerType::get(getVMContext(), (Offset - OrigOffset) * 8);
207}
208
210MipsABIInfo::classifyArgumentType(QualType Ty, uint64_t &Offset) const {
212
213 uint64_t OrigOffset = Offset;
214 uint64_t TySize = getContext().getTypeSize(Ty);
215 uint64_t Align = getContext().getTypeAlign(Ty) / 8;
216
217 Align = std::clamp(Align, (uint64_t)MinABIStackAlignInBytes,
218 (uint64_t)StackAlignInBytes);
219 unsigned CurrOffset = llvm::alignTo(Offset, Align);
220 Offset = CurrOffset + llvm::alignTo(TySize, Align * 8) / 8;
221
222 if (isAggregateTypeForABI(Ty) || Ty->isVectorType()) {
223 // Ignore empty aggregates.
224 if (TySize == 0)
225 return ABIArgInfo::getIgnore();
226
227 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) {
228 Offset = OrigOffset + MinABIStackAlignInBytes;
229 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory);
230 }
231
232 // If we have reached here, aggregates are passed directly by coercing to
233 // another structure type. Padding is inserted if the offset of the
234 // aggregate is unaligned.
235 ABIArgInfo ArgInfo =
236 ABIArgInfo::getDirect(HandleAggregates(Ty, TySize), 0,
237 getPaddingType(OrigOffset, CurrOffset));
238 ArgInfo.setInReg(true);
239 return ArgInfo;
240 }
241
242 // Treat an enum type as its underlying type.
243 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
244 Ty = EnumTy->getDecl()->getIntegerType();
245
246 // Make sure we pass indirectly things that are too large.
247 if (const auto *EIT = Ty->getAs<BitIntType>())
248 if (EIT->getNumBits() > 128 ||
249 (EIT->getNumBits() > 64 &&
250 !getContext().getTargetInfo().hasInt128Type()))
251 return getNaturalAlignIndirect(Ty);
252
253 // All integral types are promoted to the GPR width.
255 return extendType(Ty);
256
258 nullptr, 0, IsO32 ? nullptr : getPaddingType(OrigOffset, CurrOffset));
259}
260
261llvm::Type*
262MipsABIInfo::returnAggregateInRegs(QualType RetTy, uint64_t Size) const {
263 const RecordType *RT = RetTy->getAs<RecordType>();
265
266 if (RT && RT->isStructureOrClassType()) {
267 const RecordDecl *RD = RT->getDecl();
268 const ASTRecordLayout &Layout = getContext().getASTRecordLayout(RD);
269 unsigned FieldCnt = Layout.getFieldCount();
270
271 // N32/64 returns struct/classes in floating point registers if the
272 // following conditions are met:
273 // 1. The size of the struct/class is no larger than 128-bit.
274 // 2. The struct/class has one or two fields all of which are floating
275 // point types.
276 // 3. The offset of the first field is zero (this follows what gcc does).
277 //
278 // Any other composite results are returned in integer registers.
279 //
280 if (FieldCnt && (FieldCnt <= 2) && !Layout.getFieldOffset(0)) {
282 for (; b != e; ++b) {
283 const BuiltinType *BT = b->getType()->getAs<BuiltinType>();
284
285 if (!BT || !BT->isFloatingPoint())
286 break;
287
288 RTList.push_back(CGT.ConvertType(b->getType()));
289 }
290
291 if (b == e)
292 return llvm::StructType::get(getVMContext(), RTList,
293 RD->hasAttr<PackedAttr>());
294
295 RTList.clear();
296 }
297 }
298
299 CoerceToIntArgs(Size, RTList);
300 return llvm::StructType::get(getVMContext(), RTList);
301}
302
303ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const {
304 uint64_t Size = getContext().getTypeSize(RetTy);
305
306 if (RetTy->isVoidType())
307 return ABIArgInfo::getIgnore();
308
309 // O32 doesn't treat zero-sized structs differently from other structs.
310 // However, N32/N64 ignores zero sized return values.
311 if (!IsO32 && Size == 0)
312 return ABIArgInfo::getIgnore();
313
314 if (isAggregateTypeForABI(RetTy) || RetTy->isVectorType()) {
315 if (Size <= 128) {
316 if (RetTy->isAnyComplexType())
317 return ABIArgInfo::getDirect();
318
319 // O32 returns integer vectors in registers and N32/N64 returns all small
320 // aggregates in registers.
321 if (!IsO32 ||
322 (RetTy->isVectorType() && !RetTy->hasFloatingRepresentation())) {
323 ABIArgInfo ArgInfo =
324 ABIArgInfo::getDirect(returnAggregateInRegs(RetTy, Size));
325 ArgInfo.setInReg(true);
326 return ArgInfo;
327 }
328 }
329
330 return getNaturalAlignIndirect(RetTy);
331 }
332
333 // Treat an enum type as its underlying type.
334 if (const EnumType *EnumTy = RetTy->getAs<EnumType>())
335 RetTy = EnumTy->getDecl()->getIntegerType();
336
337 // Make sure we pass indirectly things that are too large.
338 if (const auto *EIT = RetTy->getAs<BitIntType>())
339 if (EIT->getNumBits() > 128 ||
340 (EIT->getNumBits() > 64 &&
341 !getContext().getTargetInfo().hasInt128Type()))
342 return getNaturalAlignIndirect(RetTy);
343
344 if (isPromotableIntegerTypeForABI(RetTy))
345 return ABIArgInfo::getExtend(RetTy);
346
348 RetTy->isSignedIntegerOrEnumerationType()) && Size == 32 && !IsO32)
349 return ABIArgInfo::getSignExtend(RetTy);
350
351 return ABIArgInfo::getDirect();
352}
353
354void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const {
355 ABIArgInfo &RetInfo = FI.getReturnInfo();
356 if (!getCXXABI().classifyReturnType(FI))
357 RetInfo = classifyReturnType(FI.getReturnType());
358
359 // Check if a pointer to an aggregate is passed as a hidden argument.
360 uint64_t Offset = RetInfo.isIndirect() ? MinABIStackAlignInBytes : 0;
361
362 for (auto &I : FI.arguments())
363 I.info = classifyArgumentType(I.type, Offset);
364}
365
366RValue MipsABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
367 QualType OrigTy, AggValueSlot Slot) const {
368 QualType Ty = OrigTy;
369
370 // Integer arguments are promoted to 32-bit on O32 and 64-bit on N32/N64.
371 // Pointers are also promoted in the same way but this only matters for N32.
372 unsigned SlotSizeInBits = IsO32 ? 32 : 64;
373 unsigned PtrWidth = getTarget().getPointerWidth(LangAS::Default);
374 bool DidPromote = false;
375 if ((Ty->isIntegerType() &&
376 getContext().getIntWidth(Ty) < SlotSizeInBits) ||
377 (Ty->isPointerType() && PtrWidth < SlotSizeInBits)) {
378 DidPromote = true;
379 Ty = getContext().getIntTypeForBitwidth(SlotSizeInBits,
380 Ty->isSignedIntegerType());
381 }
382
383 auto TyInfo = getContext().getTypeInfoInChars(Ty);
384
385 // The alignment of things in the argument area is never larger than
386 // StackAlignInBytes.
387 TyInfo.Align =
388 std::min(TyInfo.Align, CharUnits::fromQuantity(StackAlignInBytes));
389
390 // MinABIStackAlignInBytes is the size of argument slots on the stack.
391 CharUnits ArgSlotSize = CharUnits::fromQuantity(MinABIStackAlignInBytes);
392
393 RValue Res = emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, TyInfo,
394 ArgSlotSize, /*AllowHigherAlign*/ true, Slot);
395
396 // If there was a promotion, "unpromote".
397 // TODO: can we just use a pointer into a subset of the original slot?
398 if (DidPromote) {
399 llvm::Type *ValTy = CGF.ConvertType(OrigTy);
400 llvm::Value *Promoted = Res.getScalarVal();
401
402 // Truncate down to the right width.
403 llvm::Type *IntTy = (OrigTy->isIntegerType() ? ValTy : CGF.IntPtrTy);
404 llvm::Value *V = CGF.Builder.CreateTrunc(Promoted, IntTy);
405 if (OrigTy->isPointerType())
406 V = CGF.Builder.CreateIntToPtr(V, ValTy);
407
408 return RValue::get(V);
409 }
410
411 return Res;
412}
413
414ABIArgInfo MipsABIInfo::extendType(QualType Ty) const {
415 int TySize = getContext().getTypeSize(Ty);
416
417 // MIPS64 ABI requires unsigned 32 bit integers to be sign extended.
418 if (Ty->isUnsignedIntegerOrEnumerationType() && TySize == 32)
419 return ABIArgInfo::getSignExtend(Ty);
420
421 return ABIArgInfo::getExtend(Ty);
422}
423
424bool
425MIPSTargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
426 llvm::Value *Address) const {
427 // This information comes from gcc's implementation, which seems to
428 // as canonical as it gets.
429
430 // Everything on MIPS is 4 bytes. Double-precision FP registers
431 // are aliased to pairs of single-precision FP registers.
432 llvm::Value *Four8 = llvm::ConstantInt::get(CGF.Int8Ty, 4);
433
434 // 0-31 are the general purpose registers, $0 - $31.
435 // 32-63 are the floating-point registers, $f0 - $f31.
436 // 64 and 65 are the multiply/divide registers, $hi and $lo.
437 // 66 is the (notional, I think) register for signal-handler return.
438 AssignToArrayRange(CGF.Builder, Address, Four8, 0, 65);
439
440 // 67-74 are the floating-point status registers, $fcc0 - $fcc7.
441 // They are one bit wide and ignored here.
442
443 // 80-111 are the coprocessor 0 registers, $c0r0 - $c0r31.
444 // (coprocessor 1 is the FP unit)
445 // 112-143 are the coprocessor 2 registers, $c2r0 - $c2r31.
446 // 144-175 are the coprocessor 3 registers, $c3r0 - $c3r31.
447 // 176-181 are the DSP accumulator registers.
448 AssignToArrayRange(CGF.Builder, Address, Four8, 80, 181);
449 return false;
450}
451
452std::unique_ptr<TargetCodeGenInfo>
454 return std::make_unique<MIPSTargetCodeGenInfo>(CGM.getTypes(), IsOS32);
455}
456
457std::unique_ptr<TargetCodeGenInfo>
459 return std::make_unique<WindowsMIPSTargetCodeGenInfo>(CGM.getTypes(), IsOS32);
460}
#define V(N, I)
Definition: ASTContext.h:3460
const Decl * D
__device__ __2f16 b
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
Definition: RecordLayout.h:38
unsigned getFieldCount() const
getFieldCount - Get the number of fields in the layout.
Definition: RecordLayout.h:196
uint64_t getFieldOffset(unsigned FieldNo) const
getFieldOffset - Get the offset of the given field index, in bits.
Definition: RecordLayout.h:200
Attr - This represents one attribute.
Definition: Attr.h:43
A fixed int type of a specified bitwidth.
Definition: Type.h:7819
This class is used for builtin types like 'int'.
Definition: Type.h:3034
bool isFloatingPoint() const
Definition: Type.h:3107
Kind getKind() const
Definition: Type.h:3082
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
Definition: CharUnits.h:63
ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to ...
static ABIArgInfo getIgnore()
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)
static ABIArgInfo getSignExtend(QualType Ty, llvm::Type *T=nullptr)
ABIInfo - Target specific hooks for defining how a type should be passed or returned from functions.
Definition: ABIInfo.h:47
virtual RValue EmitVAArg(CodeGen::CodeGenFunction &CGF, CodeGen::Address VAListAddr, QualType Ty, AggValueSlot Slot) const =0
EmitVAArg - Emit the target dependent code to load a value of.
virtual void computeInfo(CodeGen::CGFunctionInfo &FI) const =0
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
Definition: Address.h:128
An aggregate value slot.
Definition: CGValue.h:504
RecordArgABI
Specify how one should pass an argument of a record type.
Definition: CGCXXABI.h:150
@ 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...
llvm::Type * ConvertType(QualType T)
This class organizes the cross-function state that is used while generating LLVM code.
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
Definition: CodeGenTypes.h:54
RValue - This trivial value class is used to represent the result of an expression that is evaluated.
Definition: CGValue.h:42
static RValue get(llvm::Value *V)
Definition: CGValue.h:98
llvm::Value * getScalarVal() const
getScalarVal() - Return the Value* of this scalar value.
Definition: CGValue.h:71
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
Definition: TargetInfo.h:47
virtual unsigned getSizeOfUnwindException() const
Determines the size of struct _Unwind_Exception on this platform, in 8-bit units.
Definition: TargetInfo.cpp:77
virtual bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const
Initializes the given DWARF EH register-size table, a char*.
Definition: TargetInfo.h:150
virtual void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV, CodeGen::CodeGenModule &M) const
setTargetAttributes - Provides a convenient hook to handle extra target-specific attributes for the g...
Definition: TargetInfo.h:76
virtual int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const
Determines the DWARF register number for the stack pointer, for exception-handling purposes.
Definition: TargetInfo.h:142
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
Definition: DeclBase.h:2384
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
T * getAttr() const
Definition: DeclBase.h:576
bool hasAttr() const
Definition: DeclBase.h:580
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
Definition: Type.h:6103
Represents a function declaration or definition.
Definition: Decl.h:1935
A (possibly-)qualified type.
Definition: Type.h:929
Represents a struct/union/class.
Definition: Decl.h:4162
field_iterator field_end() const
Definition: Decl.h:4379
field_iterator field_begin() const
Definition: Decl.cpp:5095
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:6077
RecordDecl * getDecl() const
Definition: Type.h:6087
bool isVoidType() const
Definition: Type.h:8515
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
Definition: Type.cpp:2201
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition: Type.cpp:2180
bool isComplexType() const
isComplexType() does not include complex integers (a GCC extension).
Definition: Type.cpp:710
bool isUnsignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is unsigned or an enumeration types whose underlying ...
Definition: Type.cpp:2251
bool isPointerType() const
Definition: Type.h:8191
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
Definition: Type.h:8555
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
Definition: Type.h:8630
bool isAnyComplexType() const
Definition: Type.h:8299
bool hasFloatingRepresentation() const
Determine whether this type has a floating-point representation of some sort, e.g....
Definition: Type.cpp:2292
bool isStructureOrClassType() const
Definition: Type.cpp:690
bool isVectorType() const
Definition: Type.h:8303
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:8736
ABIArgInfo classifyArgumentType(CodeGenModule &CGM, CanQualType type)
Classify the rules for how to pass a particular type.
CGCXXABI::RecordArgABI getRecordArgABI(const RecordType *RT, CGCXXABI &CXXABI)
bool classifyReturnType(const CGCXXABI &CXXABI, CGFunctionInfo &FI, const ABIInfo &Info)
std::unique_ptr< TargetCodeGenInfo > createMIPSTargetCodeGenInfo(CodeGenModule &CGM, bool IsOS32)
Definition: Mips.cpp:453
RValue emitVoidPtrVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType ValueTy, bool IsIndirect, TypeInfoChars ValueInfo, CharUnits SlotSizeAndAlign, bool AllowHigherAlign, AggValueSlot Slot, bool ForceRightAdjust=false)
Emit va_arg for a platform using the common void* representation, where arguments are simply emitted ...
bool isAggregateTypeForABI(QualType T)
Definition: ABIInfoImpl.cpp:94
std::unique_ptr< TargetCodeGenInfo > createWindowsMIPSTargetCodeGenInfo(CodeGenModule &CGM, bool IsOS32)
Definition: Mips.cpp:458
void AssignToArrayRange(CodeGen::CGBuilderTy &Builder, llvm::Value *Array, llvm::Value *Value, unsigned FirstIndex, unsigned LastIndex)
Definition: ABIInfoImpl.cpp:83
QualType useFirstFieldIfTransparentUnion(QualType Ty)
Pass transparent unions as if they were the type of the first element.
The JSON file list parser is used to communicate input to InstallAPI.
unsigned long uint64_t
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64