clang  7.0.0svn
Go to the documentation of this file.
1 //===----- CGCXXABI.cpp - Interface to C++ ABIs ---------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This provides an abstract class for C++ code generation. Concrete subclasses
11 // of this implement code generation for specific C++ ABIs.
12 //
13 //===----------------------------------------------------------------------===//
15 #include "CGCXXABI.h"
16 #include "CGCleanup.h"
18 using namespace clang;
19 using namespace CodeGen;
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 }
33  // We can only copy the argument if there exists at least one trivial,
34  // non-deleted copy or move constructor.
35  return RD->canPassInRegisters();
36 }
39  return llvm::Constant::getNullValue(CGM.getTypes().ConvertType(T));
40 }
42 llvm::Type *
45 }
48  CodeGenFunction &CGF, const Expr *E, Address This,
49  llvm::Value *&ThisPtrForCall,
50  llvm::Value *MemPtr, const MemberPointerType *MPT) {
51  ErrorUnsupportedABI(CGF, "calls through member pointers");
53  ThisPtrForCall = This.getPointer();
54  const FunctionProtoType *FPT =
56  const CXXRecordDecl *RD =
57  cast<CXXRecordDecl>(MPT->getClass()->getAs<RecordType>()->getDecl());
58  llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(
59  CGM.getTypes().arrangeCXXMethodType(RD, FPT, /*FD=*/nullptr));
60  llvm::Constant *FnPtr = llvm::Constant::getNullValue(FTy->getPointerTo());
61  return CGCallee::forDirect(FnPtr, FPT);
62 }
66  Address Base, llvm::Value *MemPtr,
67  const MemberPointerType *MPT) {
68  ErrorUnsupportedABI(CGF, "loads of member pointers");
69  llvm::Type *Ty = CGF.ConvertType(MPT->getPointeeType())
70  ->getPointerTo(Base.getAddressSpace());
71  return llvm::Constant::getNullValue(Ty);
72 }
75  const CastExpr *E,
76  llvm::Value *Src) {
77  ErrorUnsupportedABI(CGF, "member function pointer conversions");
78  return GetBogusMemberPointer(E->getType());
79 }
82  llvm::Constant *Src) {
83  return GetBogusMemberPointer(E->getType());
84 }
88  llvm::Value *L,
89  llvm::Value *R,
90  const MemberPointerType *MPT,
91  bool Inequality) {
92  ErrorUnsupportedABI(CGF, "member function pointer comparison");
93  return CGF.Builder.getFalse();
94 }
98  llvm::Value *MemPtr,
99  const MemberPointerType *MPT) {
100  ErrorUnsupportedABI(CGF, "member function pointer null testing");
101  return CGF.Builder.getFalse();
102 }
104 llvm::Constant *
106  return GetBogusMemberPointer(QualType(MPT, 0));
107 }
111  MD->getType(), MD->getParent()->getTypeForDecl()));
112 }
115  CharUnits offset) {
116  return GetBogusMemberPointer(QualType(MPT, 0));
117 }
119 llvm::Constant *CGCXXABI::EmitMemberPointer(const APValue &MP, QualType MPT) {
120  return GetBogusMemberPointer(MPT);
121 }
124  // Fake answer.
125  return true;
126 }
129  const CXXMethodDecl *MD = cast<CXXMethodDecl>(CGF.CurGD.getDecl());
131  // FIXME: I'm not entirely sure I like using a fake decl just for code
132  // generation. Maybe we can come up with a better way?
133  auto *ThisDecl = ImplicitParamDecl::Create(
134  CGM.getContext(), nullptr, MD->getLocation(),
135  &CGM.getContext().Idents.get("this"), MD->getThisType(CGM.getContext()),
137  params.push_back(ThisDecl);
138  CGF.CXXABIThisDecl = ThisDecl;
140  // Compute the presumed alignment of 'this', which basically comes
141  // down to whether we know it's a complete object or not.
142  auto &Layout = CGF.getContext().getASTRecordLayout(MD->getParent());
143  if (MD->getParent()->getNumVBases() == 0 || // avoid vcall in common case
144  MD->getParent()->hasAttr<FinalAttr>() ||
145  !isThisCompleteObject(CGF.CurGD)) {
146  CGF.CXXABIThisAlignment = Layout.getAlignment();
147  } else {
148  CGF.CXXABIThisAlignment = Layout.getNonVirtualAlignment();
149  }
150 }
153  return CGF.Builder.CreateLoad(CGF.GetAddrOfLocalVar(getThisDecl(CGF)),
154  "this");
155 }
158  /// Initialize the 'this' slot.
159  assert(getThisDecl(CGF) && "no 'this' variable for function");
160  CGF.CXXABIThisValue = ThisPtr;
161 }
164  RValue RV, QualType ResultType) {
165  CGF.EmitReturnOfRValue(RV, ResultType);
166 }
169  if (!requiresArrayCookie(expr))
170  return CharUnits::Zero();
172 }
175  // BOGUS
176  return CharUnits::Zero();
177 }
180  Address NewPtr,
181  llvm::Value *NumElements,
182  const CXXNewExpr *expr,
183  QualType ElementType) {
184  // Should never be called.
185  ErrorUnsupportedABI(CGF, "array cookie initialization");
186  return Address::invalid();
187 }
190  QualType elementType) {
191  // If the class's usual deallocation function takes two arguments,
192  // it needs a cookie.
193  if (expr->doesUsualArrayDeleteWantSize())
194  return true;
196  return elementType.isDestructedType();
197 }
200  // If the class's usual deallocation function takes two arguments,
201  // it needs a cookie.
202  if (expr->doesUsualArrayDeleteWantSize())
203  return true;
205  return expr->getAllocatedType().isDestructedType();
206 }
209  const CXXDeleteExpr *expr, QualType eltTy,
210  llvm::Value *&numElements,
211  llvm::Value *&allocPtr, CharUnits &cookieSize) {
212  // Derive a char* in the same address space as the pointer.
213  ptr = CGF.Builder.CreateElementBitCast(ptr, CGF.Int8Ty);
215  // If we don't need an array cookie, bail out early.
216  if (!requiresArrayCookie(expr, eltTy)) {
217  allocPtr = ptr.getPointer();
218  numElements = nullptr;
219  cookieSize = CharUnits::Zero();
220  return;
221  }
223  cookieSize = getArrayCookieSizeImpl(eltTy);
224  Address allocAddr =
225  CGF.Builder.CreateConstInBoundsByteGEP(ptr, -cookieSize);
226  allocPtr = allocAddr.getPointer();
227  numElements = readArrayCookieImpl(CGF, allocAddr, cookieSize);
228 }
231  Address ptr,
232  CharUnits cookieSize) {
233  ErrorUnsupportedABI(CGF, "reading a new[] cookie");
234  return llvm::ConstantInt::get(CGF.SizeTy, 0);
235 }
237 /// Returns the adjustment, in bytes, required for the given
238 /// member-pointer operation. Returns null if no adjustment is
239 /// required.
241  assert(E->getCastKind() == CK_DerivedToBaseMemberPointer ||
242  E->getCastKind() == CK_BaseToDerivedMemberPointer);
244  QualType derivedType;
245  if (E->getCastKind() == CK_DerivedToBaseMemberPointer)
246  derivedType = E->getSubExpr()->getType();
247  else
248  derivedType = E->getType();
250  const CXXRecordDecl *derivedClass =
251  derivedType->castAs<MemberPointerType>()->getClass()->getAsCXXRecordDecl();
253  return CGM.GetNonVirtualBaseClassOffset(derivedClass,
254  E->path_begin(),
255  E->path_end());
256 }
259  // TODO: Store base specifiers in APValue member pointer paths so we can
260  // easily reuse CGM.GetNonVirtualBaseClassOffset().
261  const ValueDecl *MPD = MP.getMemberPointerDecl();
264  bool DerivedMember = MP.isMemberPointerToDerivedMember();
265  const CXXRecordDecl *RD = cast<CXXRecordDecl>(MPD->getDeclContext());
266  for (unsigned I = 0, N = Path.size(); I != N; ++I) {
267  const CXXRecordDecl *Base = RD;
268  const CXXRecordDecl *Derived = Path[I];
269  if (DerivedMember)
270  std::swap(Base, Derived);
271  ThisAdjustment +=
273  RD = Path[I];
274  }
275  if (DerivedMember)
276  ThisAdjustment = -ThisAdjustment;
277  return ThisAdjustment;
278 }
280 llvm::BasicBlock *
282  const CXXRecordDecl *RD) {
284  llvm_unreachable("shouldn't be called in this ABI");
286  ErrorUnsupportedABI(CGF, "complete object detection in ctor");
287  return nullptr;
288 }
290 void CGCXXABI::setCXXDestructorDLLStorage(llvm::GlobalValue *GV,
291  const CXXDestructorDecl *Dtor,
292  CXXDtorType DT) const {
293  // Assume the base C++ ABI has no special rules for destructor variants.
294  CGM.setDLLImportDLLExport(GV, Dtor);
295 }
297 llvm::GlobalValue::LinkageTypes CGCXXABI::getCXXDestructorLinkage(
298  GVALinkage Linkage, const CXXDestructorDecl *Dtor, CXXDtorType DT) const {
299  // Delegate back to CGM by default.
300  return CGM.getLLVMLinkageForDeclarator(Dtor, Linkage,
301  /*isConstantVariable=*/false);
302 }
305  return false;
306 }
308 llvm::CallInst *
310  llvm::Value *Exn) {
311  // Just call std::terminate and ignore the violating exception.
312  return CGF.EmitNounwindRuntimeCall(CGF.CGM.getTerminateFn());
313 }
316  return CatchTypeInfo{nullptr, 0};
317 }
319 std::vector<CharUnits> CGCXXABI::getVBPtrOffsets(const CXXRecordDecl *RD) {
320  return std::vector<CharUnits>();
321 }
virtual llvm::Constant * EmitMemberPointer(const APValue &MP, QualType MPT)
Create a member pointer for the given member pointer constant.
Definition: CGCXXABI.cpp:119
A (possibly-)qualified type.
Definition: Type.h:654
virtual void EmitReturnFromThunk(CodeGenFunction &CGF, RValue RV, QualType ResultType)
Definition: CGCXXABI.cpp:163
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:223
unsigned getNumVBases() const
Retrieves the number of virtual base classes of this class.
Definition: DeclCXX.h:826
virtual void setCXXDestructorDLLStorage(llvm::GlobalValue *GV, const CXXDestructorDecl *Dtor, CXXDtorType DT) const
Definition: CGCXXABI.cpp:290
const Type * getTypeForDecl() const
Definition: Decl.h:2840
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:242
const Decl * CurCodeDecl
CurCodeDecl - This is the inner-most code context, which includes blocks.
Parameter for C++ &#39;this&#39; argument.
Definition: Decl.h:1484
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Definition: Diagnostic.h:1294
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64
virtual llvm::BasicBlock * EmitCtorCompleteObjectHandler(CodeGenFunction &CGF, const CXXRecordDecl *RD)
Definition: CGCXXABI.cpp:281
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:6455
A this pointer adjustment.
Definition: ABI.h:108
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:234
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:38
Describes the different kinds of linkage (C++ [], C99 6.2.2) that an entity may have...
Definition: Linkage.h:24
unsigned getAddressSpace() const
Return the address space that this address resides in.
Definition: Address.h:57
const ValueDecl * getMemberPointerDecl() const
Definition: APValue.cpp:660
virtual bool requiresArrayCookie(const CXXDeleteExpr *E, QualType eltType)
Definition: CGCXXABI.cpp:189
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
Definition: TargetInfo.h:906
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:2800
IdentifierTable & Idents
Definition: ASTContext.h:538
QualType getThisType(ASTContext &C) const
Returns the type of the this pointer.
Definition: DeclCXX.cpp:2138
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:65
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:157
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:2122
bool hasConstructorVariants() const
Does this ABI have different entrypoints for complete-object and base-subobject constructors?
Definition: TargetCXXABI.h:215
path_iterator path_begin()
Definition: Expr.h:2816
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:149
const Type * getClass() const
Definition: Type.h:2627
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:97
CodeGenModule & CGM
Definition: CGCXXABI.h:46
llvm::Constant * getTerminateFn()
Get the declaration of std::terminate for the platform.
Definition: CGException.cpp:51
ImplicitParamDecl * getThisDecl(CodeGenFunction &CGF)
Definition: CGCXXABI.h:53
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2747
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:297
virtual llvm::Type * ConvertMemberPointerType(const MemberPointerType *MPT)
Find the LLVM type used to represent the given member pointer type.
Definition: CGCXXABI.cpp:43
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:123
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, ImplicitParamKind ParamKind)
Create implicit parameter.
Definition: Decl.cpp:4277
bool hasAttr() const
Definition: DeclBase.h:536
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
Definition: Type.cpp:1590
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3368
llvm::CallInst * EmitNounwindRuntimeCall(llvm::Value *callee, const Twine &name="")
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:168
RValue - This trivial value class is used to represent the result of an expression that is evaluated...
Definition: CGValue.h:39
C++ destructor types.
Definition: ABI.h:34
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:636
Expr - This represents one expression.
Definition: Expr.h:106
static Address invalid()
Definition: Address.h:35
virtual CharUnits getArrayCookieSizeImpl(QualType elementType)
Returns the extra size required in order to store the array cookie for the given type.
Definition: CGCXXABI.cpp:174
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:208
const FunctionProtoType * T
static CGCallee forDirect(llvm::Constant *functionPtr, const CGCalleeInfo &abstractInfo=CGCalleeInfo())
Definition: CGCall.h:134
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2686
DeclContext * getDeclContext()
Definition: DeclBase.h:426
QualType getType() const
Definition: Expr.h:128
virtual llvm::Constant * EmitMemberFunctionPointer(const CXXMethodDecl *MD)
Create a member pointer for the given method.
Definition: CGCXXABI.cpp:109
ASTContext & getContext() const
Definition: CGCXXABI.h:81
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:35
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:74
virtual bool NeedsVTTParameter(GlobalDecl GD)
Return whether the given global decl needs a VTT parameter.
Definition: CGCXXABI.cpp:304
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
void setCXXABIThisValue(CodeGenFunction &CGF, llvm::Value *ThisPtr)
Definition: CGCXXABI.cpp:157
CastKind getCastKind() const
Definition: Expr.h:2794
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1845
const Decl * getDecl() const
Definition: GlobalDecl.h:64
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2031
virtual CatchTypeInfo getCatchAllTypeInfo()
Definition: CGCXXABI.cpp:315
QualType getAllocatedType() const
Definition: ExprCXX.h:1919
llvm::Value * loadIncomingCXXThis(CodeGenFunction &CGF)
Loads the incoming C++ this pointer as it was passed by the caller.
Definition: CGCXXABI.cpp:152
An aligned address.
Definition: Address.h:25
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after...
Definition: Type.h:1165
unsigned getCustomDiagID(Level L, const char(&FormatString)[N])
Return an ID for a diagnostic with the specified format string and level.
Definition: Diagnostic.h:775
All available information about a concrete callee.
Definition: CGCall.h:67
bool canPassInRegisters() const
Determine whether this class can be passed in registers.
Definition: Decl.h:3699
virtual llvm::Constant * EmitNullMemberPointer(const MemberPointerType *MPT)
Create a null member pointer of the given type.
Definition: CGCXXABI.cpp:105
bool isMemberPointerToDerivedMember() const
Definition: APValue.cpp:667
The MS C++ ABI needs a pointer to RTTI data plus some flags to describe the type of a catch handler...
Definition: CGCleanup.h:38
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:179
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:240
FunctionArgList - Type for representing both the decl and type of parameters to a function...
Definition: CGCall.h:356
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:87
Dataflow Directional Tag Classes.
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2074
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:230
llvm::LoadInst * CreateLoad(Address Addr, const llvm::Twine &Name="")
Definition: CGBuilder.h:70
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
Definition: DeclCXX.h:2151
void buildThisParam(CodeGenFunction &CGF, FunctionArgList &Params)
Build a parameter variable suitable for &#39;this&#39;.
Definition: CGCXXABI.cpp:128
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:2593
ArrayRef< const CXXRecordDecl * > getMemberPointerPath() const
Definition: APValue.cpp:674
bool canCopyArgument(const CXXRecordDecl *RD) const
Returns true if C++ allows us to copy the memory of an object of type RD when it is passed as an argu...
Definition: CGCXXABI.cpp:32
path_iterator path_end()
Definition: Expr.h:2817
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:4071
virtual llvm::Constant * EmitMemberDataPointer(const MemberPointerType *MPT, CharUnits offset)
Create a member pointer for the given field.
Definition: CGCXXABI.cpp:114
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2011
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:177
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
Definition: APValue.h:38
Represents a C++ struct/union/class.
Definition: DeclCXX.h:300
llvm::Type * ConvertType(QualType T)
virtual llvm::CallInst * emitTerminateForUnexpectedException(CodeGenFunction &CGF, llvm::Value *Exn)
Definition: CGCXXABI.cpp:309
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
A more specific kind of linkage than enum Linkage.
Definition: Linkage.h:74
virtual std::vector< CharUnits > getVBPtrOffsets(const CXXRecordDecl *RD)
Gets the offsets of all the virtual base pointers in a given class.
Definition: CGCXXABI.cpp:319
QualType getType() const
Definition: Decl.h:647
FullSourceLoc getFullLoc(SourceLocation Loc) const
Definition: ASTContext.h:701
llvm::Constant * GetBogusMemberPointer(QualType T)
Get a null value for unsupported member pointers.
Definition: CGCXXABI.cpp:38
llvm::GlobalValue::LinkageTypes getLLVMLinkageForDeclarator(const DeclaratorDecl *D, GVALinkage Linkage, bool IsConstantVariable)
Returns LLVM linkage for a declarator.
SourceLocation getLocation() const
Definition: DeclBase.h:417
QualType getPointeeType() const
Definition: Type.h:2613
CharUnits getMemberPointerPathAdjustment(const APValue &MP)
Computes the non-virtual adjustment needed for a member pointer conversion along an inheritance path ...
Definition: CGCXXABI.cpp:258
void setDLLImportDLLExport(llvm::GlobalValue *GV, GlobalDecl D) const
llvm::FunctionType * GetFunctionType(const CGFunctionInfo &Info)
GetFunctionType - Get the LLVM function type for.
Definition: CGCall.cpp:1544