clang 22.0.0git
CGCXXABI.h
Go to the documentation of this file.
1//===----- CGCXXABI.h - Interface to C++ ABIs -------------------*- C++ -*-===//
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// This provides an abstract class for C++ code generation. Concrete subclasses
10// of this implement code generation for specific C++ ABIs.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_LIB_CODEGEN_CGCXXABI_H
15#define LLVM_CLANG_LIB_CODEGEN_CGCXXABI_H
16
17#include "CodeGenFunction.h"
18#include "clang/Basic/LLVM.h"
20
21namespace llvm {
22class Constant;
23class Type;
24class Value;
25class CallInst;
26}
27
28namespace clang {
29class CastExpr;
30class CXXConstructorDecl;
31class CXXDestructorDecl;
32class CXXMethodDecl;
33class CXXRecordDecl;
34class MangleContext;
35
36namespace CodeGen {
37class CGCallee;
38class CodeGenFunction;
39class CodeGenModule;
40struct CatchTypeInfo;
41
42/// Implements C++ ABI-specific code generation functions.
43class CGCXXABI {
44 friend class CodeGenModule;
45
46protected:
48 std::unique_ptr<MangleContext> MangleCtx;
49
51 : CGM(CGM), MangleCtx(CGM.getContext().createMangleContext()) {}
52
53protected:
55 return CGF.CXXABIThisDecl;
56 }
57 llvm::Value *getThisValue(CodeGenFunction &CGF) {
58 return CGF.CXXABIThisValue;
59 }
60
62
63 /// Issue a diagnostic about unsupported features in the ABI.
64 void ErrorUnsupportedABI(CodeGenFunction &CGF, StringRef S);
65
66 /// Get a null value for unsupported member pointers.
67 llvm::Constant *GetBogusMemberPointer(QualType T);
68
70 return CGF.CXXStructorImplicitParamDecl;
71 }
73 return CGF.CXXStructorImplicitParamValue;
74 }
75
76 /// Loads the incoming C++ this pointer as it was passed by the caller.
77 llvm::Value *loadIncomingCXXThis(CodeGenFunction &CGF);
78
79 void setCXXABIThisValue(CodeGenFunction &CGF, llvm::Value *ThisPtr);
80
81 ASTContext &getContext() const { return CGM.getContext(); }
82
83 bool mayNeedDestruction(const VarDecl *VD) const;
84
85 /// Determine whether we will definitely emit this variable with a constant
86 /// initializer, either because the language semantics demand it or because
87 /// we know that the initializer is a constant.
88 // For weak definitions, any initializer available in the current translation
89 // is not necessarily reflective of the initializer used; such initializers
90 // are ignored unless if InspectInitForWeakDef is true.
91 bool
93 bool InspectInitForWeakDef = false) const;
94
95 virtual bool requiresArrayCookie(const CXXDeleteExpr *E, QualType eltType);
96 virtual bool requiresArrayCookie(const CXXNewExpr *E);
97
98 /// Determine whether there's something special about the rules of
99 /// the ABI tell us that 'this' is a complete object within the
100 /// given function. Obvious common logic like being defined on a
101 /// final class will have been taken care of by the caller.
102 virtual bool isThisCompleteObject(GlobalDecl GD) const = 0;
103
105 return CGM.getCodeGenOpts().CtorDtorReturnThis;
106 }
107
108public:
109
110 virtual ~CGCXXABI();
111
112 /// Gets the mangle context.
114 return *MangleCtx;
115 }
116
117 /// Returns true if the given constructor or destructor is one of the
118 /// kinds that the ABI says returns 'this' (only applies when called
119 /// non-virtually for destructors).
120 ///
121 /// There currently is no way to indicate if a destructor returns 'this'
122 /// when called virtually, and code generation does not support the case.
123 virtual bool HasThisReturn(GlobalDecl GD) const {
124 if (isa<CXXConstructorDecl>(GD.getDecl()) ||
125 (isa<CXXDestructorDecl>(GD.getDecl()) &&
126 GD.getDtorType() != Dtor_Deleting))
128 return false;
129 }
130
131 virtual bool hasMostDerivedReturn(GlobalDecl GD) const { return false; }
132
133 virtual bool useSinitAndSterm() const { return false; }
134
135 /// Returns true if the target allows calling a function through a pointer
136 /// with a different signature than the actual function (or equivalently,
137 /// bitcasting a function or function pointer to a different function type).
138 /// In principle in the most general case this could depend on the target, the
139 /// calling convention, and the actual types of the arguments and return
140 /// value. Here it just means whether the signature mismatch could *ever* be
141 /// allowed; in other words, does the target do strict checking of signatures
142 /// for all calls.
143 virtual bool canCallMismatchedFunctionType() const { return true; }
144
145 /// If the C++ ABI requires the given type be returned in a particular way,
146 /// this method sets RetAI and returns true.
147 virtual bool classifyReturnType(CGFunctionInfo &FI) const = 0;
148
149 /// Specify how one should pass an argument of a record type.
151 /// Pass it using the normal C aggregate rules for the ABI, potentially
152 /// introducing extra copies and passing some or all of it in registers.
154
155 /// Pass it on the stack using its defined layout. The argument must be
156 /// evaluated directly into the correct stack position in the arguments area,
157 /// and the call machinery must not move it or introduce extra copies.
159
160 /// Pass it as a pointer to temporary memory.
162 };
163
164 /// Returns how an argument of the given record type should be passed.
165 virtual RecordArgABI getRecordArgABI(const CXXRecordDecl *RD) const = 0;
166
167 /// Returns true if the implicit 'sret' parameter comes after the implicit
168 /// 'this' parameter of C++ instance methods.
169 virtual bool isSRetParameterAfterThis() const { return false; }
170
171 /// Returns true if the ABI permits the argument to be a homogeneous
172 /// aggregate.
173 virtual bool
175 return true;
176 };
177
178 /// Find the LLVM type used to represent the given member pointer
179 /// type.
180 virtual llvm::Type *
182
183 /// Load a member function from an object and a member function
184 /// pointer. Apply the this-adjustment and set 'This' to the
185 /// adjusted value.
187 CodeGenFunction &CGF, const Expr *E, Address This,
188 llvm::Value *&ThisPtrForCall, llvm::Value *MemPtr,
189 const MemberPointerType *MPT);
190
191 /// Calculate an l-value from an object and a data member pointer.
192 virtual llvm::Value *
194 Address Base, llvm::Value *MemPtr,
195 const MemberPointerType *MPT, bool IsInBounds);
196
197 /// Perform a derived-to-base, base-to-derived, or bitcast member
198 /// pointer conversion.
199 virtual llvm::Value *EmitMemberPointerConversion(CodeGenFunction &CGF,
200 const CastExpr *E,
201 llvm::Value *Src);
202
203 /// Perform a derived-to-base, base-to-derived, or bitcast member
204 /// pointer conversion on a constant value.
205 virtual llvm::Constant *EmitMemberPointerConversion(const CastExpr *E,
206 llvm::Constant *Src);
207
208 /// Return true if the given member pointer can be zero-initialized
209 /// (in the C++ sense) with an LLVM zeroinitializer.
210 virtual bool isZeroInitializable(const MemberPointerType *MPT);
211
212 /// Return whether or not a member pointers type is convertible to an IR type.
213 virtual bool isMemberPointerConvertible(const MemberPointerType *MPT) const {
214 return true;
215 }
216
217 /// Create a null member pointer of the given type.
218 virtual llvm::Constant *EmitNullMemberPointer(const MemberPointerType *MPT);
219
220 /// Create a member pointer for the given method.
221 virtual llvm::Constant *EmitMemberFunctionPointer(const CXXMethodDecl *MD);
222
223 /// Create a member pointer for the given field.
224 virtual llvm::Constant *EmitMemberDataPointer(const MemberPointerType *MPT,
225 CharUnits offset);
226
227 /// Create a member pointer for the given member pointer constant.
228 virtual llvm::Constant *EmitMemberPointer(const APValue &MP, QualType MPT);
229
230 /// Emit a comparison between two member pointers. Returns an i1.
231 virtual llvm::Value *
233 llvm::Value *L,
234 llvm::Value *R,
235 const MemberPointerType *MPT,
236 bool Inequality);
237
238 /// Determine if a member pointer is non-null. Returns an i1.
239 virtual llvm::Value *
241 llvm::Value *MemPtr,
242 const MemberPointerType *MPT);
243
244protected:
245 /// A utility method for computing the offset required for the given
246 /// base-to-derived or derived-to-base member-pointer conversion.
247 /// Does not handle virtual conversions (in case we ever fully
248 /// support an ABI that allows this). Returns null if no adjustment
249 /// is required.
250 llvm::Constant *getMemberPointerAdjustment(const CastExpr *E);
251
252public:
254 const CXXDeleteExpr *DE,
255 Address Ptr, QualType ElementType,
256 const CXXDestructorDecl *Dtor) = 0;
257 virtual void emitRethrow(CodeGenFunction &CGF, bool isNoReturn) = 0;
258 virtual void emitThrow(CodeGenFunction &CGF, const CXXThrowExpr *E) = 0;
259 virtual llvm::GlobalVariable *getThrowInfo(QualType T) { return nullptr; }
260
261 /// Determine whether it's possible to emit a vtable for \p RD, even
262 /// though we do not know that the vtable has been marked as used by semantic
263 /// analysis.
264 virtual bool canSpeculativelyEmitVTable(const CXXRecordDecl *RD) const = 0;
265
266 virtual void emitBeginCatch(CodeGenFunction &CGF, const CXXCatchStmt *C) = 0;
267
268 virtual llvm::CallInst *
270 llvm::Value *Exn);
271
272 virtual llvm::Constant *getAddrOfRTTIDescriptor(QualType Ty) = 0;
273 virtual CatchTypeInfo
276
277 virtual bool shouldTypeidBeNullChecked(QualType SrcRecordTy) = 0;
278 virtual void EmitBadTypeidCall(CodeGenFunction &CGF) = 0;
279 virtual llvm::Value *EmitTypeid(CodeGenFunction &CGF, QualType SrcRecordTy,
280 Address ThisPtr,
281 llvm::Type *StdTypeInfoPtrTy) = 0;
282
283 virtual bool shouldDynamicCastCallBeNullChecked(bool SrcIsPtr,
284 QualType SrcRecordTy) = 0;
285 virtual bool shouldEmitExactDynamicCast(QualType DestRecordTy) = 0;
286
288 QualType SrcRecordTy,
289 QualType DestTy,
290 QualType DestRecordTy,
291 llvm::BasicBlock *CastEnd) = 0;
292
293 virtual llvm::Value *emitDynamicCastToVoid(CodeGenFunction &CGF,
295 QualType SrcRecordTy) = 0;
296
300 };
301
302 virtual std::optional<ExactDynamicCastInfo>
304 QualType DestRecordTy) = 0;
305
306 /// Emit a dynamic_cast from SrcRecordTy to DestRecordTy. The cast fails if
307 /// the dynamic type of Value is not exactly DestRecordTy.
308 virtual llvm::Value *emitExactDynamicCast(
309 CodeGenFunction &CGF, Address Value, QualType SrcRecordTy,
310 QualType DestTy, QualType DestRecordTy,
311 const ExactDynamicCastInfo &CastInfo, llvm::BasicBlock *CastSuccess,
312 llvm::BasicBlock *CastFail) = 0;
313
314 virtual bool EmitBadCastCall(CodeGenFunction &CGF) = 0;
315
318 const CXXRecordDecl *ClassDecl,
319 const CXXRecordDecl *BaseClassDecl) = 0;
320
321 virtual llvm::BasicBlock *EmitCtorCompleteObjectHandler(CodeGenFunction &CGF,
322 const CXXRecordDecl *RD);
323
324 /// Emit the code to initialize hidden members required
325 /// to handle virtual inheritance, if needed by the ABI.
326 virtual void
328 const CXXRecordDecl *RD) {}
329
330 /// Emit constructor variants required by this ABI.
331 virtual void EmitCXXConstructors(const CXXConstructorDecl *D) = 0;
332
333 /// Additional implicit arguments to add to the beginning (Prefix) and end
334 /// (Suffix) of a constructor / destructor arg list.
335 ///
336 /// Note that Prefix should actually be inserted *after* the first existing
337 /// arg; `this` arguments always come first.
339 struct Arg {
340 llvm::Value *Value;
342 };
345 AddedStructorArgs() = default;
347 : Prefix(std::move(P)), Suffix(std::move(S)) {}
349 return {std::move(Args), {}};
350 }
352 return {{}, std::move(Args)};
353 }
354 };
355
356 /// Similar to AddedStructorArgs, but only notes the number of additional
357 /// arguments.
359 unsigned Prefix = 0;
360 unsigned Suffix = 0;
362 AddedStructorArgCounts(unsigned P, unsigned S) : Prefix(P), Suffix(S) {}
363 static AddedStructorArgCounts prefix(unsigned N) { return {N, 0}; }
364 static AddedStructorArgCounts suffix(unsigned N) { return {0, N}; }
365 };
366
367 /// Build the signature of the given constructor or destructor variant by
368 /// adding any required parameters. For convenience, ArgTys has been
369 /// initialized with the type of 'this'.
370 virtual AddedStructorArgCounts
372 SmallVectorImpl<CanQualType> &ArgTys) = 0;
373
374 /// Returns true if the given destructor type should be emitted as a linkonce
375 /// delegating thunk, regardless of whether the dtor is defined in this TU or
376 /// not.
378 CXXDtorType DT) const = 0;
379
380 virtual void setCXXDestructorDLLStorage(llvm::GlobalValue *GV,
381 const CXXDestructorDecl *Dtor,
382 CXXDtorType DT) const;
383
384 virtual llvm::GlobalValue::LinkageTypes
386 CXXDtorType DT) const;
387
388 /// Emit destructor variants required by this ABI.
389 virtual void EmitCXXDestructors(const CXXDestructorDecl *D) = 0;
390
391 /// Get the type of the implicit "this" parameter used by a method. May return
392 /// zero if no specific type is applicable, e.g. if the ABI expects the "this"
393 /// parameter to point to some artificial offset in a complete object due to
394 /// vbases being reordered.
396 return cast<CXXMethodDecl>(GD.getDecl())->getParent();
397 }
398
399 /// Perform ABI-specific "this" argument adjustment required prior to
400 /// a call of a virtual function.
401 /// The "VirtualCall" argument is true iff the call itself is virtual.
402 virtual Address
404 Address This, bool VirtualCall) {
405 return This;
406 }
407
408 /// Build a parameter variable suitable for 'this'.
410
411 /// Insert any ABI-specific implicit parameters into the parameter list for a
412 /// function. This generally involves extra data for constructors and
413 /// destructors.
414 ///
415 /// ABIs may also choose to override the return type, which has been
416 /// initialized with the type of 'this' if HasThisReturn(CGF.CurGD) is true or
417 /// the formal return type of the function otherwise.
419 FunctionArgList &Params) = 0;
420
421 /// Get the ABI-specific "this" parameter adjustment to apply in the prologue
422 /// of a virtual function.
424 return CharUnits::Zero();
425 }
426
427 /// Emit the ABI-specific prolog for the function.
429
430 virtual AddedStructorArgs
432 CXXCtorType Type, bool ForVirtualBase,
433 bool Delegating) = 0;
434
435 /// Add any ABI-specific implicit arguments needed to call a constructor.
436 ///
437 /// \return The number of arguments added at the beginning and end of the
438 /// call, which is typically zero or one.
441 CXXCtorType Type, bool ForVirtualBase,
442 bool Delegating, CallArgList &Args);
443
444 /// Get the implicit (second) parameter that comes after the "this" pointer,
445 /// or nullptr if there is isn't one.
446 virtual llvm::Value *
449 bool ForVirtualBase, bool Delegating) = 0;
450
451 /// Emit the destructor call.
454 bool ForVirtualBase, bool Delegating,
455 Address This, QualType ThisTy) = 0;
456
457 /// Emits the VTable definitions required for the given record type.
459 const CXXRecordDecl *RD) = 0;
460
461 /// Checks if ABI requires extra virtual offset for vtable field.
462 virtual bool
464 CodeGenFunction::VPtr Vptr) = 0;
465
466 /// Checks if ABI requires to initialize vptrs for given dynamic class.
467 virtual bool doStructorsInitializeVPtrs(const CXXRecordDecl *VTableClass) = 0;
468
469 /// Get the address point of the vtable for the given base subobject.
470 virtual llvm::Constant *
472 const CXXRecordDecl *VTableClass) = 0;
473
474 /// Get the address point of the vtable for the given base subobject while
475 /// building a constructor or a destructor.
476 virtual llvm::Value *
479 const CXXRecordDecl *NearestVBase) = 0;
480
481 /// Get the address of the vtable for the given record decl which should be
482 /// used for the vptr at the given offset in RD.
483 virtual llvm::GlobalVariable *getAddrOfVTable(const CXXRecordDecl *RD,
484 CharUnits VPtrOffset) = 0;
485
486 /// Build a virtual function pointer in the ABI-specific way.
489 llvm::Type *Ty,
490 SourceLocation Loc) = 0;
491
493 llvm::PointerUnion<const CXXDeleteExpr *, const CXXMemberCallExpr *>;
494
495 /// Emit the ABI-specific virtual destructor call.
496 virtual llvm::Value *
498 CXXDtorType DtorType, Address This,
500 llvm::CallBase **CallOrInvoke) = 0;
501
503 GlobalDecl GD,
504 CallArgList &CallArgs) {}
505
506 /// Emit any tables needed to implement virtual inheritance. For Itanium,
507 /// this emits virtual table tables. For the MSVC++ ABI, this emits virtual
508 /// base tables.
509 virtual void emitVirtualInheritanceTables(const CXXRecordDecl *RD) = 0;
510
511 virtual bool exportThunk() = 0;
512 virtual void setThunkLinkage(llvm::Function *Thunk, bool ForVTable,
513 GlobalDecl GD, bool ReturnAdjustment) = 0;
514
515 virtual llvm::Value *
517 const CXXRecordDecl *UnadjustedClass,
518 const ThunkInfo &TI) = 0;
519
520 virtual llvm::Value *
522 const CXXRecordDecl *UnadjustedClass,
523 const ReturnAdjustment &RA) = 0;
524
525 virtual void EmitReturnFromThunk(CodeGenFunction &CGF,
526 RValue RV, QualType ResultType);
527
529 FunctionArgList &Args) const = 0;
530
531 /// Gets the offsets of all the virtual base pointers in a given class.
532 virtual std::vector<CharUnits> getVBPtrOffsets(const CXXRecordDecl *RD);
533
534 /// Gets the pure virtual member call function.
535 virtual StringRef GetPureVirtualCallName() = 0;
536
537 /// Gets the deleted virtual member call name.
538 virtual StringRef GetDeletedVirtualCallName() = 0;
539
540 /**************************** Array cookies ******************************/
541
542 /// Returns the extra size required in order to store the array
543 /// cookie for the given new-expression. May return 0 to indicate that no
544 /// array cookie is required.
545 ///
546 /// Several cases are filtered out before this method is called:
547 /// - non-array allocations never need a cookie
548 /// - calls to \::operator new(size_t, void*) never need a cookie
549 ///
550 /// \param expr - the new-expression being allocated.
552
553 /// Initialize the array cookie for the given allocation.
554 ///
555 /// \param NewPtr - a char* which is the presumed-non-null
556 /// return value of the allocation function
557 /// \param NumElements - the computed number of elements,
558 /// potentially collapsed from the multidimensional array case;
559 /// always a size_t
560 /// \param ElementType - the base element allocated type,
561 /// i.e. the allocated type after stripping all array types
563 Address NewPtr,
564 llvm::Value *NumElements,
565 const CXXNewExpr *expr,
566 QualType ElementType);
567
568 /// Reads the array cookie associated with the given pointer,
569 /// if it has one.
570 ///
571 /// \param Ptr - a pointer to the first element in the array
572 /// \param ElementType - the base element type of elements of the array
573 /// \param NumElements - an out parameter which will be initialized
574 /// with the number of elements allocated, or zero if there is no
575 /// cookie
576 /// \param AllocPtr - an out parameter which will be initialized
577 /// with a char* pointing to the address returned by the allocation
578 /// function
579 /// \param CookieSize - an out parameter which will be initialized
580 /// with the size of the cookie, or zero if there is no cookie
581 virtual void ReadArrayCookie(CodeGenFunction &CGF, Address Ptr,
582 const CXXDeleteExpr *expr,
583 QualType ElementType, llvm::Value *&NumElements,
584 llvm::Value *&AllocPtr, CharUnits &CookieSize);
585
586 /// Return whether the given global decl needs a VTT parameter.
587 virtual bool NeedsVTTParameter(GlobalDecl GD);
588
589protected:
590 /// Returns the extra size required in order to store the array
591 /// cookie for the given type. Assumes that an array cookie is
592 /// required.
593 virtual CharUnits getArrayCookieSizeImpl(QualType elementType);
594
595 /// Reads the array cookie for an allocation which is known to have one.
596 /// This is called by the standard implementation of ReadArrayCookie.
597 ///
598 /// \param ptr - a pointer to the allocation made for an array, as a char*
599 /// \param cookieSize - the computed cookie size of an array
600 ///
601 /// Other parameters are as above.
602 ///
603 /// \return a size_t
604 virtual llvm::Value *readArrayCookieImpl(CodeGenFunction &IGF, Address ptr,
605 CharUnits cookieSize);
606
607public:
608
609 /*************************** Static local guards ****************************/
610
611 /// Emits the guarded initializer and destructor setup for the given
612 /// variable, given that it couldn't be emitted as a constant.
613 /// If \p PerformInit is false, the initialization has been folded to a
614 /// constant and should not be performed.
615 ///
616 /// The variable may be:
617 /// - a static local variable
618 /// - a static data member of a class template instantiation
619 virtual void EmitGuardedInit(CodeGenFunction &CGF, const VarDecl &D,
620 llvm::GlobalVariable *DeclPtr,
621 bool PerformInit) = 0;
622
623 /// Emit code to force the execution of a destructor during global
624 /// teardown. The default implementation of this uses atexit.
625 ///
626 /// \param Dtor - a function taking a single pointer argument
627 /// \param Addr - a pointer to pass to the destructor function.
628 virtual void registerGlobalDtor(CodeGenFunction &CGF, const VarDecl &D,
629 llvm::FunctionCallee Dtor,
630 llvm::Constant *Addr) = 0;
631
632 /*************************** thread_local initialization ********************/
633
634 /// Emits ABI-required functions necessary to initialize thread_local
635 /// variables in this translation unit.
636 ///
637 /// \param CXXThreadLocals - The thread_local declarations in this translation
638 /// unit.
639 /// \param CXXThreadLocalInits - If this translation unit contains any
640 /// non-constant initialization or non-trivial destruction for
641 /// thread_local variables, a list of functions to perform the
642 /// initialization.
645 ArrayRef<llvm::Function *> CXXThreadLocalInits,
646 ArrayRef<const VarDecl *> CXXThreadLocalInitVars) = 0;
647
648 // Determine if references to thread_local global variables can be made
649 // directly or require access through a thread wrapper function.
650 virtual bool usesThreadWrapperFunction(const VarDecl *VD) const = 0;
651
652 /// Emit a reference to a non-local thread_local variable (including
653 /// triggering the initialization of all thread_local variables in its
654 /// translation unit).
656 const VarDecl *VD,
657 QualType LValType) = 0;
658
659 /// Emit a single constructor/destructor with the given type from a C++
660 /// constructor Decl.
661 virtual void emitCXXStructor(GlobalDecl GD) = 0;
662
663 /// Load a vtable from This, an object of polymorphic type RD, or from one of
664 /// its virtual bases if it does not have its own vtable. Returns the vtable
665 /// and the class from which the vtable was loaded.
666 virtual std::pair<llvm::Value *, const CXXRecordDecl *>
668 const CXXRecordDecl *RD) = 0;
669};
670
671// Create an instance of a C++ ABI class:
672
673/// Creates an Itanium-family ABI.
675
676/// Creates a Microsoft-family ABI.
678
680 llvm::CatchPadInst *CPI;
681
682 CatchRetScope(llvm::CatchPadInst *CPI) : CPI(CPI) {}
683
684 void Emit(CodeGenFunction &CGF, Flags flags) override {
685 llvm::BasicBlock *BB = CGF.createBasicBlock("catchret.dest");
686 CGF.Builder.CreateCatchRet(CPI, BB);
687 CGF.EmitBlock(BB);
688 }
689};
690}
691}
692
693#endif
MatchType Type
StringRef P
const Decl * D
Expr * E
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
SourceLocation Loc
Definition: SemaObjC.cpp:754
a trap message and trap category.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition: APValue.h:122
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2604
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2620
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2869
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2129
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2349
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1209
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3612
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
Definition: CharUnits.h:53
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
Definition: Address.h:128
Implements C++ ABI-specific code generation functions.
Definition: CGCXXABI.h:43
virtual bool shouldEmitExactDynamicCast(QualType DestRecordTy)=0
llvm::Value *& getStructorImplicitParamValue(CodeGenFunction &CGF)
Definition: CGCXXABI.h:72
virtual void EmitCXXConstructors(const CXXConstructorDecl *D)=0
Emit constructor variants required by this ABI.
virtual llvm::Constant * getAddrOfRTTIDescriptor(QualType Ty)=0
virtual bool hasMostDerivedReturn(GlobalDecl GD) const
Definition: CGCXXABI.h:131
virtual bool HasThisReturn(GlobalDecl GD) const
Returns true if the given constructor or destructor is one of the kinds that the ABI says returns 'th...
Definition: CGCXXABI.h:123
virtual llvm::Value * getVTableAddressPointInStructor(CodeGenFunction &CGF, const CXXRecordDecl *RD, BaseSubobject Base, const CXXRecordDecl *NearestVBase)=0
Get the address point of the vtable for the given base subobject while building a constructor or a de...
llvm::Constant * getMemberPointerAdjustment(const CastExpr *E)
A utility method for computing the offset required for the given base-to-derived or derived-to-base m...
Definition: CGCXXABI.cpp:281
virtual void emitBeginCatch(CodeGenFunction &CGF, const CXXCatchStmt *C)=0
virtual std::vector< CharUnits > getVBPtrOffsets(const CXXRecordDecl *RD)
Gets the offsets of all the virtual base pointers in a given class.
Definition: CGCXXABI.cpp:337
virtual void emitRethrow(CodeGenFunction &CGF, bool isNoReturn)=0
virtual void initializeHiddenVirtualInheritanceMembers(CodeGenFunction &CGF, const CXXRecordDecl *RD)
Emit the code to initialize hidden members required to handle virtual inheritance,...
Definition: CGCXXABI.h:327
virtual bool isMemberPointerConvertible(const MemberPointerType *MPT) const
Return whether or not a member pointers type is convertible to an IR type.
Definition: CGCXXABI.h:213
virtual size_t getSrcArgforCopyCtor(const CXXConstructorDecl *, FunctionArgList &Args) const =0
virtual bool isVirtualOffsetNeededForVTableField(CodeGenFunction &CGF, CodeGenFunction::VPtr Vptr)=0
Checks if ABI requires extra virtual offset for vtable field.
virtual bool constructorsAndDestructorsReturnThis() const
Definition: CGCXXABI.h:104
virtual bool useSinitAndSterm() const
Definition: CGCXXABI.h:133
virtual void ReadArrayCookie(CodeGenFunction &CGF, Address Ptr, const CXXDeleteExpr *expr, QualType ElementType, llvm::Value *&NumElements, llvm::Value *&AllocPtr, CharUnits &CookieSize)
Reads the array cookie associated with the given pointer, if it has one.
Definition: CGCXXABI.cpp:250
CodeGenModule & CGM
Definition: CGCXXABI.h:47
virtual void EmitGuardedInit(CodeGenFunction &CGF, const VarDecl &D, llvm::GlobalVariable *DeclPtr, bool PerformInit)=0
Emits the guarded initializer and destructor setup for the given variable, given that it couldn't be ...
virtual void EmitCXXDestructors(const CXXDestructorDecl *D)=0
Emit destructor variants required by this ABI.
virtual void EmitInstanceFunctionProlog(CodeGenFunction &CGF)=0
Emit the ABI-specific prolog for the function.
virtual bool useThunkForDtorVariant(const CXXDestructorDecl *Dtor, CXXDtorType DT) const =0
Returns true if the given destructor type should be emitted as a linkonce delegating thunk,...
virtual CharUnits getVirtualFunctionPrologueThisAdjustment(GlobalDecl GD)
Get the ABI-specific "this" parameter adjustment to apply in the prologue of a virtual function.
Definition: CGCXXABI.h:423
virtual void setCXXDestructorDLLStorage(llvm::GlobalValue *GV, const CXXDestructorDecl *Dtor, CXXDtorType DT) const
Definition: CGCXXABI.cpp:309
virtual bool NeedsVTTParameter(GlobalDecl GD)
Return whether the given global decl needs a VTT parameter.
Definition: CGCXXABI.cpp:322
virtual llvm::CallInst * emitTerminateForUnexpectedException(CodeGenFunction &CGF, llvm::Value *Exn)
Definition: CGCXXABI.cpp:327
ImplicitParamDecl * getThisDecl(CodeGenFunction &CGF)
Definition: CGCXXABI.h:54
RecordArgABI
Specify how one should pass an argument of a record type.
Definition: CGCXXABI.h:150
@ RAA_Default
Pass it using the normal C aggregate rules for the ABI, potentially introducing extra copies and pass...
Definition: CGCXXABI.h:153
@ RAA_Indirect
Pass it as a pointer to temporary memory.
Definition: CGCXXABI.h:161
@ RAA_DirectInMemory
Pass it on the stack using its defined layout.
Definition: CGCXXABI.h:158
virtual bool shouldTypeidBeNullChecked(QualType SrcRecordTy)=0
virtual llvm::Type * ConvertMemberPointerType(const MemberPointerType *MPT)
Find the LLVM type used to represent the given member pointer type.
Definition: CGCXXABI.cpp:43
virtual llvm::Value * performThisAdjustment(CodeGenFunction &CGF, Address This, const CXXRecordDecl *UnadjustedClass, const ThunkInfo &TI)=0
ImplicitParamDecl *& getStructorImplicitParamDecl(CodeGenFunction &CGF)
Definition: CGCXXABI.h:69
virtual llvm::Constant * EmitNullMemberPointer(const MemberPointerType *MPT)
Create a null member pointer of the given type.
Definition: CGCXXABI.cpp:103
virtual StringRef GetPureVirtualCallName()=0
Gets the pure virtual member call function.
virtual CharUnits getArrayCookieSizeImpl(QualType elementType)
Returns the extra size required in order to store the array cookie for the given type.
Definition: CGCXXABI.cpp:216
virtual bool isSRetParameterAfterThis() const
Returns true if the implicit 'sret' parameter comes after the implicit 'this' parameter of C++ instan...
Definition: CGCXXABI.h:169
virtual void EmitReturnFromThunk(CodeGenFunction &CGF, RValue RV, QualType ResultType)
Definition: CGCXXABI.cpp:203
virtual void registerGlobalDtor(CodeGenFunction &CGF, const VarDecl &D, llvm::FunctionCallee Dtor, llvm::Constant *Addr)=0
Emit code to force the execution of a destructor during global teardown.
virtual std::optional< ExactDynamicCastInfo > getExactDynamicCastInfo(QualType SrcRecordTy, QualType DestTy, QualType DestRecordTy)=0
virtual bool canSpeculativelyEmitVTable(const CXXRecordDecl *RD) const =0
Determine whether it's possible to emit a vtable for RD, even though we do not know that the vtable h...
virtual StringRef GetDeletedVirtualCallName()=0
Gets the deleted virtual member call name.
void buildThisParam(CodeGenFunction &CGF, FunctionArgList &Params)
Build a parameter variable suitable for 'this'.
Definition: CGCXXABI.cpp:126
virtual llvm::Value * EmitMemberPointerIsNotNull(CodeGenFunction &CGF, llvm::Value *MemPtr, const MemberPointerType *MPT)
Determine if a member pointer is non-null. Returns an i1.
Definition: CGCXXABI.cpp:95
virtual llvm::Value * performReturnAdjustment(CodeGenFunction &CGF, Address Ret, const CXXRecordDecl *UnadjustedClass, const ReturnAdjustment &RA)=0
virtual LValue EmitThreadLocalVarDeclLValue(CodeGenFunction &CGF, const VarDecl *VD, QualType LValType)=0
Emit a reference to a non-local thread_local variable (including triggering the initialization of all...
bool isEmittedWithConstantInitializer(const VarDecl *VD, bool InspectInitForWeakDef=false) const
Determine whether we will definitely emit this variable with a constant initializer,...
Definition: CGCXXABI.cpp:171
virtual llvm::Value * EmitMemberPointerComparison(CodeGenFunction &CGF, llvm::Value *L, llvm::Value *R, const MemberPointerType *MPT, bool Inequality)
Emit a comparison between two member pointers. Returns an i1.
Definition: CGCXXABI.cpp:85
virtual llvm::Constant * EmitMemberPointer(const APValue &MP, QualType MPT)
Create a member pointer for the given member pointer constant.
Definition: CGCXXABI.cpp:117
virtual llvm::Constant * getVTableAddressPoint(BaseSubobject Base, const CXXRecordDecl *VTableClass)=0
Get the address point of the vtable for the given base subobject.
virtual bool canCallMismatchedFunctionType() const
Returns true if the target allows calling a function through a pointer with a different signature tha...
Definition: CGCXXABI.h:143
virtual void addImplicitStructorParams(CodeGenFunction &CGF, QualType &ResTy, FunctionArgList &Params)=0
Insert any ABI-specific implicit parameters into the parameter list for a function.
llvm::PointerUnion< const CXXDeleteExpr *, const CXXMemberCallExpr * > DeleteOrMemberCallExpr
Definition: CGCXXABI.h:493
Address getThisAddress(CodeGenFunction &CGF)
Definition: CGCXXABI.cpp:23
virtual llvm::Value * readArrayCookieImpl(CodeGenFunction &IGF, Address ptr, CharUnits cookieSize)
Reads the array cookie for an allocation which is known to have one.
Definition: CGCXXABI.cpp:271
virtual llvm::Value * getCXXDestructorImplicitParam(CodeGenFunction &CGF, const CXXDestructorDecl *DD, CXXDtorType Type, bool ForVirtualBase, bool Delegating)=0
Get the implicit (second) parameter that comes after the "this" pointer, or nullptr if there is isn't...
virtual bool requiresArrayCookie(const CXXDeleteExpr *E, QualType eltType)
Definition: CGCXXABI.cpp:231
virtual CatchTypeInfo getCatchAllTypeInfo()
Definition: CGCXXABI.cpp:333
virtual std::pair< llvm::Value *, const CXXRecordDecl * > LoadVTablePtr(CodeGenFunction &CGF, Address This, const CXXRecordDecl *RD)=0
Load a vtable from This, an object of polymorphic type RD, or from one of its virtual bases if it doe...
virtual void setThunkLinkage(llvm::Function *Thunk, bool ForVTable, GlobalDecl GD, bool ReturnAdjustment)=0
virtual Address adjustThisArgumentForVirtualFunctionCall(CodeGenFunction &CGF, GlobalDecl GD, Address This, bool VirtualCall)
Perform ABI-specific "this" argument adjustment required prior to a call of a virtual function.
Definition: CGCXXABI.h:403
bool mayNeedDestruction(const VarDecl *VD) const
Definition: CGCXXABI.cpp:161
virtual llvm::BasicBlock * EmitCtorCompleteObjectHandler(CodeGenFunction &CGF, const CXXRecordDecl *RD)
Definition: CGCXXABI.cpp:300
virtual bool doStructorsInitializeVPtrs(const CXXRecordDecl *VTableClass)=0
Checks if ABI requires to initialize vptrs for given dynamic class.
std::unique_ptr< MangleContext > MangleCtx
Definition: CGCXXABI.h:48
virtual void emitThrow(CodeGenFunction &CGF, const CXXThrowExpr *E)=0
virtual llvm::Value * GetVirtualBaseClassOffset(CodeGenFunction &CGF, Address This, const CXXRecordDecl *ClassDecl, const CXXRecordDecl *BaseClassDecl)=0
virtual bool isThisCompleteObject(GlobalDecl GD) const =0
Determine whether there's something special about the rules of the ABI tell us that 'this' is a compl...
virtual CGCallee getVirtualFunctionPointer(CodeGenFunction &CGF, GlobalDecl GD, Address This, llvm::Type *Ty, SourceLocation Loc)=0
Build a virtual function pointer in the ABI-specific way.
virtual bool classifyReturnType(CGFunctionInfo &FI) const =0
If the C++ ABI requires the given type be returned in a particular way, this method sets RetAI and re...
virtual void emitVirtualObjectDelete(CodeGenFunction &CGF, const CXXDeleteExpr *DE, Address Ptr, QualType ElementType, const CXXDestructorDecl *Dtor)=0
virtual CatchTypeInfo getAddrOfCXXCatchHandlerType(QualType Ty, QualType CatchHandlerType)=0
virtual void EmitThreadLocalInitFuncs(CodeGenModule &CGM, ArrayRef< const VarDecl * > CXXThreadLocals, ArrayRef< llvm::Function * > CXXThreadLocalInits, ArrayRef< const VarDecl * > CXXThreadLocalInitVars)=0
Emits ABI-required functions necessary to initialize thread_local variables in this translation unit.
CGCXXABI(CodeGenModule &CGM)
Definition: CGCXXABI.h:50
virtual bool usesThreadWrapperFunction(const VarDecl *VD) const =0
virtual RecordArgABI getRecordArgABI(const CXXRecordDecl *RD) const =0
Returns how an argument of the given record type should be passed.
void setCXXABIThisValue(CodeGenFunction &CGF, llvm::Value *ThisPtr)
Definition: CGCXXABI.cpp:155
virtual llvm::Value * EmitMemberDataPointerAddress(CodeGenFunction &CGF, const Expr *E, Address Base, llvm::Value *MemPtr, const MemberPointerType *MPT, bool IsInBounds)
Calculate an l-value from an object and a data member pointer.
Definition: CGCXXABI.cpp:63
virtual const CXXRecordDecl * getThisArgumentTypeForMethod(GlobalDecl GD)
Get the type of the implicit "this" parameter used by a method.
Definition: CGCXXABI.h:395
llvm::Value * loadIncomingCXXThis(CodeGenFunction &CGF)
Loads the incoming C++ this pointer as it was passed by the caller.
Definition: CGCXXABI.cpp:150
virtual void EmitDestructorCall(CodeGenFunction &CGF, const CXXDestructorDecl *DD, CXXDtorType Type, bool ForVirtualBase, bool Delegating, Address This, QualType ThisTy)=0
Emit the destructor call.
virtual llvm::GlobalVariable * getAddrOfVTable(const CXXRecordDecl *RD, CharUnits VPtrOffset)=0
Get the address of the vtable for the given record decl which should be used for the vptr at the give...
void ErrorUnsupportedABI(CodeGenFunction &CGF, StringRef S)
Issue a diagnostic about unsupported features in the ABI.
Definition: CGCXXABI.cpp:29
virtual bool EmitBadCastCall(CodeGenFunction &CGF)=0
virtual void adjustCallArgsForDestructorThunk(CodeGenFunction &CGF, GlobalDecl GD, CallArgList &CallArgs)
Definition: CGCXXABI.h:502
virtual llvm::Constant * EmitMemberDataPointer(const MemberPointerType *MPT, CharUnits offset)
Create a member pointer for the given field.
Definition: CGCXXABI.cpp:112
virtual llvm::Value * EmitTypeid(CodeGenFunction &CGF, QualType SrcRecordTy, Address ThisPtr, llvm::Type *StdTypeInfoPtrTy)=0
virtual void emitVirtualInheritanceTables(const CXXRecordDecl *RD)=0
Emit any tables needed to implement virtual inheritance.
llvm::Value * getThisValue(CodeGenFunction &CGF)
Definition: CGCXXABI.h:57
llvm::Constant * GetBogusMemberPointer(QualType T)
Get a null value for unsupported member pointers.
Definition: CGCXXABI.cpp:38
virtual void emitVTableDefinitions(CodeGenVTables &CGVT, const CXXRecordDecl *RD)=0
Emits the VTable definitions required for the given record type.
virtual CGCallee EmitLoadOfMemberFunctionPointer(CodeGenFunction &CGF, const Expr *E, Address This, llvm::Value *&ThisPtrForCall, llvm::Value *MemPtr, const MemberPointerType *MPT)
Load a member function from an object and a member function pointer.
Definition: CGCXXABI.cpp:47
virtual bool isPermittedToBeHomogeneousAggregate(const CXXRecordDecl *RD) const
Returns true if the ABI permits the argument to be a homogeneous aggregate.
Definition: CGCXXABI.h:174
virtual void emitCXXStructor(GlobalDecl GD)=0
Emit a single constructor/destructor with the given type from a C++ constructor Decl.
virtual llvm::Value * EmitVirtualDestructorCall(CodeGenFunction &CGF, const CXXDestructorDecl *Dtor, CXXDtorType DtorType, Address This, DeleteOrMemberCallExpr E, llvm::CallBase **CallOrInvoke)=0
Emit the ABI-specific virtual destructor call.
virtual CharUnits GetArrayCookieSize(const CXXNewExpr *expr)
Returns the extra size required in order to store the array cookie for the given new-expression.
Definition: CGCXXABI.cpp:210
virtual bool exportThunk()=0
virtual void EmitBadTypeidCall(CodeGenFunction &CGF)=0
virtual llvm::Value * emitDynamicCastToVoid(CodeGenFunction &CGF, Address Value, QualType SrcRecordTy)=0
virtual bool isZeroInitializable(const MemberPointerType *MPT)
Return true if the given member pointer can be zero-initialized (in the C++ sense) with an LLVM zeroi...
Definition: CGCXXABI.cpp:121
AddedStructorArgCounts addImplicitConstructorArgs(CodeGenFunction &CGF, const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating, CallArgList &Args)
Add any ABI-specific implicit arguments needed to call a constructor.
Definition: CGCXXABI.cpp:341
virtual llvm::Value * EmitMemberPointerConversion(CodeGenFunction &CGF, const CastExpr *E, llvm::Value *Src)
Perform a derived-to-base, base-to-derived, or bitcast member pointer conversion.
Definition: CGCXXABI.cpp:72
virtual llvm::Constant * EmitMemberFunctionPointer(const CXXMethodDecl *MD)
Create a member pointer for the given method.
Definition: CGCXXABI.cpp:107
virtual llvm::Value * emitDynamicCastCall(CodeGenFunction &CGF, Address Value, QualType SrcRecordTy, QualType DestTy, QualType DestRecordTy, llvm::BasicBlock *CastEnd)=0
virtual llvm::GlobalVariable * getThrowInfo(QualType T)
Definition: CGCXXABI.h:259
virtual llvm::GlobalValue::LinkageTypes getCXXDestructorLinkage(GVALinkage Linkage, const CXXDestructorDecl *Dtor, CXXDtorType DT) const
Definition: CGCXXABI.cpp:316
virtual Address InitializeArrayCookie(CodeGenFunction &CGF, Address NewPtr, llvm::Value *NumElements, const CXXNewExpr *expr, QualType ElementType)
Initialize the array cookie for the given allocation.
Definition: CGCXXABI.cpp:221
ASTContext & getContext() const
Definition: CGCXXABI.h:81
virtual bool shouldDynamicCastCallBeNullChecked(bool SrcIsPtr, QualType SrcRecordTy)=0
virtual AddedStructorArgCounts buildStructorSignature(GlobalDecl GD, SmallVectorImpl< CanQualType > &ArgTys)=0
Build the signature of the given constructor or destructor variant by adding any required parameters.
virtual llvm::Value * emitExactDynamicCast(CodeGenFunction &CGF, Address Value, QualType SrcRecordTy, QualType DestTy, QualType DestRecordTy, const ExactDynamicCastInfo &CastInfo, llvm::BasicBlock *CastSuccess, llvm::BasicBlock *CastFail)=0
Emit a dynamic_cast from SrcRecordTy to DestRecordTy.
MangleContext & getMangleContext()
Gets the mangle context.
Definition: CGCXXABI.h:113
virtual AddedStructorArgs getImplicitConstructorArgs(CodeGenFunction &CGF, const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating)=0
All available information about a concrete callee.
Definition: CGCall.h:63
CGFunctionInfo - Class to encapsulate the information about a function definition.
CallArgList - Type for representing both the value and type of arguments in a call.
Definition: CGCall.h:274
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
llvm::BasicBlock * createBasicBlock(const Twine &name="", llvm::Function *parent=nullptr, llvm::BasicBlock *before=nullptr)
createBasicBlock - Create an LLVM basic block.
void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)
EmitBlock - Emit the given block.
Definition: CGStmt.cpp:652
This class organizes the cross-function state that is used while generating LLVM code.
ASTContext & getContext() const
const CodeGenOptions & getCodeGenOpts() const
Information for lazily generating a cleanup.
Definition: EHScopeStack.h:146
FunctionArgList - Type for representing both the decl and type of parameters to a function.
Definition: CGCall.h:375
LValue - This represents an lvalue references.
Definition: CGValue.h:182
RValue - This trivial value class is used to represent the result of an expression that is evaluated.
Definition: CGValue.h:42
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:2109
This represents one expression.
Definition: Expr.h:112
GlobalDecl - represents a global declaration.
Definition: GlobalDecl.h:57
CXXDtorType getDtorType() const
Definition: GlobalDecl.h:113
const Decl * getDecl() const
Definition: GlobalDecl.h:106
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
Definition: Mangle.h:52
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: TypeBase.h:3669
A (possibly-)qualified type.
Definition: TypeBase.h:937
Encodes a location in the source.
The base class of the type hierarchy.
Definition: TypeBase.h:1833
Represents a variable declaration or definition.
Definition: Decl.h:925
CGCXXABI * CreateMicrosoftCXXABI(CodeGenModule &CGM)
Creates a Microsoft-family ABI.
CGCXXABI * CreateItaniumCXXABI(CodeGenModule &CGM)
Creates an Itanium-family ABI.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
The JSON file list parser is used to communicate input to InstallAPI.
CXXCtorType
C++ constructor types.
Definition: ABI.h:24
GVALinkage
A more specific kind of linkage than enum Linkage.
Definition: Linkage.h:72
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
Definition: Linkage.h:24
CXXDtorType
C++ destructor types.
Definition: ABI.h:33
@ Dtor_Deleting
Deleting dtor.
Definition: ABI.h:34
const FunctionProtoType * T
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30
Similar to AddedStructorArgs, but only notes the number of additional arguments.
Definition: CGCXXABI.h:358
static AddedStructorArgCounts suffix(unsigned N)
Definition: CGCXXABI.h:364
static AddedStructorArgCounts prefix(unsigned N)
Definition: CGCXXABI.h:363
AddedStructorArgCounts(unsigned P, unsigned S)
Definition: CGCXXABI.h:362
Additional implicit arguments to add to the beginning (Prefix) and end (Suffix) of a constructor / de...
Definition: CGCXXABI.h:338
AddedStructorArgs(SmallVector< Arg, 1 > P, SmallVector< Arg, 1 > S)
Definition: CGCXXABI.h:346
static AddedStructorArgs prefix(SmallVector< Arg, 1 > Args)
Definition: CGCXXABI.h:348
static AddedStructorArgs suffix(SmallVector< Arg, 1 > Args)
Definition: CGCXXABI.h:351
void Emit(CodeGenFunction &CGF, Flags flags) override
Emit the cleanup.
Definition: CGCXXABI.h:684
CatchRetScope(llvm::CatchPadInst *CPI)
Definition: CGCXXABI.h:682
llvm::CatchPadInst * CPI
Definition: CGCXXABI.h:680
The MS C++ ABI needs a pointer to RTTI data plus some flags to describe the type of a catch handler,...
Definition: CGCleanup.h:39
Struct with all information about dynamic [sub]class needed to set vptr.
A return adjustment.
Definition: Thunk.h:27
The this pointer adjustment as well as an optional return adjustment for a thunk.
Definition: Thunk.h:157