clang  10.0.0git
CGCXXABI.cpp
Go to the documentation of this file.
1 //===----- CGCXXABI.cpp - Interface to C++ ABIs ---------------------------===//
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 #include "CGCXXABI.h"
15 #include "CGCleanup.h"
16 #include "clang/AST/Attr.h"
17 
18 using namespace clang;
19 using namespace CodeGen;
20 
22 
24  DiagnosticsEngine &Diags = CGF.CGM.getDiags();
25  unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
26  "cannot yet compile %0 in this ABI");
28  DiagID)
29  << S;
30 }
31 
33  return llvm::Constant::getNullValue(CGM.getTypes().ConvertType(T));
34 }
35 
36 llvm::Type *
39 }
40 
42  CodeGenFunction &CGF, const Expr *E, Address This,
43  llvm::Value *&ThisPtrForCall,
44  llvm::Value *MemPtr, const MemberPointerType *MPT) {
45  ErrorUnsupportedABI(CGF, "calls through member pointers");
46 
47  ThisPtrForCall = This.getPointer();
48  const FunctionProtoType *FPT =
50  const auto *RD =
51  cast<CXXRecordDecl>(MPT->getClass()->castAs<RecordType>()->getDecl());
52  llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(
53  CGM.getTypes().arrangeCXXMethodType(RD, FPT, /*FD=*/nullptr));
54  llvm::Constant *FnPtr = llvm::Constant::getNullValue(FTy->getPointerTo());
55  return CGCallee::forDirect(FnPtr, FPT);
56 }
57 
60  Address Base, llvm::Value *MemPtr,
61  const MemberPointerType *MPT) {
62  ErrorUnsupportedABI(CGF, "loads of member pointers");
63  llvm::Type *Ty = CGF.ConvertType(MPT->getPointeeType())
64  ->getPointerTo(Base.getAddressSpace());
65  return llvm::Constant::getNullValue(Ty);
66 }
67 
69  const CastExpr *E,
70  llvm::Value *Src) {
71  ErrorUnsupportedABI(CGF, "member function pointer conversions");
72  return GetBogusMemberPointer(E->getType());
73 }
74 
76  llvm::Constant *Src) {
77  return GetBogusMemberPointer(E->getType());
78 }
79 
82  llvm::Value *L,
83  llvm::Value *R,
84  const MemberPointerType *MPT,
85  bool Inequality) {
86  ErrorUnsupportedABI(CGF, "member function pointer comparison");
87  return CGF.Builder.getFalse();
88 }
89 
92  llvm::Value *MemPtr,
93  const MemberPointerType *MPT) {
94  ErrorUnsupportedABI(CGF, "member function pointer null testing");
95  return CGF.Builder.getFalse();
96 }
97 
98 llvm::Constant *
100  return GetBogusMemberPointer(QualType(MPT, 0));
101 }
102 
105  MD->getType(), MD->getParent()->getTypeForDecl()));
106 }
107 
109  CharUnits offset) {
110  return GetBogusMemberPointer(QualType(MPT, 0));
111 }
112 
113 llvm::Constant *CGCXXABI::EmitMemberPointer(const APValue &MP, QualType MPT) {
114  return GetBogusMemberPointer(MPT);
115 }
116 
118  // Fake answer.
119  return true;
120 }
121 
123  const CXXMethodDecl *MD = cast<CXXMethodDecl>(CGF.CurGD.getDecl());
124 
125  // FIXME: I'm not entirely sure I like using a fake decl just for code
126  // generation. Maybe we can come up with a better way?
127  auto *ThisDecl = ImplicitParamDecl::Create(
128  CGM.getContext(), nullptr, MD->getLocation(),
129  &CGM.getContext().Idents.get("this"), MD->getThisType(),
131  params.push_back(ThisDecl);
132  CGF.CXXABIThisDecl = ThisDecl;
133 
134  // Compute the presumed alignment of 'this', which basically comes
135  // down to whether we know it's a complete object or not.
136  auto &Layout = CGF.getContext().getASTRecordLayout(MD->getParent());
137  if (MD->getParent()->getNumVBases() == 0 || // avoid vcall in common case
138  MD->getParent()->hasAttr<FinalAttr>() ||
139  !isThisCompleteObject(CGF.CurGD)) {
140  CGF.CXXABIThisAlignment = Layout.getAlignment();
141  } else {
142  CGF.CXXABIThisAlignment = Layout.getNonVirtualAlignment();
143  }
144 }
145 
147  return CGF.Builder.CreateLoad(CGF.GetAddrOfLocalVar(getThisDecl(CGF)),
148  "this");
149 }
150 
152  /// Initialize the 'this' slot.
153  assert(getThisDecl(CGF) && "no 'this' variable for function");
154  CGF.CXXABIThisValue = ThisPtr;
155 }
156 
158  RValue RV, QualType ResultType) {
159  CGF.EmitReturnOfRValue(RV, ResultType);
160 }
161 
163  if (!requiresArrayCookie(expr))
164  return CharUnits::Zero();
166 }
167 
169  // BOGUS
170  return CharUnits::Zero();
171 }
172 
174  Address NewPtr,
175  llvm::Value *NumElements,
176  const CXXNewExpr *expr,
177  QualType ElementType) {
178  // Should never be called.
179  ErrorUnsupportedABI(CGF, "array cookie initialization");
180  return Address::invalid();
181 }
182 
184  QualType elementType) {
185  // If the class's usual deallocation function takes two arguments,
186  // it needs a cookie.
187  if (expr->doesUsualArrayDeleteWantSize())
188  return true;
189 
190  return elementType.isDestructedType();
191 }
192 
194  // If the class's usual deallocation function takes two arguments,
195  // it needs a cookie.
196  if (expr->doesUsualArrayDeleteWantSize())
197  return true;
198 
199  return expr->getAllocatedType().isDestructedType();
200 }
201 
203  const CXXDeleteExpr *expr, QualType eltTy,
204  llvm::Value *&numElements,
205  llvm::Value *&allocPtr, CharUnits &cookieSize) {
206  // Derive a char* in the same address space as the pointer.
207  ptr = CGF.Builder.CreateElementBitCast(ptr, CGF.Int8Ty);
208 
209  // If we don't need an array cookie, bail out early.
210  if (!requiresArrayCookie(expr, eltTy)) {
211  allocPtr = ptr.getPointer();
212  numElements = nullptr;
213  cookieSize = CharUnits::Zero();
214  return;
215  }
216 
217  cookieSize = getArrayCookieSizeImpl(eltTy);
218  Address allocAddr =
219  CGF.Builder.CreateConstInBoundsByteGEP(ptr, -cookieSize);
220  allocPtr = allocAddr.getPointer();
221  numElements = readArrayCookieImpl(CGF, allocAddr, cookieSize);
222 }
223 
225  Address ptr,
226  CharUnits cookieSize) {
227  ErrorUnsupportedABI(CGF, "reading a new[] cookie");
228  return llvm::ConstantInt::get(CGF.SizeTy, 0);
229 }
230 
231 /// Returns the adjustment, in bytes, required for the given
232 /// member-pointer operation. Returns null if no adjustment is
233 /// required.
235  assert(E->getCastKind() == CK_DerivedToBaseMemberPointer ||
236  E->getCastKind() == CK_BaseToDerivedMemberPointer);
237 
238  QualType derivedType;
239  if (E->getCastKind() == CK_DerivedToBaseMemberPointer)
240  derivedType = E->getSubExpr()->getType();
241  else
242  derivedType = E->getType();
243 
244  const CXXRecordDecl *derivedClass =
245  derivedType->castAs<MemberPointerType>()->getClass()->getAsCXXRecordDecl();
246 
247  return CGM.GetNonVirtualBaseClassOffset(derivedClass,
248  E->path_begin(),
249  E->path_end());
250 }
251 
253  // TODO: Store base specifiers in APValue member pointer paths so we can
254  // easily reuse CGM.GetNonVirtualBaseClassOffset().
255  const ValueDecl *MPD = MP.getMemberPointerDecl();
258  bool DerivedMember = MP.isMemberPointerToDerivedMember();
259  const CXXRecordDecl *RD = cast<CXXRecordDecl>(MPD->getDeclContext());
260  for (unsigned I = 0, N = Path.size(); I != N; ++I) {
261  const CXXRecordDecl *Base = RD;
262  const CXXRecordDecl *Derived = Path[I];
263  if (DerivedMember)
264  std::swap(Base, Derived);
265  ThisAdjustment +=
267  RD = Path[I];
268  }
269  if (DerivedMember)
270  ThisAdjustment = -ThisAdjustment;
271  return ThisAdjustment;
272 }
273 
274 llvm::BasicBlock *
276  const CXXRecordDecl *RD) {
278  llvm_unreachable("shouldn't be called in this ABI");
279 
280  ErrorUnsupportedABI(CGF, "complete object detection in ctor");
281  return nullptr;
282 }
283 
284 void CGCXXABI::setCXXDestructorDLLStorage(llvm::GlobalValue *GV,
285  const CXXDestructorDecl *Dtor,
286  CXXDtorType DT) const {
287  // Assume the base C++ ABI has no special rules for destructor variants.
288  CGM.setDLLImportDLLExport(GV, Dtor);
289 }
290 
291 llvm::GlobalValue::LinkageTypes CGCXXABI::getCXXDestructorLinkage(
292  GVALinkage Linkage, const CXXDestructorDecl *Dtor, CXXDtorType DT) const {
293  // Delegate back to CGM by default.
294  return CGM.getLLVMLinkageForDeclarator(Dtor, Linkage,
295  /*IsConstantVariable=*/false);
296 }
297 
299  return false;
300 }
301 
302 llvm::CallInst *
304  llvm::Value *Exn) {
305  // Just call std::terminate and ignore the violating exception.
306  return CGF.EmitNounwindRuntimeCall(CGF.CGM.getTerminateFn());
307 }
308 
310  return CatchTypeInfo{nullptr, 0};
311 }
312 
313 std::vector<CharUnits> CGCXXABI::getVBPtrOffsets(const CXXRecordDecl *RD) {
314  return std::vector<CharUnits>();
315 }
virtual llvm::Constant * EmitMemberPointer(const APValue &MP, QualType MPT)
Create a member pointer for the given member pointer constant.
Definition: CGCXXABI.cpp:113
A (possibly-)qualified type.
Definition: Type.h:654
virtual void EmitReturnFromThunk(CodeGenFunction &CGF, RValue RV, QualType ResultType)
Definition: CGCXXABI.cpp:157
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D...
CharUnits getBaseClassOffset(const CXXRecordDecl *Base) const
getBaseClassOffset - Get the offset, in chars, for the given base class.
Definition: RecordLayout.h:232
unsigned getNumVBases() const
Retrieves the number of virtual base classes of this class.
Definition: DeclCXX.h:602
QualType getThisType() const
Return the type of the this pointer.
Definition: DeclCXX.cpp:2352
virtual void setCXXDestructorDLLStorage(llvm::GlobalValue *GV, const CXXDestructorDecl *Dtor, CXXDtorType DT) const
Definition: CGCXXABI.cpp:284
const Type * getTypeForDecl() const
Definition: Decl.h:3053
const CGFunctionInfo & arrangeCXXMethodType(const CXXRecordDecl *RD, const FunctionProtoType *FTP, const CXXMethodDecl *MD)
Arrange the argument and result information for a call to an unknown C++ non-static member function o...
Definition: CGCall.cpp:251
const Decl * CurCodeDecl
CurCodeDecl - This is the inner-most code context, which includes blocks.
Parameter for C++ &#39;this&#39; argument.
Definition: Decl.h:1546
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Definition: Diagnostic.h:1300
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64
virtual llvm::BasicBlock * EmitCtorCompleteObjectHandler(CodeGenFunction &CGF, const CXXRecordDecl *RD)
Definition: CGCXXABI.cpp:275
Address GetAddrOfLocalVar(const VarDecl *VD)
GetAddrOfLocalVar - Return the address of a local variable.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
const T * getAs() const
Member-template getAs<specific type>&#39;.
Definition: Type.h:7002
bool This(InterpState &S, CodePtr OpPC)
Definition: Interp.h:827
A this pointer adjustment.
Definition: ABI.h:107
llvm::FunctionCallee getTerminateFn()
Get the declaration of std::terminate for the platform.
Definition: CGException.cpp:50
Address CreateConstInBoundsByteGEP(Address Addr, CharUnits Offset, const llvm::Twine &Name="")
Given a pointer to i8, adjust it by a given constant offset.
Definition: CGBuilder.h:244
DiagnosticsEngine & getDiags() const
QualType getMemberPointerType(QualType T, const Type *Cls) const
Return the uniqued reference to the type for a member pointer to the specified type in the specified ...
llvm::Value * getPointer() const
Definition: Address.h:37
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
Definition: Linkage.h:23
unsigned getAddressSpace() const
Return the address space that this address resides in.
Definition: Address.h:56
const ValueDecl * getMemberPointerDecl() const
Definition: APValue.cpp:798
virtual bool requiresArrayCookie(const CXXDeleteExpr *E, QualType eltType)
Definition: CGCXXABI.cpp:183
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
Definition: TargetInfo.h:1063
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
llvm::Type * ConvertType(QualType T)
ConvertType - Convert type T into a llvm::Type.
virtual bool isThisCompleteObject(GlobalDecl GD) const =0
Determine whether there&#39;s something special about the rules of the ABI tell us that &#39;this&#39; is a compl...
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
Definition: CharUnits.h:53
Expr * getSubExpr()
Definition: Expr.h:3202
IdentifierTable & Idents
Definition: ASTContext.h:580
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:59
Address CreateElementBitCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
Cast the element type of the given address to a different type, preserving information like the align...
Definition: CGBuilder.h:156
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2395
bool hasConstructorVariants() const
Does this ABI have different entrypoints for complete-object and base-subobject constructors?
Definition: TargetCXXABI.h:223
path_iterator path_begin()
Definition: Expr.h:3222
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:149
const Type * getClass() const
Definition: Type.h:2867
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:91
CodeGenModule & CGM
Definition: CGCXXABI.h:45
ImplicitParamDecl * getThisDecl(CodeGenFunction &CGF)
Definition: CGCXXABI.h:52
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3150
GlobalDecl CurGD
CurGD - The GlobalDecl for the current function being compiled.
virtual llvm::GlobalValue::LinkageTypes getCXXDestructorLinkage(GVALinkage Linkage, const CXXDestructorDecl *Dtor, CXXDtorType DT) const
Definition: CGCXXABI.cpp:291
virtual llvm::Type * ConvertMemberPointerType(const MemberPointerType *MPT)
Find the LLVM type used to represent the given member pointer type.
Definition: CGCXXABI.cpp:37
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:117
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, ImplicitParamKind ParamKind)
Create implicit parameter.
Definition: Decl.cpp:4685
bool hasAttr() const
Definition: DeclBase.h:542
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
Definition: Type.cpp:1690
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3754
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:162
RValue - This trivial value class is used to represent the result of an expression that is evaluated...
Definition: CGValue.h:39
CXXDtorType
C++ destructor types.
Definition: ABI.h:33
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:619
This represents one expression.
Definition: Expr.h:108
static Address invalid()
Definition: Address.h:34
virtual CharUnits getArrayCookieSizeImpl(QualType elementType)
Returns the extra size required in order to store the array cookie for the given type.
Definition: CGCXXABI.cpp:168
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:202
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:7067
static CGCallee forDirect(llvm::Constant *functionPtr, const CGCalleeInfo &abstractInfo=CGCalleeInfo())
Definition: CGCall.h:133
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2649
DeclContext * getDeclContext()
Definition: DeclBase.h:438
QualType getType() const
Definition: Expr.h:137
virtual llvm::Constant * EmitMemberFunctionPointer(const CXXMethodDecl *MD)
Create a member pointer for the given method.
Definition: CGCXXABI.cpp:103
ASTContext & getContext() const
Definition: CGCXXABI.h:80
void ErrorUnsupportedABI(CodeGenFunction &CGF, StringRef S)
Issue a diagnostic about unsupported features in the ABI.
Definition: CGCXXABI.cpp:23
const TargetInfo & getTarget() const
ASTContext & getContext() const
GlobalDecl - represents a global declaration.
Definition: GlobalDecl.h:40
The l-value was considered opaque, so the alignment was determined from a type.
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:68
virtual bool NeedsVTTParameter(GlobalDecl GD)
Return whether the given global decl needs a VTT parameter.
Definition: CGCXXABI.cpp:298
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
void setCXXABIThisValue(CodeGenFunction &CGF, llvm::Value *ThisPtr)
Definition: CGCXXABI.cpp:151
CastKind getCastKind() const
Definition: Expr.h:3196
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2100
const Decl * getDecl() const
Definition: GlobalDecl.h:77
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1931
virtual CatchTypeInfo getCatchAllTypeInfo()
Definition: CGCXXABI.cpp:309
QualType getAllocatedType() const
Definition: ExprCXX.h:2193
llvm::Value * loadIncomingCXXThis(CodeGenFunction &CGF)
Loads the incoming C++ this pointer as it was passed by the caller.
Definition: CGCXXABI.cpp:146
An aligned address.
Definition: Address.h:24
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after...
Definition: Type.h:1174
unsigned getCustomDiagID(Level L, const char(&FormatString)[N])
Return an ID for a diagnostic with the specified format string and level.
Definition: Diagnostic.h:782
All available information about a concrete callee.
Definition: CGCall.h:66
virtual llvm::Constant * EmitNullMemberPointer(const MemberPointerType *MPT)
Create a null member pointer of the given type.
Definition: CGCXXABI.cpp:99
bool isMemberPointerToDerivedMember() const
Definition: APValue.cpp:805
The MS C++ ABI needs a pointer to RTTI data plus some flags to describe the type of a catch handler...
Definition: CGCleanup.h:37
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:173
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:234
FunctionArgList - Type for representing both the decl and type of parameters to a function...
Definition: CGCall.h:355
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:81
Dataflow Directional Tag Classes.
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2359
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:224
llvm::LoadInst * CreateLoad(Address Addr, const llvm::Twine &Name="")
Definition: CGBuilder.h:69
const CXXRecordDecl * getParent() const
Return the parent of this method declaration, which is the class in which this method is defined...
Definition: DeclCXX.h:2046
void buildThisParam(CodeGenFunction &CGF, FunctionArgList &Params)
Build a parameter variable suitable for &#39;this&#39;.
Definition: CGCXXABI.cpp:122
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:2833
ArrayRef< const CXXRecordDecl * > getMemberPointerPath() const
Definition: APValue.cpp:812
path_iterator path_end()
Definition: Expr.h:3223
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:4495
virtual llvm::Constant * EmitMemberDataPointer(const MemberPointerType *MPT, CharUnits offset)
Create a member pointer for the given field.
Definition: CGCXXABI.cpp:108
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2298
llvm::Constant * GetNonVirtualBaseClassOffset(const CXXRecordDecl *ClassDecl, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd)
Returns the offset from a derived class to a class.
Definition: CGClass.cpp:178
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
Definition: APValue.h:115
Represents a C++ struct/union/class.
Definition: DeclCXX.h:253
llvm::Type * ConvertType(QualType T)
virtual llvm::CallInst * emitTerminateForUnexpectedException(CodeGenFunction &CGF, llvm::Value *Exn)
Definition: CGCXXABI.cpp:303
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
GVALinkage
A more specific kind of linkage than enum Linkage.
Definition: Linkage.h:73
virtual std::vector< CharUnits > getVBPtrOffsets(const CXXRecordDecl *RD)
Gets the offsets of all the virtual base pointers in a given class.
Definition: CGCXXABI.cpp:313
QualType getType() const
Definition: Decl.h:630
llvm::CallInst * EmitNounwindRuntimeCall(llvm::FunctionCallee callee, const Twine &name="")
FullSourceLoc getFullLoc(SourceLocation Loc) const
Definition: ASTContext.h:736
llvm::Constant * GetBogusMemberPointer(QualType T)
Get a null value for unsupported member pointers.
Definition: CGCXXABI.cpp:32
llvm::GlobalValue::LinkageTypes getLLVMLinkageForDeclarator(const DeclaratorDecl *D, GVALinkage Linkage, bool IsConstantVariable)
Returns LLVM linkage for a declarator.
SourceLocation getLocation() const
Definition: DeclBase.h:429
QualType getPointeeType() const
Definition: Type.h:2853
CharUnits getMemberPointerPathAdjustment(const APValue &MP)
Computes the non-virtual adjustment needed for a member pointer conversion along an inheritance path ...
Definition: CGCXXABI.cpp:252
void setDLLImportDLLExport(llvm::GlobalValue *GV, GlobalDecl D) const
llvm::FunctionType * GetFunctionType(const CGFunctionInfo &Info)
GetFunctionType - Get the LLVM function type for.
Definition: CGCall.cpp:1556