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