clang 24.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,
27 bool ComplexFitsInFPRs) const;
28 llvm::Type* returnAggregateInRegs(QualType RetTy, uint64_t Size) const;
29 llvm::Type* getPaddingType(uint64_t Align, uint64_t Offset) const;
30
31 /// Whether `_Complex` values with an integer element type are returned the
32 /// way GCC returns them. Clang 23 and earlier returned the real and the
33 /// imaginary part in two separate GPRs, later versions match GCC and pack
34 /// them into one when possible.
35 bool isComplexGnuABI() const {
36 return !getContext().getLangOpts().isCompatibleWith(
37 LangOptions::ClangABI::Ver23);
38 }
39
40 ABIArgInfo classifyComplexReturnType(QualType RetTy, uint64_t Size) const;
41
42public:
43 MipsABIInfo(CodeGenTypes &CGT, bool _IsO32) :
44 ABIInfo(CGT), IsO32(_IsO32), MinABIStackAlignInBytes(IsO32 ? 4 : 8),
45 StackAlignInBytes(IsO32 ? 8 : 16) {}
46
47 ABIArgInfo classifyReturnType(QualType RetTy) const;
48 ABIArgInfo classifyArgumentType(QualType RetTy, uint64_t &Offset) const;
49 void computeInfo(CGFunctionInfo &FI) const override;
50 RValue EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty,
51 AggValueSlot Slot) const override;
52 ABIArgInfo extendType(QualType Ty) const;
53};
54
55class MIPSTargetCodeGenInfo : public TargetCodeGenInfo {
56 unsigned SizeOfUnwindException;
57public:
58 MIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32)
59 : TargetCodeGenInfo(std::make_unique<MipsABIInfo>(CGT, IsO32)),
60 SizeOfUnwindException(IsO32 ? 24 : 32) {}
61
62 int getDwarfEHStackPointer(CodeGen::CodeGenModule &CGM) const override {
63 return 29;
64 }
65
66 void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
67 CodeGen::CodeGenModule &CGM) const override {
68 const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D);
69 if (!FD) return;
70 llvm::Function *Fn = cast<llvm::Function>(GV);
71
72 if (FD->hasAttr<MipsLongCallAttr>())
73 Fn->addFnAttr("long-call");
74 else if (FD->hasAttr<MipsShortCallAttr>())
75 Fn->addFnAttr("short-call");
76
77 // Other attributes do not have a meaning for declarations.
78 if (GV->isDeclaration())
79 return;
80
81 if (FD->hasAttr<Mips16Attr>()) {
82 Fn->addFnAttr("mips16");
83 }
84 else if (FD->hasAttr<NoMips16Attr>()) {
85 Fn->addFnAttr("nomips16");
86 }
87
88 if (FD->hasAttr<MicroMipsAttr>())
89 Fn->addFnAttr("micromips");
90 else if (FD->hasAttr<NoMicroMipsAttr>())
91 Fn->addFnAttr("nomicromips");
92
93 const MipsInterruptAttr *Attr = FD->getAttr<MipsInterruptAttr>();
94 if (!Attr)
95 return;
96
97 const char *Kind;
98 switch (Attr->getInterrupt()) {
99 case MipsInterruptAttr::eic: Kind = "eic"; break;
100 case MipsInterruptAttr::sw0: Kind = "sw0"; break;
101 case MipsInterruptAttr::sw1: Kind = "sw1"; break;
102 case MipsInterruptAttr::hw0: Kind = "hw0"; break;
103 case MipsInterruptAttr::hw1: Kind = "hw1"; break;
104 case MipsInterruptAttr::hw2: Kind = "hw2"; break;
105 case MipsInterruptAttr::hw3: Kind = "hw3"; break;
106 case MipsInterruptAttr::hw4: Kind = "hw4"; break;
107 case MipsInterruptAttr::hw5: Kind = "hw5"; break;
108 }
109
110 Fn->addFnAttr("interrupt", Kind);
111
112 }
113
114 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
115 llvm::Value *Address) const override;
116
117 unsigned getSizeOfUnwindException() const override {
118 return SizeOfUnwindException;
119 }
120};
121
122class WindowsMIPSTargetCodeGenInfo : public MIPSTargetCodeGenInfo {
123public:
124 WindowsMIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32)
125 : MIPSTargetCodeGenInfo(CGT, IsO32) {}
126
127 void getDependentLibraryOption(llvm::StringRef Lib,
128 llvm::SmallString<24> &Opt) const override {
129 Opt = "/DEFAULTLIB:";
130 Opt += qualifyWindowsLibrary(Lib);
131 }
132
133 void getDetectMismatchOption(llvm::StringRef Name, llvm::StringRef Value,
134 llvm::SmallString<32> &Opt) const override {
135 Opt = "/FAILIFMISMATCH:\"" + Name.str() + "=" + Value.str() + "\"";
136 }
137};
138}
139
140void MipsABIInfo::CoerceToIntArgs(
141 uint64_t TySize, SmallVectorImpl<llvm::Type *> &ArgList) const {
142 llvm::IntegerType *IntTy =
143 llvm::IntegerType::get(getVMContext(), MinABIStackAlignInBytes * 8);
144
145 // Add (TySize / MinABIStackAlignInBytes) args of IntTy.
146 for (unsigned N = TySize / (MinABIStackAlignInBytes * 8); N; --N)
147 ArgList.push_back(IntTy);
148
149 // If necessary, add one more integer type to ArgList.
150 unsigned R = TySize % (MinABIStackAlignInBytes * 8);
151
152 if (R)
153 ArgList.push_back(llvm::IntegerType::get(getVMContext(), R));
154}
155
156// In N32/64, an aligned double precision floating point field is passed in
157// a register.
158llvm::Type *MipsABIInfo::HandleAggregates(QualType Ty, uint64_t TySize,
159 bool ComplexFitsInFPRs) const {
160 SmallVector<llvm::Type*, 8> ArgList, IntArgList;
161
162 if (IsO32) {
163 CoerceToIntArgs(TySize, ArgList);
164 return llvm::StructType::get(getVMContext(), ArgList);
165 }
166
167 // A `_Complex` value that stays in FPRs is passed as its two parts.
168 // When that does not fit, it is passed like an integer of the same size.
169 if (Ty->isComplexType()) {
170 if (ComplexFitsInFPRs)
171 return CGT.ConvertType(Ty);
172
173 CoerceToIntArgs(TySize, ArgList);
174 return llvm::StructType::get(getVMContext(), ArgList);
175 }
176
177 const RecordType *RT = Ty->getAsCanonical<RecordType>();
178
179 // Unions/vectors are passed in integer registers.
180 if (!RT || !RT->isStructureOrClassType()) {
181 CoerceToIntArgs(TySize, ArgList);
182 return llvm::StructType::get(getVMContext(), ArgList);
183 }
184
185 const RecordDecl *RD = RT->getDecl()->getDefinitionOrSelf();
186 const ASTRecordLayout &Layout = getContext().getASTRecordLayout(RD);
187 assert(!(TySize % 8) && "Size of structure must be multiple of 8.");
188
189 uint64_t LastOffset = 0;
190 unsigned idx = 0;
191 llvm::IntegerType *I64 = llvm::IntegerType::get(getVMContext(), 64);
192
193 // Iterate over fields in the struct/class and check if there are any aligned
194 // double fields.
195 for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end();
196 i != e; ++i, ++idx) {
197 const QualType Ty = i->getType();
198 const BuiltinType *BT = Ty->getAs<BuiltinType>();
199
200 if (!BT || BT->getKind() != BuiltinType::Double)
201 continue;
202
203 uint64_t Offset = Layout.getFieldOffset(idx);
204 if (Offset % 64) // Ignore doubles that are not aligned.
205 continue;
206
207 // Add ((Offset - LastOffset) / 64) args of type i64.
208 for (unsigned j = (Offset - LastOffset) / 64; j > 0; --j)
209 ArgList.push_back(I64);
210
211 // Add double type.
212 ArgList.push_back(llvm::Type::getDoubleTy(getVMContext()));
213 LastOffset = Offset + 64;
214 }
215
216 CoerceToIntArgs(TySize - LastOffset, IntArgList);
217 ArgList.append(IntArgList.begin(), IntArgList.end());
218
219 return llvm::StructType::get(getVMContext(), ArgList);
220}
221
222llvm::Type *MipsABIInfo::getPaddingType(uint64_t OrigOffset,
223 uint64_t Offset) const {
224 if (OrigOffset + MinABIStackAlignInBytes > Offset)
225 return nullptr;
226
227 return llvm::IntegerType::get(getVMContext(), (Offset - OrigOffset) * 8);
228}
229
230ABIArgInfo
231MipsABIInfo::classifyArgumentType(QualType Ty, uint64_t &Offset) const {
233
234 uint64_t OrigOffset = Offset;
235 uint64_t TySize = getContext().getTypeSize(Ty);
236 uint64_t Align = getContext().getTypeAlign(Ty) / 8;
237
238 Align = std::clamp(Align, (uint64_t)MinABIStackAlignInBytes,
239 (uint64_t)StackAlignInBytes);
240 unsigned CurrOffset = llvm::alignTo(Offset, Align);
241 Offset = CurrOffset + llvm::alignTo(TySize, Align * 8) / 8;
242
243 // Only pass _Complex float and _Complex double in FPRs when there are 2 free
244 // slots, otherwise use GPRs (or the stack).
245 //
246 // _Complex long double never uses GPRs. Its parts are an FPR pair each,
247 // so passing them as they are puts each part in a pair and spills to
248 // the stack the parts that don't fit.
249 bool ComplexFitsInFPRs = true;
250 if (!IsO32 && Ty->isComplexType() && isComplexGnuABI() && TySize < 256) {
251 unsigned NumArgSlots = 8;
252 uint64_t SlotsUsed = CurrOffset / MinABIStackAlignInBytes;
253 if (SlotsUsed + 2 <= NumArgSlots)
254 // Claim 2 slots. Only a `_Complex float` needs this,
255 // a `_Complex double` is already two slots.
256 Offset = CurrOffset + 2 * MinABIStackAlignInBytes;
257 else
258 // Pass like an integer of the same size, packing both parts into GPRs
259 // (or the stack).
260 ComplexFitsInFPRs = false;
261 }
262
263 if (isAggregateTypeForABI(Ty) || Ty->isVectorType()) {
264 // Ignore empty aggregates.
265 if (TySize == 0)
266 return ABIArgInfo::getIgnore();
267
268 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) {
269 Offset = OrigOffset + MinABIStackAlignInBytes;
270 return getNaturalAlignIndirect(Ty, getDataLayout().getAllocaAddrSpace(),
272 }
273
274 // If we have reached here, aggregates are passed directly by coercing to
275 // another structure type. Padding is inserted if the offset of the
276 // aggregate is unaligned.
277 ABIArgInfo ArgInfo =
278 ABIArgInfo::getDirect(HandleAggregates(Ty, TySize, ComplexFitsInFPRs),
279 0, getPaddingType(OrigOffset, CurrOffset));
280 ArgInfo.setInReg(true);
281 return ArgInfo;
282 }
283
284 // Treat an enum type as its underlying type.
285 if (const auto *ED = Ty->getAsEnumDecl())
286 Ty = ED->getIntegerType();
287
288 // Make sure we pass indirectly things that are too large.
289 if (const auto *EIT = Ty->getAs<BitIntType>())
290 if (EIT->getNumBits() > 128 ||
291 (EIT->getNumBits() > 64 &&
292 !getContext().getTargetInfo().hasInt128Type()))
293 return getNaturalAlignIndirect(Ty, getDataLayout().getAllocaAddrSpace());
294
295 // All integral types are promoted to the GPR width.
297 return extendType(Ty);
298
300 nullptr, 0, IsO32 ? nullptr : getPaddingType(OrigOffset, CurrOffset));
301}
302
303llvm::Type*
304MipsABIInfo::returnAggregateInRegs(QualType RetTy, uint64_t Size) const {
305 const RecordType *RT = RetTy->getAsCanonical<RecordType>();
306 SmallVector<llvm::Type*, 8> RTList;
307
308 if (RT && RT->isStructureOrClassType()) {
309 const RecordDecl *RD = RT->getDecl()->getDefinitionOrSelf();
310 const ASTRecordLayout &Layout = getContext().getASTRecordLayout(RD);
311 unsigned FieldCnt = Layout.getFieldCount();
312
313 // N32/64 returns struct/classes in floating point registers if the
314 // following conditions are met:
315 // 1. The size of the struct/class is no larger than 128-bit.
316 // 2. The struct/class has one or two fields all of which are floating
317 // point types.
318 // 3. The offset of the first field is zero (this follows what gcc does).
319 //
320 // Any other composite results are returned in integer registers.
321 //
322 if (FieldCnt && (FieldCnt <= 2) && !Layout.getFieldOffset(0)) {
324 for (; b != e; ++b) {
325 const BuiltinType *BT = b->getType()->getAs<BuiltinType>();
326
327 if (!BT || !BT->isFloatingPoint())
328 break;
329
330 RTList.push_back(CGT.ConvertType(b->getType()));
331 }
332
333 if (b == e)
334 return llvm::StructType::get(getVMContext(), RTList,
335 RD->hasAttr<PackedAttr>());
336
337 RTList.clear();
338 }
339 }
340
341 CoerceToIntArgs(Size, RTList);
342 return llvm::StructType::get(getVMContext(), RTList);
343}
344
345ABIArgInfo MipsABIInfo::classifyComplexReturnType(QualType RetTy,
346 uint64_t Size) const {
347 // A `_Complex` value with a floating-point element type is returned in FPRs,
348 // `_Complex long long` is returned in 2 GPRs. For older ABI versions all
349 // `_Complex {integer}` types are returned in 2 GPRs.
350 uint64_t RegisterWidth = MinABIStackAlignInBytes * 8;
351 if (!isComplexGnuABI() || RetTy->isFloatingType() || Size > RegisterWidth)
352 return ABIArgInfo::getDirect();
353
354 // Match GCC for `_Complex int`, `_Complex short` and `_Complex char` by
355 // packing the real and imaginary field into one GPR.
356 return ABIArgInfo::getDirect(llvm::IntegerType::get(getVMContext(), Size));
357}
358
359ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const {
360 uint64_t Size = getContext().getTypeSize(RetTy);
361
362 if (RetTy->isVoidType())
363 return ABIArgInfo::getIgnore();
364
365 // O32 doesn't treat zero-sized structs differently from other structs.
366 // However, N32/N64 ignores zero sized return values.
367 if (!IsO32 && Size == 0)
368 return ABIArgInfo::getIgnore();
369
370 if (isAggregateTypeForABI(RetTy) || RetTy->isVectorType()) {
371 if (Size <= 128) {
372 if (RetTy->isAnyComplexType())
373 return classifyComplexReturnType(RetTy, Size);
374
375 // O32 returns integer vectors in registers and N32/N64 returns all small
376 // aggregates in registers.
377 if (!IsO32 ||
378 (RetTy->isVectorType() && !RetTy->hasFloatingRepresentation())) {
379 ABIArgInfo ArgInfo =
380 ABIArgInfo::getDirect(returnAggregateInRegs(RetTy, Size));
381 ArgInfo.setInReg(true);
382 return ArgInfo;
383 }
384 }
385
386 return getNaturalAlignIndirect(RetTy, getDataLayout().getAllocaAddrSpace());
387 }
388
389 // Treat an enum type as its underlying type.
390 if (const auto *ED = RetTy->getAsEnumDecl())
391 RetTy = ED->getIntegerType();
392
393 // Make sure we pass indirectly things that are too large.
394 if (const auto *EIT = RetTy->getAs<BitIntType>())
395 if (EIT->getNumBits() > 128 ||
396 (EIT->getNumBits() > 64 &&
397 !getContext().getTargetInfo().hasInt128Type()))
398 return getNaturalAlignIndirect(RetTy,
399 getDataLayout().getAllocaAddrSpace());
400
401 if (isPromotableIntegerTypeForABI(RetTy))
402 return ABIArgInfo::getExtend(RetTy);
403
405 RetTy->isSignedIntegerOrEnumerationType()) && Size == 32 && !IsO32)
406 return ABIArgInfo::getSignExtend(RetTy);
407
408 return ABIArgInfo::getDirect();
409}
410
411void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const {
412 ABIArgInfo &RetInfo = FI.getReturnInfo();
413 if (!getCXXABI().classifyReturnType(FI))
414 RetInfo = classifyReturnType(FI.getReturnType());
415
416 // Check if a pointer to an aggregate is passed as a hidden argument.
417 uint64_t Offset = RetInfo.isIndirect() ? MinABIStackAlignInBytes : 0;
418
419 for (auto &I : FI.arguments())
420 I.info = classifyArgumentType(I.type, Offset);
421}
422
423RValue MipsABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
424 QualType OrigTy, AggValueSlot Slot) const {
425 QualType Ty = OrigTy;
426
427 // Integer arguments are promoted to 32-bit on O32 and 64-bit on N32/N64.
428 // Pointers are also promoted in the same way but this only matters for N32.
429 unsigned SlotSizeInBits = IsO32 ? 32 : 64;
430 unsigned PtrWidth = getTarget().getPointerWidth(LangAS::Default);
431 bool DidPromote = false;
432 if ((Ty->isIntegerType() &&
433 getContext().getIntWidth(Ty) < SlotSizeInBits) ||
434 (Ty->isPointerType() && PtrWidth < SlotSizeInBits)) {
435 DidPromote = true;
436 Ty = getContext().getIntTypeForBitwidth(SlotSizeInBits,
437 Ty->isSignedIntegerType());
438 }
439
440 auto TyInfo = getContext().getTypeInfoInChars(Ty);
441
442 // The alignment of things in the argument area is never larger than
443 // StackAlignInBytes.
444 TyInfo.Align =
445 std::min(TyInfo.Align, CharUnits::fromQuantity(StackAlignInBytes));
446
447 // MinABIStackAlignInBytes is the size of argument slots on the stack.
448 CharUnits ArgSlotSize = CharUnits::fromQuantity(MinABIStackAlignInBytes);
449
450 RValue Res = emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, TyInfo,
451 ArgSlotSize, /*AllowHigherAlign*/ true, Slot);
452
453 // If there was a promotion, "unpromote".
454 // TODO: can we just use a pointer into a subset of the original slot?
455 if (DidPromote) {
456 llvm::Type *ValTy = CGF.ConvertType(OrigTy);
457 llvm::Value *Promoted = Res.getScalarVal();
458
459 // Truncate down to the right width.
460 llvm::Type *IntTy = (OrigTy->isIntegerType() ? ValTy : CGF.IntPtrTy);
461 llvm::Value *V = CGF.Builder.CreateTrunc(Promoted, IntTy);
462 if (OrigTy->isPointerType())
463 V = CGF.Builder.CreateIntToPtr(V, ValTy);
464
465 return RValue::get(V);
466 }
467
468 return Res;
469}
470
471ABIArgInfo MipsABIInfo::extendType(QualType Ty) const {
472 int TySize = getContext().getTypeSize(Ty);
473
474 // MIPS64 ABI requires unsigned 32 bit integers to be sign extended.
475 if (Ty->isUnsignedIntegerOrEnumerationType() && TySize == 32)
476 return ABIArgInfo::getSignExtend(Ty);
477
478 return ABIArgInfo::getExtend(Ty);
479}
480
481bool
482MIPSTargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
483 llvm::Value *Address) const {
484 // This information comes from gcc's implementation, which seems to
485 // as canonical as it gets.
486
487 // Everything on MIPS is 4 bytes. Double-precision FP registers
488 // are aliased to pairs of single-precision FP registers.
489 llvm::Value *Four8 = llvm::ConstantInt::get(CGF.Int8Ty, 4);
490
491 // 0-31 are the general purpose registers, $0 - $31.
492 // 32-63 are the floating-point registers, $f0 - $f31.
493 // 64 and 65 are the multiply/divide registers, $hi and $lo.
494 // 66 is the (notional, I think) register for signal-handler return.
495 AssignToArrayRange(CGF.Builder, Address, Four8, 0, 65);
496
497 // 67-74 are the floating-point status registers, $fcc0 - $fcc7.
498 // They are one bit wide and ignored here.
499
500 // 80-111 are the coprocessor 0 registers, $c0r0 - $c0r31.
501 // (coprocessor 1 is the FP unit)
502 // 112-143 are the coprocessor 2 registers, $c2r0 - $c2r31.
503 // 144-175 are the coprocessor 3 registers, $c3r0 - $c3r31.
504 // 176-181 are the DSP accumulator registers.
505 AssignToArrayRange(CGF.Builder, Address, Four8, 80, 181);
506 return false;
507}
508
509std::unique_ptr<TargetCodeGenInfo>
511 return std::make_unique<MIPSTargetCodeGenInfo>(CGM.getTypes(), IsOS32);
512}
513
514std::unique_ptr<TargetCodeGenInfo>
516 return std::make_unique<WindowsMIPSTargetCodeGenInfo>(CGM.getTypes(), IsOS32);
517}
#define V(N, I)
unsigned getFieldCount() const
getFieldCount - Get the number of fields in the layout.
uint64_t getFieldOffset(unsigned FieldNo) const
getFieldOffset - Get the offset of the given field index, in bits.
bool isFloatingPoint() const
Definition TypeBase.h:3302
Kind getKind() const
Definition TypeBase.h:3277
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
Definition CharUnits.h:63
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:49
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
CanQualType getReturnType() const
MutableArrayRef< ArgInfo > arguments()
llvm::Type * ConvertType(QualType T)
This class organizes the cross-function state that is used while generating LLVM code.
static RValue get(llvm::Value *V)
Definition CGValue.h:99
llvm::Value * getScalarVal() const
getScalarVal() - Return the Value* of this scalar value.
Definition CGValue.h:72
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
Definition TargetInfo.h:50
T * getAttr() const
Definition DeclBase.h:581
bool hasAttr() const
Definition DeclBase.h:585
field_iterator field_end() const
Definition Decl.h:4575
specific_decl_iterator< FieldDecl > field_iterator
Definition Decl.h:4569
RecordDecl * getDefinitionOrSelf() const
Definition Decl.h:4557
field_iterator field_begin() const
Definition Decl.cpp:5275
bool isVoidType() const
Definition TypeBase.h:9092
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
Definition Type.cpp:2293
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition Type.cpp:2270
bool isComplexType() const
isComplexType() does not include complex integers (a GCC extension).
Definition Type.cpp:761
bool isUnsignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is unsigned or an enumeration types whose underlying ...
Definition Type.cpp:2359
bool isPointerType() const
Definition TypeBase.h:8726
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
Definition TypeBase.h:9136
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
Definition TypeBase.h:9214
bool isAnyComplexType() const
Definition TypeBase.h:8861
EnumDecl * getAsEnumDecl() const
Retrieves the EnumDecl this type refers to.
Definition Type.h:53
bool hasFloatingRepresentation() const
Determine whether this type has a floating-point representation of some sort, e.g....
Definition Type.cpp:2401
bool isVectorType() const
Definition TypeBase.h:8865
const T * getAsCanonical() const
If this type is canonically the specified type, return its canonical type cast to that specified type...
Definition TypeBase.h:2986
bool isFloatingType() const
Definition Type.cpp:2393
const T * getAs() const
Member-template getAs<specific type>'.
Definition TypeBase.h:9319
ABIArgInfo classifyArgumentType(CodeGenModule &CGM, CanQualType type)
Classify the rules for how to pass a particular type.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
Definition CGValue.h:146
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:510
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)
std::unique_ptr< TargetCodeGenInfo > createWindowsMIPSTargetCodeGenInfo(CodeGenModule &CGM, bool IsOS32)
Definition Mips.cpp:515
void AssignToArrayRange(CodeGen::CGBuilderTy &Builder, llvm::Value *Array, llvm::Value *Value, unsigned FirstIndex, unsigned LastIndex)
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.
U cast(CodeGen::Address addr)
Definition Address.h:327
unsigned long uint64_t
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64