clang  14.0.0git
CGFunctionInfo.h
Go to the documentation of this file.
1 //==-- CGFunctionInfo.h - Representation of function argument/return types -==//
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 // Defines CGFunctionInfo and associated types used in representing the
10 // LLVM source types and ABI-coerced types for function arguments and
11 // return values.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_CODEGEN_CGFUNCTIONINFO_H
16 #define LLVM_CLANG_CODEGEN_CGFUNCTIONINFO_H
17 
19 #include "clang/AST/CharUnits.h"
20 #include "clang/AST/Decl.h"
21 #include "clang/AST/Type.h"
22 #include "llvm/IR/DerivedTypes.h"
23 #include "llvm/ADT/FoldingSet.h"
24 #include "llvm/Support/TrailingObjects.h"
25 #include <cassert>
26 
27 namespace clang {
28 namespace CodeGen {
29 
30 /// ABIArgInfo - Helper class to encapsulate information about how a
31 /// specific C type should be passed to or returned from a function.
32 class ABIArgInfo {
33 public:
34  enum Kind : uint8_t {
35  /// Direct - Pass the argument directly using the normal converted LLVM
36  /// type, or by coercing to another specified type stored in
37  /// 'CoerceToType'). If an offset is specified (in UIntData), then the
38  /// argument passed is offset by some number of bytes in the memory
39  /// representation. A dummy argument is emitted before the real argument
40  /// if the specified type stored in "PaddingType" is not zero.
42 
43  /// Extend - Valid only for integer argument types. Same as 'direct'
44  /// but also emit a zero/sign extension attribute.
46 
47  /// Indirect - Pass the argument indirectly via a hidden pointer with the
48  /// specified alignment (0 indicates default alignment) and address space.
50 
51  /// IndirectAliased - Similar to Indirect, but the pointer may be to an
52  /// object that is otherwise referenced. The object is known to not be
53  /// modified through any other references for the duration of the call, and
54  /// the callee must not itself modify the object. Because C allows
55  /// parameter variables to be modified and guarantees that they have unique
56  /// addresses, the callee must defensively copy the object into a local
57  /// variable if it might be modified or its address might be compared.
58  /// Since those are uncommon, in principle this convention allows programs
59  /// to avoid copies in more situations. However, it may introduce *extra*
60  /// copies if the callee fails to prove that a copy is unnecessary and the
61  /// caller naturally produces an unaliased object for the argument.
63 
64  /// Ignore - Ignore the argument (treat as void). Useful for void and
65  /// empty structs.
67 
68  /// Expand - Only valid for aggregate argument types. The structure should
69  /// be expanded into consecutive arguments for its constituent fields.
70  /// Currently expand is only allowed on structures whose fields
71  /// are all scalar types or are themselves expandable types.
73 
74  /// CoerceAndExpand - Only valid for aggregate argument types. The
75  /// structure should be expanded into consecutive arguments corresponding
76  /// to the non-array elements of the type stored in CoerceToType.
77  /// Array elements in the type are assumed to be padding and skipped.
79 
80  /// InAlloca - Pass the argument directly using the LLVM inalloca attribute.
81  /// This is similar to indirect with byval, except it only applies to
82  /// arguments stored in memory and forbids any implicit copies. When
83  /// applied to a return type, it means the value is returned indirectly via
84  /// an implicit sret parameter stored in the argument struct.
88  };
89 
90 private:
91  llvm::Type *TypeData; // canHaveCoerceToType()
92  union {
93  llvm::Type *PaddingType; // canHavePaddingType()
94  llvm::Type *UnpaddedCoerceAndExpandType; // isCoerceAndExpand()
95  };
96  struct DirectAttrInfo {
97  unsigned Offset;
98  unsigned Align;
99  };
100  struct IndirectAttrInfo {
101  unsigned Align;
102  unsigned AddrSpace;
103  };
104  union {
105  DirectAttrInfo DirectAttr; // isDirect() || isExtend()
106  IndirectAttrInfo IndirectAttr; // isIndirect()
107  unsigned AllocaFieldIndex; // isInAlloca()
108  };
109  Kind TheKind;
110  bool PaddingInReg : 1;
111  bool InAllocaSRet : 1; // isInAlloca()
112  bool InAllocaIndirect : 1;// isInAlloca()
113  bool IndirectByVal : 1; // isIndirect()
114  bool IndirectRealign : 1; // isIndirect()
115  bool SRetAfterThis : 1; // isIndirect()
116  bool InReg : 1; // isDirect() || isExtend() || isIndirect()
117  bool CanBeFlattened: 1; // isDirect()
118  bool SignExt : 1; // isExtend()
119 
120  bool canHavePaddingType() const {
121  return isDirect() || isExtend() || isIndirect() || isIndirectAliased() ||
122  isExpand();
123  }
124  void setPaddingType(llvm::Type *T) {
125  assert(canHavePaddingType());
126  PaddingType = T;
127  }
128 
129  void setUnpaddedCoerceToType(llvm::Type *T) {
130  assert(isCoerceAndExpand());
132  }
133 
134 public:
136  : TypeData(nullptr), PaddingType(nullptr), DirectAttr{0, 0}, TheKind(K),
137  PaddingInReg(false), InAllocaSRet(false),
138  InAllocaIndirect(false), IndirectByVal(false), IndirectRealign(false),
139  SRetAfterThis(false), InReg(false), CanBeFlattened(false),
140  SignExt(false) {}
141 
142  static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0,
143  llvm::Type *Padding = nullptr,
144  bool CanBeFlattened = true, unsigned Align = 0) {
145  auto AI = ABIArgInfo(Direct);
146  AI.setCoerceToType(T);
147  AI.setPaddingType(Padding);
148  AI.setDirectOffset(Offset);
149  AI.setDirectAlign(Align);
150  AI.setCanBeFlattened(CanBeFlattened);
151  return AI;
152  }
153  static ABIArgInfo getDirectInReg(llvm::Type *T = nullptr) {
154  auto AI = getDirect(T);
155  AI.setInReg(true);
156  return AI;
157  }
158 
159  static ABIArgInfo getSignExtend(QualType Ty, llvm::Type *T = nullptr) {
160  assert(Ty->isIntegralOrEnumerationType() && "Unexpected QualType");
161  auto AI = ABIArgInfo(Extend);
162  AI.setCoerceToType(T);
163  AI.setPaddingType(nullptr);
164  AI.setDirectOffset(0);
165  AI.setDirectAlign(0);
166  AI.setSignExt(true);
167  return AI;
168  }
169 
170  static ABIArgInfo getZeroExtend(QualType Ty, llvm::Type *T = nullptr) {
171  assert(Ty->isIntegralOrEnumerationType() && "Unexpected QualType");
172  auto AI = ABIArgInfo(Extend);
173  AI.setCoerceToType(T);
174  AI.setPaddingType(nullptr);
175  AI.setDirectOffset(0);
176  AI.setDirectAlign(0);
177  AI.setSignExt(false);
178  return AI;
179  }
180 
181  // ABIArgInfo will record the argument as being extended based on the sign
182  // of its type.
183  static ABIArgInfo getExtend(QualType Ty, llvm::Type *T = nullptr) {
184  assert(Ty->isIntegralOrEnumerationType() && "Unexpected QualType");
186  return getSignExtend(Ty, T);
187  return getZeroExtend(Ty, T);
188  }
189 
190  static ABIArgInfo getExtendInReg(QualType Ty, llvm::Type *T = nullptr) {
191  auto AI = getExtend(Ty, T);
192  AI.setInReg(true);
193  return AI;
194  }
196  return ABIArgInfo(Ignore);
197  }
198  static ABIArgInfo getIndirect(CharUnits Alignment, bool ByVal = true,
199  bool Realign = false,
200  llvm::Type *Padding = nullptr) {
201  auto AI = ABIArgInfo(Indirect);
202  AI.setIndirectAlign(Alignment);
203  AI.setIndirectByVal(ByVal);
204  AI.setIndirectRealign(Realign);
205  AI.setSRetAfterThis(false);
206  AI.setPaddingType(Padding);
207  return AI;
208  }
209 
210  /// Pass this in memory using the IR byref attribute.
211  static ABIArgInfo getIndirectAliased(CharUnits Alignment, unsigned AddrSpace,
212  bool Realign = false,
213  llvm::Type *Padding = nullptr) {
214  auto AI = ABIArgInfo(IndirectAliased);
215  AI.setIndirectAlign(Alignment);
216  AI.setIndirectRealign(Realign);
217  AI.setPaddingType(Padding);
218  AI.setIndirectAddrSpace(AddrSpace);
219  return AI;
220  }
221 
222  static ABIArgInfo getIndirectInReg(CharUnits Alignment, bool ByVal = true,
223  bool Realign = false) {
224  auto AI = getIndirect(Alignment, ByVal, Realign);
225  AI.setInReg(true);
226  return AI;
227  }
228  static ABIArgInfo getInAlloca(unsigned FieldIndex, bool Indirect = false) {
229  auto AI = ABIArgInfo(InAlloca);
230  AI.setInAllocaFieldIndex(FieldIndex);
231  AI.setInAllocaIndirect(Indirect);
232  return AI;
233  }
235  auto AI = ABIArgInfo(Expand);
236  AI.setPaddingType(nullptr);
237  return AI;
238  }
239  static ABIArgInfo getExpandWithPadding(bool PaddingInReg,
240  llvm::Type *Padding) {
241  auto AI = getExpand();
242  AI.setPaddingInReg(PaddingInReg);
243  AI.setPaddingType(Padding);
244  return AI;
245  }
246 
247  /// \param unpaddedCoerceToType The coerce-to type with padding elements
248  /// removed, canonicalized to a single element if it would otherwise
249  /// have exactly one element.
250  static ABIArgInfo getCoerceAndExpand(llvm::StructType *coerceToType,
251  llvm::Type *unpaddedCoerceToType) {
252 #ifndef NDEBUG
253  // Sanity checks on unpaddedCoerceToType.
254 
255  // Assert that we only have a struct type if there are multiple elements.
256  auto unpaddedStruct = dyn_cast<llvm::StructType>(unpaddedCoerceToType);
257  assert(!unpaddedStruct || unpaddedStruct->getNumElements() != 1);
258 
259  // Assert that all the non-padding elements have a corresponding element
260  // in the unpadded type.
261  unsigned unpaddedIndex = 0;
262  for (auto eltType : coerceToType->elements()) {
263  if (isPaddingForCoerceAndExpand(eltType)) continue;
264  if (unpaddedStruct) {
265  assert(unpaddedStruct->getElementType(unpaddedIndex) == eltType);
266  } else {
267  assert(unpaddedIndex == 0 && unpaddedCoerceToType == eltType);
268  }
269  unpaddedIndex++;
270  }
271 
272  // Assert that there aren't extra elements in the unpadded type.
273  if (unpaddedStruct) {
274  assert(unpaddedStruct->getNumElements() == unpaddedIndex);
275  } else {
276  assert(unpaddedIndex == 1);
277  }
278 #endif
279 
280  auto AI = ABIArgInfo(CoerceAndExpand);
281  AI.setCoerceToType(coerceToType);
282  AI.setUnpaddedCoerceToType(unpaddedCoerceToType);
283  return AI;
284  }
285 
286  static bool isPaddingForCoerceAndExpand(llvm::Type *eltType) {
287  if (eltType->isArrayTy()) {
288  assert(eltType->getArrayElementType()->isIntegerTy(8));
289  return true;
290  } else {
291  return false;
292  }
293  }
294 
295  Kind getKind() const { return TheKind; }
296  bool isDirect() const { return TheKind == Direct; }
297  bool isInAlloca() const { return TheKind == InAlloca; }
298  bool isExtend() const { return TheKind == Extend; }
299  bool isIgnore() const { return TheKind == Ignore; }
300  bool isIndirect() const { return TheKind == Indirect; }
301  bool isIndirectAliased() const { return TheKind == IndirectAliased; }
302  bool isExpand() const { return TheKind == Expand; }
303  bool isCoerceAndExpand() const { return TheKind == CoerceAndExpand; }
304 
305  bool canHaveCoerceToType() const {
306  return isDirect() || isExtend() || isCoerceAndExpand();
307  }
308 
309  // Direct/Extend accessors
310  unsigned getDirectOffset() const {
311  assert((isDirect() || isExtend()) && "Not a direct or extend kind");
312  return DirectAttr.Offset;
313  }
314  void setDirectOffset(unsigned Offset) {
315  assert((isDirect() || isExtend()) && "Not a direct or extend kind");
316  DirectAttr.Offset = Offset;
317  }
318 
319  unsigned getDirectAlign() const {
320  assert((isDirect() || isExtend()) && "Not a direct or extend kind");
321  return DirectAttr.Align;
322  }
323  void setDirectAlign(unsigned Align) {
324  assert((isDirect() || isExtend()) && "Not a direct or extend kind");
325  DirectAttr.Align = Align;
326  }
327 
328  bool isSignExt() const {
329  assert(isExtend() && "Invalid kind!");
330  return SignExt;
331  }
332  void setSignExt(bool SExt) {
333  assert(isExtend() && "Invalid kind!");
334  SignExt = SExt;
335  }
336 
337  llvm::Type *getPaddingType() const {
338  return (canHavePaddingType() ? PaddingType : nullptr);
339  }
340 
341  bool getPaddingInReg() const {
342  return PaddingInReg;
343  }
344  void setPaddingInReg(bool PIR) {
345  PaddingInReg = PIR;
346  }
347 
348  llvm::Type *getCoerceToType() const {
349  assert(canHaveCoerceToType() && "Invalid kind!");
350  return TypeData;
351  }
352 
353  void setCoerceToType(llvm::Type *T) {
354  assert(canHaveCoerceToType() && "Invalid kind!");
355  TypeData = T;
356  }
357 
358  llvm::StructType *getCoerceAndExpandType() const {
359  assert(isCoerceAndExpand());
360  return cast<llvm::StructType>(TypeData);
361  }
362 
363  llvm::Type *getUnpaddedCoerceAndExpandType() const {
364  assert(isCoerceAndExpand());
366  }
367 
369  assert(isCoerceAndExpand());
370  if (auto structTy =
371  dyn_cast<llvm::StructType>(UnpaddedCoerceAndExpandType)) {
372  return structTy->elements();
373  } else {
374  return llvm::makeArrayRef(&UnpaddedCoerceAndExpandType, 1);
375  }
376  }
377 
378  bool getInReg() const {
379  assert((isDirect() || isExtend() || isIndirect()) && "Invalid kind!");
380  return InReg;
381  }
382 
383  void setInReg(bool IR) {
384  assert((isDirect() || isExtend() || isIndirect()) && "Invalid kind!");
385  InReg = IR;
386  }
387 
388  // Indirect accessors
390  assert((isIndirect() || isIndirectAliased()) && "Invalid kind!");
392  }
394  assert((isIndirect() || isIndirectAliased()) && "Invalid kind!");
395  IndirectAttr.Align = IA.getQuantity();
396  }
397 
398  bool getIndirectByVal() const {
399  assert(isIndirect() && "Invalid kind!");
400  return IndirectByVal;
401  }
402  void setIndirectByVal(bool IBV) {
403  assert(isIndirect() && "Invalid kind!");
404  IndirectByVal = IBV;
405  }
406 
407  unsigned getIndirectAddrSpace() const {
408  assert(isIndirectAliased() && "Invalid kind!");
409  return IndirectAttr.AddrSpace;
410  }
411 
412  void setIndirectAddrSpace(unsigned AddrSpace) {
413  assert(isIndirectAliased() && "Invalid kind!");
414  IndirectAttr.AddrSpace = AddrSpace;
415  }
416 
417  bool getIndirectRealign() const {
418  assert((isIndirect() || isIndirectAliased()) && "Invalid kind!");
419  return IndirectRealign;
420  }
421  void setIndirectRealign(bool IR) {
422  assert((isIndirect() || isIndirectAliased()) && "Invalid kind!");
423  IndirectRealign = IR;
424  }
425 
426  bool isSRetAfterThis() const {
427  assert(isIndirect() && "Invalid kind!");
428  return SRetAfterThis;
429  }
430  void setSRetAfterThis(bool AfterThis) {
431  assert(isIndirect() && "Invalid kind!");
432  SRetAfterThis = AfterThis;
433  }
434 
435  unsigned getInAllocaFieldIndex() const {
436  assert(isInAlloca() && "Invalid kind!");
437  return AllocaFieldIndex;
438  }
439  void setInAllocaFieldIndex(unsigned FieldIndex) {
440  assert(isInAlloca() && "Invalid kind!");
441  AllocaFieldIndex = FieldIndex;
442  }
443 
444  unsigned getInAllocaIndirect() const {
445  assert(isInAlloca() && "Invalid kind!");
446  return InAllocaIndirect;
447  }
449  assert(isInAlloca() && "Invalid kind!");
450  InAllocaIndirect = Indirect;
451  }
452 
453  /// Return true if this field of an inalloca struct should be returned
454  /// to implement a struct return calling convention.
455  bool getInAllocaSRet() const {
456  assert(isInAlloca() && "Invalid kind!");
457  return InAllocaSRet;
458  }
459 
460  void setInAllocaSRet(bool SRet) {
461  assert(isInAlloca() && "Invalid kind!");
462  InAllocaSRet = SRet;
463  }
464 
465  bool getCanBeFlattened() const {
466  assert(isDirect() && "Invalid kind!");
467  return CanBeFlattened;
468  }
469 
470  void setCanBeFlattened(bool Flatten) {
471  assert(isDirect() && "Invalid kind!");
472  CanBeFlattened = Flatten;
473  }
474 
475  void dump() const;
476 };
477 
478 /// A class for recording the number of arguments that a function
479 /// signature requires.
481  /// The number of required arguments, or ~0 if the signature does
482  /// not permit optional arguments.
483  unsigned NumRequired;
484 public:
485  enum All_t { All };
486 
487  RequiredArgs(All_t _) : NumRequired(~0U) {}
488  explicit RequiredArgs(unsigned n) : NumRequired(n) {
489  assert(n != ~0U);
490  }
491 
492  /// Compute the arguments required by the given formal prototype,
493  /// given that there may be some additional, non-formal arguments
494  /// in play.
495  ///
496  /// If FD is not null, this will consider pass_object_size params in FD.
498  unsigned additional) {
499  if (!prototype->isVariadic()) return All;
500 
501  if (prototype->hasExtParameterInfos())
502  additional += llvm::count_if(
503  prototype->getExtParameterInfos(),
504  [](const FunctionProtoType::ExtParameterInfo &ExtInfo) {
505  return ExtInfo.hasPassObjectSize();
506  });
507 
508  return RequiredArgs(prototype->getNumParams() + additional);
509  }
510 
512  unsigned additional) {
513  return forPrototypePlus(prototype.getTypePtr(), additional);
514  }
515 
516  static RequiredArgs forPrototype(const FunctionProtoType *prototype) {
517  return forPrototypePlus(prototype, 0);
518  }
519 
521  return forPrototypePlus(prototype.getTypePtr(), 0);
522  }
523 
524  bool allowsOptionalArgs() const { return NumRequired != ~0U; }
525  unsigned getNumRequiredArgs() const {
526  assert(allowsOptionalArgs());
527  return NumRequired;
528  }
529 
530  unsigned getOpaqueData() const { return NumRequired; }
531  static RequiredArgs getFromOpaqueData(unsigned value) {
532  if (value == ~0U) return All;
533  return RequiredArgs(value);
534  }
535 };
536 
537 // Implementation detail of CGFunctionInfo, factored out so it can be named
538 // in the TrailingObjects base class of CGFunctionInfo.
542 };
543 
544 /// CGFunctionInfo - Class to encapsulate the information about a
545 /// function definition.
546 class CGFunctionInfo final
547  : public llvm::FoldingSetNode,
548  private llvm::TrailingObjects<CGFunctionInfo, CGFunctionInfoArgInfo,
549  FunctionProtoType::ExtParameterInfo> {
552 
553  /// The LLVM::CallingConv to use for this function (as specified by the
554  /// user).
555  unsigned CallingConvention : 8;
556 
557  /// The LLVM::CallingConv to actually use for this function, which may
558  /// depend on the ABI.
559  unsigned EffectiveCallingConvention : 8;
560 
561  /// The clang::CallingConv that this was originally created with.
562  unsigned ASTCallingConvention : 6;
563 
564  /// Whether this is an instance method.
565  unsigned InstanceMethod : 1;
566 
567  /// Whether this is a chain call.
568  unsigned ChainCall : 1;
569 
570  /// Whether this function is a CMSE nonsecure call
571  unsigned CmseNSCall : 1;
572 
573  /// Whether this function is noreturn.
574  unsigned NoReturn : 1;
575 
576  /// Whether this function is returns-retained.
577  unsigned ReturnsRetained : 1;
578 
579  /// Whether this function saved caller registers.
580  unsigned NoCallerSavedRegs : 1;
581 
582  /// How many arguments to pass inreg.
583  unsigned HasRegParm : 1;
584  unsigned RegParm : 3;
585 
586  /// Whether this function has nocf_check attribute.
587  unsigned NoCfCheck : 1;
588 
589  RequiredArgs Required;
590 
591  /// The struct representing all arguments passed in memory. Only used when
592  /// passing non-trivial types with inalloca. Not part of the profile.
593  llvm::StructType *ArgStruct;
594  unsigned ArgStructAlign : 31;
595  unsigned HasExtParameterInfos : 1;
596 
597  unsigned NumArgs;
598 
599  ArgInfo *getArgsBuffer() {
600  return getTrailingObjects<ArgInfo>();
601  }
602  const ArgInfo *getArgsBuffer() const {
603  return getTrailingObjects<ArgInfo>();
604  }
605 
606  ExtParameterInfo *getExtParameterInfosBuffer() {
607  return getTrailingObjects<ExtParameterInfo>();
608  }
609  const ExtParameterInfo *getExtParameterInfosBuffer() const{
610  return getTrailingObjects<ExtParameterInfo>();
611  }
612 
613  CGFunctionInfo() : Required(RequiredArgs::All) {}
614 
615 public:
616  static CGFunctionInfo *create(unsigned llvmCC,
617  bool instanceMethod,
618  bool chainCall,
619  const FunctionType::ExtInfo &extInfo,
620  ArrayRef<ExtParameterInfo> paramInfos,
621  CanQualType resultType,
622  ArrayRef<CanQualType> argTypes,
623  RequiredArgs required);
624  void operator delete(void *p) { ::operator delete(p); }
625 
626  // Friending class TrailingObjects is apparently not good enough for MSVC,
627  // so these have to be public.
628  friend class TrailingObjects;
629  size_t numTrailingObjects(OverloadToken<ArgInfo>) const {
630  return NumArgs + 1;
631  }
632  size_t numTrailingObjects(OverloadToken<ExtParameterInfo>) const {
633  return (HasExtParameterInfos ? NumArgs : 0);
634  }
635 
636  typedef const ArgInfo *const_arg_iterator;
638 
640  return MutableArrayRef<ArgInfo>(arg_begin(), NumArgs);
641  }
643  return ArrayRef<ArgInfo>(arg_begin(), NumArgs);
644  }
645 
646  const_arg_iterator arg_begin() const { return getArgsBuffer() + 1; }
647  const_arg_iterator arg_end() const { return getArgsBuffer() + 1 + NumArgs; }
648  arg_iterator arg_begin() { return getArgsBuffer() + 1; }
649  arg_iterator arg_end() { return getArgsBuffer() + 1 + NumArgs; }
650 
651  unsigned arg_size() const { return NumArgs; }
652 
653  bool isVariadic() const { return Required.allowsOptionalArgs(); }
654  RequiredArgs getRequiredArgs() const { return Required; }
655  unsigned getNumRequiredArgs() const {
657  }
658 
659  bool isInstanceMethod() const { return InstanceMethod; }
660 
661  bool isChainCall() const { return ChainCall; }
662 
663  bool isCmseNSCall() const { return CmseNSCall; }
664 
665  bool isNoReturn() const { return NoReturn; }
666 
667  /// In ARC, whether this function retains its return value. This
668  /// is not always reliable for call sites.
669  bool isReturnsRetained() const { return ReturnsRetained; }
670 
671  /// Whether this function no longer saves caller registers.
672  bool isNoCallerSavedRegs() const { return NoCallerSavedRegs; }
673 
674  /// Whether this function has nocf_check attribute.
675  bool isNoCfCheck() const { return NoCfCheck; }
676 
677  /// getASTCallingConvention() - Return the AST-specified calling
678  /// convention.
680  return CallingConv(ASTCallingConvention);
681  }
682 
683  /// getCallingConvention - Return the user specified calling
684  /// convention, which has been translated into an LLVM CC.
685  unsigned getCallingConvention() const { return CallingConvention; }
686 
687  /// getEffectiveCallingConvention - Return the actual calling convention to
688  /// use, which may depend on the ABI.
689  unsigned getEffectiveCallingConvention() const {
690  return EffectiveCallingConvention;
691  }
693  EffectiveCallingConvention = Value;
694  }
695 
696  bool getHasRegParm() const { return HasRegParm; }
697  unsigned getRegParm() const { return RegParm; }
698 
703  isCmseNSCall());
704  }
705 
706  CanQualType getReturnType() const { return getArgsBuffer()[0].type; }
707 
708  ABIArgInfo &getReturnInfo() { return getArgsBuffer()[0].info; }
709  const ABIArgInfo &getReturnInfo() const { return getArgsBuffer()[0].info; }
710 
712  if (!HasExtParameterInfos) return {};
713  return llvm::makeArrayRef(getExtParameterInfosBuffer(), NumArgs);
714  }
715  ExtParameterInfo getExtParameterInfo(unsigned argIndex) const {
716  assert(argIndex <= NumArgs);
717  if (!HasExtParameterInfos) return ExtParameterInfo();
718  return getExtParameterInfos()[argIndex];
719  }
720 
721  /// Return true if this function uses inalloca arguments.
722  bool usesInAlloca() const { return ArgStruct; }
723 
724  /// Get the struct type used to represent all the arguments in memory.
725  llvm::StructType *getArgStruct() const { return ArgStruct; }
727  return CharUnits::fromQuantity(ArgStructAlign);
728  }
729  void setArgStruct(llvm::StructType *Ty, CharUnits Align) {
730  ArgStruct = Ty;
731  ArgStructAlign = Align.getQuantity();
732  }
733 
734  void Profile(llvm::FoldingSetNodeID &ID) {
735  ID.AddInteger(getASTCallingConvention());
736  ID.AddBoolean(InstanceMethod);
737  ID.AddBoolean(ChainCall);
738  ID.AddBoolean(NoReturn);
739  ID.AddBoolean(ReturnsRetained);
740  ID.AddBoolean(NoCallerSavedRegs);
741  ID.AddBoolean(HasRegParm);
742  ID.AddInteger(RegParm);
743  ID.AddBoolean(NoCfCheck);
744  ID.AddBoolean(CmseNSCall);
745  ID.AddInteger(Required.getOpaqueData());
746  ID.AddBoolean(HasExtParameterInfos);
747  if (HasExtParameterInfos) {
748  for (auto paramInfo : getExtParameterInfos())
749  ID.AddInteger(paramInfo.getOpaqueValue());
750  }
752  for (const auto &I : arguments())
753  I.type.Profile(ID);
754  }
755  static void Profile(llvm::FoldingSetNodeID &ID,
756  bool InstanceMethod,
757  bool ChainCall,
758  const FunctionType::ExtInfo &info,
759  ArrayRef<ExtParameterInfo> paramInfos,
760  RequiredArgs required,
761  CanQualType resultType,
762  ArrayRef<CanQualType> argTypes) {
763  ID.AddInteger(info.getCC());
764  ID.AddBoolean(InstanceMethod);
765  ID.AddBoolean(ChainCall);
766  ID.AddBoolean(info.getNoReturn());
767  ID.AddBoolean(info.getProducesResult());
768  ID.AddBoolean(info.getNoCallerSavedRegs());
769  ID.AddBoolean(info.getHasRegParm());
770  ID.AddInteger(info.getRegParm());
771  ID.AddBoolean(info.getNoCfCheck());
772  ID.AddBoolean(info.getCmseNSCall());
773  ID.AddInteger(required.getOpaqueData());
774  ID.AddBoolean(!paramInfos.empty());
775  if (!paramInfos.empty()) {
776  for (auto paramInfo : paramInfos)
777  ID.AddInteger(paramInfo.getOpaqueValue());
778  }
779  resultType.Profile(ID);
781  i = argTypes.begin(), e = argTypes.end(); i != e; ++i) {
782  i->Profile(ID);
783  }
784  }
785 };
786 
787 } // end namespace CodeGen
788 } // end namespace clang
789 
790 #endif
clang::CodeGen::ABIArgInfo::isDirect
bool isDirect() const
Definition: CGFunctionInfo.h:296
clang::CodeGen::RequiredArgs::All_t
All_t
Definition: CGFunctionInfo.h:485
clang::CodeGen::ABIArgInfo::getCanBeFlattened
bool getCanBeFlattened() const
Definition: CGFunctionInfo.h:465
clang::CodeGen::CGFunctionInfo::arg_size
unsigned arg_size() const
Definition: CGFunctionInfo.h:651
clang::CodeGen::ABIArgInfo::getPaddingType
llvm::Type * getPaddingType() const
Definition: CGFunctionInfo.h:337
clang::CodeGen::ABIArgInfo::setIndirectRealign
void setIndirectRealign(bool IR)
Definition: CGFunctionInfo.h:421
clang::CodeGen::CGFunctionInfo::arguments
ArrayRef< ArgInfo > arguments() const
Definition: CGFunctionInfo.h:642
clang::CodeGen::ABIArgInfo::getZeroExtend
static ABIArgInfo getZeroExtend(QualType Ty, llvm::Type *T=nullptr)
Definition: CGFunctionInfo.h:170
clang::CodeGen::ABIArgInfo::KindLast
@ KindLast
Definition: CGFunctionInfo.h:87
clang::CodeGen::CGFunctionInfoArgInfo::type
CanQualType type
Definition: CGFunctionInfo.h:540
clang::CodeGen::ABIArgInfo::getKind
Kind getKind() const
Definition: CGFunctionInfo.h:295
clang::CodeGen::RequiredArgs::getOpaqueData
unsigned getOpaqueData() const
Definition: CGFunctionInfo.h:530
clang::CodeGen::ABIArgInfo::IndirectAliased
@ IndirectAliased
IndirectAliased - Similar to Indirect, but the pointer may be to an object that is otherwise referenc...
Definition: CGFunctionInfo.h:62
clang::CodeGen::ABIArgInfo::getIndirect
static ABIArgInfo getIndirect(CharUnits Alignment, bool ByVal=true, bool Realign=false, llvm::Type *Padding=nullptr)
Definition: CGFunctionInfo.h:198
clang::CodeGen::ABIArgInfo::Extend
@ Extend
Extend - Valid only for integer argument types.
Definition: CGFunctionInfo.h:45
clang::CodeGen::CGFunctionInfo::getExtParameterInfos
ArrayRef< ExtParameterInfo > getExtParameterInfos() const
Definition: CGFunctionInfo.h:711
clang::CodeGen::CGFunctionInfo::getExtInfo
FunctionType::ExtInfo getExtInfo() const
Definition: CGFunctionInfo.h:699
clang::CodeGen::RequiredArgs::forPrototypePlus
static RequiredArgs forPrototypePlus(CanQual< FunctionProtoType > prototype, unsigned additional)
Definition: CGFunctionInfo.h:511
clang::CodeGen::CGFunctionInfo::TrailingObjects
friend class TrailingObjects
Definition: CGFunctionInfo.h:628
clang::CodeGen::ABIArgInfo::getDirectInReg
static ABIArgInfo getDirectInReg(llvm::Type *T=nullptr)
Definition: CGFunctionInfo.h:153
clang::CodeGen::ABIArgInfo::getInAllocaIndirect
unsigned getInAllocaIndirect() const
Definition: CGFunctionInfo.h:444
clang::CodeGen::ABIArgInfo::getIndirectRealign
bool getIndirectRealign() const
Definition: CGFunctionInfo.h:417
clang::CodeGen::ABIArgInfo::getPaddingInReg
bool getPaddingInReg() const
Definition: CGFunctionInfo.h:341
clang::CodeGen::CGFunctionInfoArgInfo::info
ABIArgInfo info
Definition: CGFunctionInfo.h:541
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:673
clang::CodeGen::ABIArgInfo::getInAllocaSRet
bool getInAllocaSRet() const
Return true if this field of an inalloca struct should be returned to implement a struct return calli...
Definition: CGFunctionInfo.h:455
clang::CodeGen::ABIArgInfo::getInReg
bool getInReg() const
Definition: CGFunctionInfo.h:378
clang::CodeGen::CGFunctionInfo::isNoCallerSavedRegs
bool isNoCallerSavedRegs() const
Whether this function no longer saves caller registers.
Definition: CGFunctionInfo.h:672
clang::CodeGen::RequiredArgs::All
@ All
Definition: CGFunctionInfo.h:485
clang::CodeGen::CGFunctionInfo::arg_begin
const_arg_iterator arg_begin() const
Definition: CGFunctionInfo.h:646
clang::FunctionType::ExtInfo::getNoCallerSavedRegs
bool getNoCallerSavedRegs() const
Definition: Type.h:3708
clang::CodeGen::ABIArgInfo::isSRetAfterThis
bool isSRetAfterThis() const
Definition: CGFunctionInfo.h:426
clang::CodeGen::CGFunctionInfo::arg_iterator
ArgInfo * arg_iterator
Definition: CGFunctionInfo.h:637
clang::CodeGen::ABIArgInfo::isInAlloca
bool isInAlloca() const
Definition: CGFunctionInfo.h:297
clang::CodeGen::ABIArgInfo::IndirectAttr
IndirectAttrInfo IndirectAttr
Definition: CGFunctionInfo.h:106
clang::CodeGen::ABIArgInfo::Direct
@ Direct
Direct - Pass the argument directly using the normal converted LLVM type, or by coercing to another s...
Definition: CGFunctionInfo.h:41
clang::CodeGen::ABIArgInfo::KindFirst
@ KindFirst
Definition: CGFunctionInfo.h:86
clang::CodeGen::ABIArgInfo::getDirectAlign
unsigned getDirectAlign() const
Definition: CGFunctionInfo.h:319
clang::CodeGen::CGFunctionInfo::getExtParameterInfo
ExtParameterInfo getExtParameterInfo(unsigned argIndex) const
Definition: CGFunctionInfo.h:715
clang::CodeGen::CGFunctionInfo::getEffectiveCallingConvention
unsigned getEffectiveCallingConvention() const
getEffectiveCallingConvention - Return the actual calling convention to use, which may depend on the ...
Definition: CGFunctionInfo.h:689
clang::CodeGen::CGFunctionInfo::isNoReturn
bool isNoReturn() const
Definition: CGFunctionInfo.h:665
clang::CodeGen::CGFunctionInfo::isVariadic
bool isVariadic() const
Definition: CGFunctionInfo.h:653
clang::CodeGen::CGFunctionInfo::getReturnType
CanQualType getReturnType() const
Definition: CGFunctionInfo.h:706
clang::CodeGen::CGFunctionInfo::arg_begin
arg_iterator arg_begin()
Definition: CGFunctionInfo.h:648
clang::CodeGen::CGFunctionInfo::Profile
void Profile(llvm::FoldingSetNodeID &ID)
Definition: CGFunctionInfo.h:734
clang::FunctionProtoType::isVariadic
bool isVariadic() const
Whether this function prototype is variadic.
Definition: Type.h:4217
clang::CodeGen::CGFunctionInfo::arg_end
const_arg_iterator arg_end() const
Definition: CGFunctionInfo.h:647
clang::Type::hasSignedIntegerRepresentation
bool hasSignedIntegerRepresentation() const
Determine whether this type has an signed integer representation of some sort, e.g....
Definition: Type.cpp:2050
Decl.h
Offset
unsigned Offset
Definition: Format.cpp:2335
clang::CodeGen::ABIArgInfo::setIndirectAlign
void setIndirectAlign(CharUnits IA)
Definition: CGFunctionInfo.h:393
clang::CodeGen::ABIArgInfo::isExpand
bool isExpand() const
Definition: CGFunctionInfo.h:302
clang::CodeGen::CGFunctionInfo::numTrailingObjects
size_t numTrailingObjects(OverloadToken< ExtParameterInfo >) const
Definition: CGFunctionInfo.h:632
clang::CodeGen::ABIArgInfo::canHaveCoerceToType
bool canHaveCoerceToType() const
Definition: CGFunctionInfo.h:305
clang::CodeGen::ABIArgInfo::AllocaFieldIndex
unsigned AllocaFieldIndex
Definition: CGFunctionInfo.h:107
clang::CodeGen::RequiredArgs::allowsOptionalArgs
bool allowsOptionalArgs() const
Definition: CGFunctionInfo.h:524
clang::CodeGen::ABIArgInfo::setInAllocaIndirect
void setInAllocaIndirect(bool Indirect)
Definition: CGFunctionInfo.h:448
clang::CanQual::getTypePtr
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
Definition: CanonicalType.h:83
clang::CodeGen::ABIArgInfo
ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to ...
Definition: CGFunctionInfo.h:32
U
clang::CodeGen::ABIArgInfo::getExtendInReg
static ABIArgInfo getExtendInReg(QualType Ty, llvm::Type *T=nullptr)
Definition: CGFunctionInfo.h:190
clang::CodeGen::ABIArgInfo::setDirectOffset
void setDirectOffset(unsigned Offset)
Definition: CGFunctionInfo.h:314
clang::CodeGen::CGFunctionInfo::getCallingConvention
unsigned getCallingConvention() const
getCallingConvention - Return the user specified calling convention, which has been translated into a...
Definition: CGFunctionInfo.h:685
llvm::MutableArrayRef
Definition: LLVM.h:35
clang::CodeGen::ABIArgInfo::ABIArgInfo
ABIArgInfo(Kind K=Direct)
Definition: CGFunctionInfo.h:135
clang::CanQual::Profile
void Profile(llvm::FoldingSetNodeID &ID) const
Definition: CanonicalType.h:196
clang::CodeGen::ABIArgInfo::getExtend
static ABIArgInfo getExtend(QualType Ty, llvm::Type *T=nullptr)
Definition: CGFunctionInfo.h:183
clang::FunctionProtoType::hasExtParameterInfos
bool hasExtParameterInfos() const
Is there any interesting extra information for any of the parameters of this function type?
Definition: Type.h:4279
clang::FunctionType::ExtInfo::getNoReturn
bool getNoReturn() const
Definition: Type.h:3705
clang::CodeGen::CGFunctionInfo::setArgStruct
void setArgStruct(llvm::StructType *Ty, CharUnits Align)
Definition: CGFunctionInfo.h:729
clang::CharUnits::fromQuantity
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
Definition: CharUnits.h:63
clang::CodeGen::ABIArgInfo::Expand
@ Expand
Expand - Only valid for aggregate argument types.
Definition: CGFunctionInfo.h:72
clang::CodeGen::ABIArgInfo::isCoerceAndExpand
bool isCoerceAndExpand() const
Definition: CGFunctionInfo.h:303
clang::CodeGen::ABIArgInfo::setInAllocaFieldIndex
void setInAllocaFieldIndex(unsigned FieldIndex)
Definition: CGFunctionInfo.h:439
clang::CodeGen::CGFunctionInfo::isCmseNSCall
bool isCmseNSCall() const
Definition: CGFunctionInfo.h:663
clang::CodeGen::ABIArgInfo::getDirect
static ABIArgInfo getDirect(llvm::Type *T=nullptr, unsigned Offset=0, llvm::Type *Padding=nullptr, bool CanBeFlattened=true, unsigned Align=0)
Definition: CGFunctionInfo.h:142
clang::CodeGen::ABIArgInfo::InAlloca
@ InAlloca
InAlloca - Pass the argument directly using the LLVM inalloca attribute.
Definition: CGFunctionInfo.h:85
clang::CodeGen::ABIArgInfo::isPaddingForCoerceAndExpand
static bool isPaddingForCoerceAndExpand(llvm::Type *eltType)
Definition: CGFunctionInfo.h:286
clang::CodeGen::ABIArgInfo::setIndirectAddrSpace
void setIndirectAddrSpace(unsigned AddrSpace)
Definition: CGFunctionInfo.h:412
clang::CodeGen::ABIArgInfo::getIgnore
static ABIArgInfo getIgnore()
Definition: CGFunctionInfo.h:195
clang::CodeGen::CGFunctionInfo::arg_end
arg_iterator arg_end()
Definition: CGFunctionInfo.h:649
clang::CodeGen::RequiredArgs::forPrototype
static RequiredArgs forPrototype(const FunctionProtoType *prototype)
Definition: CGFunctionInfo.h:516
clang::CodeGen::ABIArgInfo::Ignore
@ Ignore
Ignore - Ignore the argument (treat as void).
Definition: CGFunctionInfo.h:66
clang::CodeGen::CGFunctionInfo::getASTCallingConvention
CallingConv getASTCallingConvention() const
getASTCallingConvention() - Return the AST-specified calling convention.
Definition: CGFunctionInfo.h:679
clang::CodeGen::ABIArgInfo::setIndirectByVal
void setIndirectByVal(bool IBV)
Definition: CGFunctionInfo.h:402
Type.h
clang::CodeGen::ABIArgInfo::setCanBeFlattened
void setCanBeFlattened(bool Flatten)
Definition: CGFunctionInfo.h:470
clang::CodeGen::RequiredArgs::RequiredArgs
RequiredArgs(unsigned n)
Definition: CGFunctionInfo.h:488
clang::CodeGen::ABIArgInfo::getSignExtend
static ABIArgInfo getSignExtend(QualType Ty, llvm::Type *T=nullptr)
Definition: CGFunctionInfo.h:159
clang::CallingConv
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition: Specifiers.h:263
clang::CodeGen::ABIArgInfo::isExtend
bool isExtend() const
Definition: CGFunctionInfo.h:298
clang::CodeGen::CGFunctionInfoArgInfo
Definition: CGFunctionInfo.h:539
clang::FunctionType::ExtInfo::getNoCfCheck
bool getNoCfCheck() const
Definition: Type.h:3709
clang::CodeGen::ABIArgInfo::Indirect
@ Indirect
Indirect - Pass the argument indirectly via a hidden pointer with the specified alignment (0 indicate...
Definition: CGFunctionInfo.h:49
clang::CanQual< FunctionProtoType >
clang::CodeGen::CGFunctionInfo::isReturnsRetained
bool isReturnsRetained() const
In ARC, whether this function retains its return value.
Definition: CGFunctionInfo.h:669
clang::CodeGen::ABIArgInfo::setSignExt
void setSignExt(bool SExt)
Definition: CGFunctionInfo.h:332
clang::CodeGen::ABIArgInfo::getCoerceAndExpand
static ABIArgInfo getCoerceAndExpand(llvm::StructType *coerceToType, llvm::Type *unpaddedCoerceToType)
Definition: CGFunctionInfo.h:250
clang::CodeGen::ABIArgInfo::isIgnore
bool isIgnore() const
Definition: CGFunctionInfo.h:299
CharUnits.h
clang::CodeGen::CGFunctionInfo::getHasRegParm
bool getHasRegParm() const
Definition: CGFunctionInfo.h:696
clang::FunctionType::ExtInfo::getCmseNSCall
bool getCmseNSCall() const
Definition: Type.h:3707
clang::CodeGen::ABIArgInfo::CoerceAndExpand
@ CoerceAndExpand
CoerceAndExpand - Only valid for aggregate argument types.
Definition: CGFunctionInfo.h:78
clang::CodeGen::ABIArgInfo::setDirectAlign
void setDirectAlign(unsigned Align)
Definition: CGFunctionInfo.h:323
clang::CodeGen::ABIArgInfo::getCoerceAndExpandTypeSequence
ArrayRef< llvm::Type * > getCoerceAndExpandTypeSequence() const
Definition: CGFunctionInfo.h:368
clang::FunctionType::ExtInfo::getHasRegParm
bool getHasRegParm() const
Definition: Type.h:3710
clang::CodeGen::ABIArgInfo::getCoerceToType
llvm::Type * getCoerceToType() const
Definition: CGFunctionInfo.h:348
clang::CodeGen::CGFunctionInfo::numTrailingObjects
size_t numTrailingObjects(OverloadToken< ArgInfo >) const
Definition: CGFunctionInfo.h:629
clang::CodeGen::RequiredArgs::RequiredArgs
RequiredArgs(All_t _)
Definition: CGFunctionInfo.h:487
clang::CodeGen::CGFunctionInfo::create
static CGFunctionInfo * create(unsigned llvmCC, bool instanceMethod, bool chainCall, const FunctionType::ExtInfo &extInfo, ArrayRef< ExtParameterInfo > paramInfos, CanQualType resultType, ArrayRef< CanQualType > argTypes, RequiredArgs required)
Definition: CGCall.cpp:800
clang::CodeGen::ABIArgInfo::getInAlloca
static ABIArgInfo getInAlloca(unsigned FieldIndex, bool Indirect=false)
Definition: CGFunctionInfo.h:228
clang::CodeGen::ABIArgInfo::getCoerceAndExpandType
llvm::StructType * getCoerceAndExpandType() const
Definition: CGFunctionInfo.h:358
clang::CodeGen::ABIArgInfo::isIndirect
bool isIndirect() const
Definition: CGFunctionInfo.h:300
clang::CodeGen::ABIArgInfo::setInAllocaSRet
void setInAllocaSRet(bool SRet)
Definition: CGFunctionInfo.h:460
clang::FunctionType::ExtInfo::getCC
CallingConv getCC() const
Definition: Type.h:3719
clang::CodeGen::ABIArgInfo::getDirectOffset
unsigned getDirectOffset() const
Definition: CGFunctionInfo.h:310
clang::CodeGen::RequiredArgs
A class for recording the number of arguments that a function signature requires.
Definition: CGFunctionInfo.h:480
clang::CodeGen::ABIArgInfo::getInAllocaFieldIndex
unsigned getInAllocaFieldIndex() const
Definition: CGFunctionInfo.h:435
clang::CodeGen::ABIArgInfo::getUnpaddedCoerceAndExpandType
llvm::Type * getUnpaddedCoerceAndExpandType() const
Definition: CGFunctionInfo.h:363
clang::FunctionProtoType
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3885
clang::CodeGen::CGFunctionInfo::isChainCall
bool isChainCall() const
Definition: CGFunctionInfo.h:661
clang::CodeGen::ABIArgInfo::getIndirectByVal
bool getIndirectByVal() const
Definition: CGFunctionInfo.h:398
clang::CodeGen::CGFunctionInfo::const_arg_iterator
const typedef ArgInfo * const_arg_iterator
Definition: CGFunctionInfo.h:636
llvm::ArrayRef
Definition: LLVM.h:34
Value
Value
Definition: UninitializedValues.cpp:102
clang::CodeGen::ABIArgInfo::setCoerceToType
void setCoerceToType(llvm::Type *T)
Definition: CGFunctionInfo.h:353
clang::FunctionType::ExtParameterInfo
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
Definition: Type.h:3572
clang::CodeGen::CGFunctionInfo::usesInAlloca
bool usesInAlloca() const
Return true if this function uses inalloca arguments.
Definition: CGFunctionInfo.h:722
clang::CodeGen::CGFunctionInfo::arguments
MutableArrayRef< ArgInfo > arguments()
Definition: CGFunctionInfo.h:639
clang::CodeGen::CGFunctionInfo::getReturnInfo
ABIArgInfo & getReturnInfo()
Definition: CGFunctionInfo.h:708
clang::CodeGen::RequiredArgs::getNumRequiredArgs
unsigned getNumRequiredArgs() const
Definition: CGFunctionInfo.h:525
clang::FunctionProtoType::getNumParams
unsigned getNumParams() const
Definition: Type.h:4095
clang::CodeGen::RequiredArgs::forPrototype
static RequiredArgs forPrototype(CanQual< FunctionProtoType > prototype)
Definition: CGFunctionInfo.h:520
clang::FunctionType::ExtInfo
A class which abstracts out some details necessary for making a call.
Definition: Type.h:3657
clang::CodeGen::ABIArgInfo::getIndirectInReg
static ABIArgInfo getIndirectInReg(CharUnits Alignment, bool ByVal=true, bool Realign=false)
Definition: CGFunctionInfo.h:222
clang::CodeGen::CGFunctionInfo::isNoCfCheck
bool isNoCfCheck() const
Whether this function has nocf_check attribute.
Definition: CGFunctionInfo.h:675
clang::CodeGen::CGFunctionInfo
CGFunctionInfo - Class to encapsulate the information about a function definition.
Definition: CGFunctionInfo.h:546
clang::CodeGen::ABIArgInfo::isIndirectAliased
bool isIndirectAliased() const
Definition: CGFunctionInfo.h:301
clang::CodeGen::ABIArgInfo::getIndirectAddrSpace
unsigned getIndirectAddrSpace() const
Definition: CGFunctionInfo.h:407
clang::CodeGen::RequiredArgs::forPrototypePlus
static RequiredArgs forPrototypePlus(const FunctionProtoType *prototype, unsigned additional)
Compute the arguments required by the given formal prototype, given that there may be some additional...
Definition: CGFunctionInfo.h:497
clang::CodeGen::CGFunctionInfo::getNumRequiredArgs
unsigned getNumRequiredArgs() const
Definition: CGFunctionInfo.h:655
clang::CodeGen::ABIArgInfo::setInReg
void setInReg(bool IR)
Definition: CGFunctionInfo.h:383
clang::CodeGen::ABIArgInfo::Kind
Kind
Definition: CGFunctionInfo.h:34
clang::FunctionType::ExtInfo::getRegParm
unsigned getRegParm() const
Definition: Type.h:3712
clang::Builtin::ID
ID
Definition: Builtins.h:48
clang::CodeGen::RequiredArgs::getFromOpaqueData
static RequiredArgs getFromOpaqueData(unsigned value)
Definition: CGFunctionInfo.h:531
clang
Definition: CalledOnceCheck.h:17
clang::CodeGen::CGFunctionInfo::getRequiredArgs
RequiredArgs getRequiredArgs() const
Definition: CGFunctionInfo.h:654
clang::CodeGen::CGFunctionInfo::isInstanceMethod
bool isInstanceMethod() const
Definition: CGFunctionInfo.h:659
clang::CodeGen::ABIArgInfo::setPaddingInReg
void setPaddingInReg(bool PIR)
Definition: CGFunctionInfo.h:344
clang::CodeGen::ABIArgInfo::isSignExt
bool isSignExt() const
Definition: CGFunctionInfo.h:328
clang::CodeGen::ABIArgInfo::getIndirectAliased
static ABIArgInfo getIndirectAliased(CharUnits Alignment, unsigned AddrSpace, bool Realign=false, llvm::Type *Padding=nullptr)
Pass this in memory using the IR byref attribute.
Definition: CGFunctionInfo.h:211
clang::CodeGen::ABIArgInfo::getIndirectAlign
CharUnits getIndirectAlign() const
Definition: CGFunctionInfo.h:389
clang::CodeGen::ABIArgInfo::setSRetAfterThis
void setSRetAfterThis(bool AfterThis)
Definition: CGFunctionInfo.h:430
clang::CodeGen::CGFunctionInfo::getRegParm
unsigned getRegParm() const
Definition: CGFunctionInfo.h:697
clang::CodeGen::CGFunctionInfo::setEffectiveCallingConvention
void setEffectiveCallingConvention(unsigned Value)
Definition: CGFunctionInfo.h:692
CanonicalType.h
clang::CharUnits
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
clang::CodeGen::ABIArgInfo::dump
void dump() const
Definition: TargetInfo.cpp:237
clang::CodeGen::ABIArgInfo::PaddingType
llvm::Type * PaddingType
Definition: CGFunctionInfo.h:93
clang::CodeGen::CGFunctionInfo::getArgStruct
llvm::StructType * getArgStruct() const
Get the struct type used to represent all the arguments in memory.
Definition: CGFunctionInfo.h:725
clang::CodeGen::ABIArgInfo::getExpandWithPadding
static ABIArgInfo getExpandWithPadding(bool PaddingInReg, llvm::Type *Padding)
Definition: CGFunctionInfo.h:239
clang::CodeGen::ABIArgInfo::UnpaddedCoerceAndExpandType
llvm::Type * UnpaddedCoerceAndExpandType
Definition: CGFunctionInfo.h:94
clang::FunctionType::ExtInfo::getProducesResult
bool getProducesResult() const
Definition: Type.h:3706
clang::CodeGen::ABIArgInfo::DirectAttr
DirectAttrInfo DirectAttr
Definition: CGFunctionInfo.h:105
clang::CharUnits::getQuantity
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Definition: CharUnits.h:179
clang::Type::isIntegralOrEnumerationType
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
Definition: Type.h:7058
clang::CodeGen::ABIArgInfo::getExpand
static ABIArgInfo getExpand()
Definition: CGFunctionInfo.h:234
clang::CodeGen::CGFunctionInfo::getReturnInfo
const ABIArgInfo & getReturnInfo() const
Definition: CGFunctionInfo.h:709
clang::FunctionProtoType::getExtParameterInfos
ArrayRef< ExtParameterInfo > getExtParameterInfos() const
Definition: Type.h:4283
clang::CodeGen::CGFunctionInfo::Profile
static void Profile(llvm::FoldingSetNodeID &ID, bool InstanceMethod, bool ChainCall, const FunctionType::ExtInfo &info, ArrayRef< ExtParameterInfo > paramInfos, RequiredArgs required, CanQualType resultType, ArrayRef< CanQualType > argTypes)
Definition: CGFunctionInfo.h:755
clang::CodeGen::CGFunctionInfo::getArgStructAlignment
CharUnits getArgStructAlignment() const
Definition: CGFunctionInfo.h:726