blob: 15686f7ff6edf6403cdd71e9d6c67edc72781dd4 [file] [log] [blame]
Devang Patelcbc7bc92010-10-04 21:15:33 +00001//===--- CGCXX.cpp - Emit LLVM Code for declarations ----------------------===//
Anders Carlsson87fc5a52008-08-22 16:00:37 +00002//
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 contains code dealing with C++ code generation.
11//
12//===----------------------------------------------------------------------===//
13
Mike Stump11289f42009-09-09 15:08:12 +000014// We might split this into multiple files if it gets too unwieldy
Anders Carlsson87fc5a52008-08-22 16:00:37 +000015
Chandler Carruth3a022472012-12-04 09:13:33 +000016#include "CodeGenModule.h"
Charles Davis4e786dd2010-05-25 19:52:27 +000017#include "CGCXXABI.h"
Anders Carlsson87fc5a52008-08-22 16:00:37 +000018#include "CodeGenFunction.h"
Anders Carlsson87fc5a52008-08-22 16:00:37 +000019#include "clang/AST/ASTContext.h"
20#include "clang/AST/Decl.h"
Anders Carlssone5fd6f22009-04-03 22:50:24 +000021#include "clang/AST/DeclCXX.h"
Anders Carlsson131be8b2008-08-23 19:42:54 +000022#include "clang/AST/DeclObjC.h"
Peter Collingbourne0ff0b372011-01-13 18:57:25 +000023#include "clang/AST/Mangle.h"
Chandler Carruth3a022472012-12-04 09:13:33 +000024#include "clang/AST/RecordLayout.h"
Anders Carlsson52d78a52009-09-27 18:58:34 +000025#include "clang/AST/StmtCXX.h"
Chandler Carruth85098242010-06-15 23:19:56 +000026#include "clang/Frontend/CodeGenOptions.h"
Anders Carlsson87fc5a52008-08-22 16:00:37 +000027#include "llvm/ADT/StringExtras.h"
Anders Carlsson87fc5a52008-08-22 16:00:37 +000028using namespace clang;
29using namespace CodeGen;
30
John McCallf8ff7b92010-02-23 00:48:20 +000031/// Try to emit a base destructor as an alias to its primary
32/// base-class destructor.
33bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
34 if (!getCodeGenOpts().CXXCtorDtorAliases)
35 return true;
36
37 // If the destructor doesn't have a trivial body, we have to emit it
38 // separately.
Anders Carlsson9bd7d162011-05-14 23:26:09 +000039 if (!D->hasTrivialBody())
John McCallf8ff7b92010-02-23 00:48:20 +000040 return true;
41
42 const CXXRecordDecl *Class = D->getParent();
43
44 // If we need to manipulate a VTT parameter, give up.
45 if (Class->getNumVBases()) {
46 // Extra Credit: passing extra parameters is perfectly safe
47 // in many calling conventions, so only bail out if the ctor's
48 // calling convention is nonstandard.
49 return true;
50 }
51
John McCall2b3c5532011-02-13 00:46:43 +000052 // If any field has a non-trivial destructor, we have to emit the
53 // destructor separately.
John McCallf8ff7b92010-02-23 00:48:20 +000054 for (CXXRecordDecl::field_iterator I = Class->field_begin(),
55 E = Class->field_end(); I != E; ++I)
David Blaikie2d7c57e2012-04-30 02:36:29 +000056 if (I->getType().isDestructedType())
John McCall2b3c5532011-02-13 00:46:43 +000057 return true;
John McCallf8ff7b92010-02-23 00:48:20 +000058
59 // Try to find a unique base class with a non-trivial destructor.
60 const CXXRecordDecl *UniqueBase = 0;
61 for (CXXRecordDecl::base_class_const_iterator I = Class->bases_begin(),
62 E = Class->bases_end(); I != E; ++I) {
63
64 // We're in the base destructor, so skip virtual bases.
65 if (I->isVirtual()) continue;
66
67 // Skip base classes with trivial destructors.
68 const CXXRecordDecl *Base
69 = cast<CXXRecordDecl>(I->getType()->getAs<RecordType>()->getDecl());
70 if (Base->hasTrivialDestructor()) continue;
71
72 // If we've already found a base class with a non-trivial
73 // destructor, give up.
74 if (UniqueBase) return true;
75 UniqueBase = Base;
76 }
77
78 // If we didn't find any bases with a non-trivial destructor, then
79 // the base destructor is actually effectively trivial, which can
80 // happen if it was needlessly user-defined or if there are virtual
81 // bases with non-trivial destructors.
82 if (!UniqueBase)
83 return true;
84
John McCall1950a112010-03-03 03:40:11 +000085 /// If we don't have a definition for the destructor yet, don't
86 /// emit. We can't emit aliases to declarations; that's just not
87 /// how aliases work.
Douglas Gregorbac74902010-07-01 14:13:13 +000088 const CXXDestructorDecl *BaseD = UniqueBase->getDestructor();
Argyrios Kyrtzidis36ea3222010-07-07 11:31:19 +000089 if (!BaseD->isImplicit() && !BaseD->hasBody())
John McCall1950a112010-03-03 03:40:11 +000090 return true;
91
John McCallf8ff7b92010-02-23 00:48:20 +000092 // If the base is at a non-zero offset, give up.
93 const ASTRecordLayout &ClassLayout = Context.getASTRecordLayout(Class);
Benjamin Kramer2ef30312012-07-04 18:45:14 +000094 if (!ClassLayout.getBaseClassOffset(UniqueBase).isZero())
John McCallf8ff7b92010-02-23 00:48:20 +000095 return true;
96
John McCallf8ff7b92010-02-23 00:48:20 +000097 return TryEmitDefinitionAsAlias(GlobalDecl(D, Dtor_Base),
Rafael Espindola3f643bd2013-11-04 18:38:59 +000098 GlobalDecl(BaseD, Dtor_Base),
99 false);
John McCallf8ff7b92010-02-23 00:48:20 +0000100}
101
John McCalld4324142010-02-19 01:32:20 +0000102/// Try to emit a definition as a global alias for another definition.
Rafael Espindola3f643bd2013-11-04 18:38:59 +0000103/// If \p InEveryTU is true, we know that an equivalent alias can be produced
104/// in every translation unit.
John McCalld4324142010-02-19 01:32:20 +0000105bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl,
Rafael Espindola3f643bd2013-11-04 18:38:59 +0000106 GlobalDecl TargetDecl,
107 bool InEveryTU) {
John McCalld4324142010-02-19 01:32:20 +0000108 if (!getCodeGenOpts().CXXCtorDtorAliases)
109 return true;
110
John McCalld4324142010-02-19 01:32:20 +0000111 // The alias will use the linkage of the referrent. If we can't
112 // support aliases with that linkage, fail.
Peter Collingbourne4d90dba2013-06-05 17:49:37 +0000113 llvm::GlobalValue::LinkageTypes Linkage = getFunctionLinkage(AliasDecl);
John McCalld4324142010-02-19 01:32:20 +0000114
Rafael Espindola3f643bd2013-11-04 18:38:59 +0000115 // We can't use an alias if the linkage is not valid for one.
116 if (!llvm::GlobalAlias::isValidLinkage(Linkage))
Rafael Espindola4c489c72010-03-05 01:21:10 +0000117 return true;
118
Rafael Espindola2e2995b2013-11-05 21:37:29 +0000119 llvm::GlobalValue::LinkageTypes TargetLinkage =
120 getFunctionLinkage(TargetDecl);
121
Rafael Espindola3f643bd2013-11-04 18:38:59 +0000122 // Check if we have it already.
123 StringRef MangledName = getMangledName(AliasDecl);
124 llvm::GlobalValue *Entry = GetGlobalValue(MangledName);
125 if (Entry && !Entry->isDeclaration())
126 return false;
Rafael Espindola2e2995b2013-11-05 21:37:29 +0000127 if (Replacements.count(MangledName))
128 return false;
Rafael Espindola3f643bd2013-11-04 18:38:59 +0000129
John McCallf8ff7b92010-02-23 00:48:20 +0000130 // Derive the type for the alias.
Chris Lattner2192fe52011-07-18 04:24:23 +0000131 llvm::PointerType *AliasType
John McCallf8ff7b92010-02-23 00:48:20 +0000132 = getTypes().GetFunctionType(AliasDecl)->getPointerTo();
133
John McCallf8ff7b92010-02-23 00:48:20 +0000134 // Find the referrent. Some aliases might require a bitcast, in
135 // which case the caller is responsible for ensuring the soundness
136 // of these semantics.
137 llvm::GlobalValue *Ref = cast<llvm::GlobalValue>(GetAddrOfGlobal(TargetDecl));
138 llvm::Constant *Aliasee = Ref;
139 if (Ref->getType() != AliasType)
140 Aliasee = llvm::ConstantExpr::getBitCast(Ref, AliasType);
141
Rafael Espindola2e2995b2013-11-05 21:37:29 +0000142 // Don't create an alias to a linker weak symbol unless we know we can do
143 // that in every TU. This avoids producing different COMDATs in different
144 // TUs.
145 if (llvm::GlobalValue::isWeakForLinker(TargetLinkage)) {
146 if (!InEveryTU)
147 return true;
148
149 assert(Linkage == TargetLinkage);
150 // Instead of creating as alias to a linkonce_odr, replace all of the uses
151 // of the aliassee.
152 if (TargetLinkage == llvm::GlobalValue::LinkOnceODRLinkage) {
153 Replacements[MangledName] = Aliasee;
154 return false;
155 }
156 }
157
John McCalld4324142010-02-19 01:32:20 +0000158 // Create the alias with no name.
159 llvm::GlobalAlias *Alias =
John McCallf8ff7b92010-02-23 00:48:20 +0000160 new llvm::GlobalAlias(AliasType, Linkage, "", Aliasee, &getModule());
John McCalld4324142010-02-19 01:32:20 +0000161
John McCallaea181d2010-02-24 20:32:01 +0000162 // Switch any previous uses to the alias.
John McCalld4324142010-02-19 01:32:20 +0000163 if (Entry) {
John McCallaea181d2010-02-24 20:32:01 +0000164 assert(Entry->getType() == AliasType &&
165 "declaration exists with different type");
John McCall7ec50432010-03-19 23:29:14 +0000166 Alias->takeName(Entry);
John McCalld4324142010-02-19 01:32:20 +0000167 Entry->replaceAllUsesWith(Alias);
168 Entry->eraseFromParent();
John McCall7ec50432010-03-19 23:29:14 +0000169 } else {
Anders Carlssonea836bc2010-06-22 16:16:50 +0000170 Alias->setName(MangledName);
John McCalld4324142010-02-19 01:32:20 +0000171 }
John McCalld4324142010-02-19 01:32:20 +0000172
173 // Finally, set up the alias with its proper name and attributes.
John McCall457a04e2010-10-22 21:05:15 +0000174 SetCommonAttributes(cast<NamedDecl>(AliasDecl.getDecl()), Alias);
John McCalld4324142010-02-19 01:32:20 +0000175
176 return false;
177}
Anders Carlssonbd7d11f2009-05-11 23:37:08 +0000178
John McCall46288ef2011-03-09 08:12:35 +0000179void CodeGenModule::EmitCXXConstructor(const CXXConstructorDecl *ctor,
180 CXXCtorType ctorType) {
John McCalld4324142010-02-19 01:32:20 +0000181 // The complete constructor is equivalent to the base constructor
182 // for classes with no virtual bases. Try to emit it as an alias.
Timur Iskhodzhanov57cbe5c2013-02-27 13:46:31 +0000183 if (getTarget().getCXXABI().hasConstructorVariants() &&
John McCall46288ef2011-03-09 08:12:35 +0000184 !ctor->getParent()->getNumVBases() &&
Rafael Espindola3f643bd2013-11-04 18:38:59 +0000185 (ctorType == Ctor_Complete || ctorType == Ctor_Base)) {
186 bool ProducedAlias =
187 !TryEmitDefinitionAsAlias(GlobalDecl(ctor, Ctor_Complete),
188 GlobalDecl(ctor, Ctor_Base), true);
189 if (ctorType == Ctor_Complete && ProducedAlias)
190 return;
191 }
Mike Stump11289f42009-09-09 15:08:12 +0000192
John McCalla729c622012-02-17 03:33:10 +0000193 const CGFunctionInfo &fnInfo =
194 getTypes().arrangeCXXConstructorDeclaration(ctor, ctorType);
John McCalla738c252011-03-09 04:27:21 +0000195
John McCall46288ef2011-03-09 08:12:35 +0000196 llvm::Function *fn =
197 cast<llvm::Function>(GetAddrOfCXXConstructor(ctor, ctorType, &fnInfo));
Peter Collingbourne4d90dba2013-06-05 17:49:37 +0000198 setFunctionLinkage(GlobalDecl(ctor, ctorType), fn);
Mike Stump11289f42009-09-09 15:08:12 +0000199
John McCall46288ef2011-03-09 08:12:35 +0000200 CodeGenFunction(*this).GenerateCode(GlobalDecl(ctor, ctorType), fn, fnInfo);
Mike Stump11289f42009-09-09 15:08:12 +0000201
John McCall46288ef2011-03-09 08:12:35 +0000202 SetFunctionDefinitionAttributes(ctor, fn);
203 SetLLVMFunctionAttributesForDefinition(ctor, fn);
Anders Carlssoneaa28f72009-04-17 01:58:57 +0000204}
205
John McCalld4324142010-02-19 01:32:20 +0000206llvm::GlobalValue *
John McCall46288ef2011-03-09 08:12:35 +0000207CodeGenModule::GetAddrOfCXXConstructor(const CXXConstructorDecl *ctor,
208 CXXCtorType ctorType,
209 const CGFunctionInfo *fnInfo) {
210 GlobalDecl GD(ctor, ctorType);
Anders Carlsson09b5fe62010-06-09 02:30:12 +0000211
Chris Lattner0e62c1c2011-07-23 10:55:15 +0000212 StringRef name = getMangledName(GD);
John McCall46288ef2011-03-09 08:12:35 +0000213 if (llvm::GlobalValue *existing = GetGlobalValue(name))
214 return existing;
John McCalld4324142010-02-19 01:32:20 +0000215
John McCalla729c622012-02-17 03:33:10 +0000216 if (!fnInfo)
217 fnInfo = &getTypes().arrangeCXXConstructorDeclaration(ctor, ctorType);
John McCall46288ef2011-03-09 08:12:35 +0000218
John McCalla729c622012-02-17 03:33:10 +0000219 llvm::FunctionType *fnType = getTypes().GetFunctionType(*fnInfo);
John McCall46288ef2011-03-09 08:12:35 +0000220 return cast<llvm::Function>(GetOrCreateLLVMFunction(name, fnType, GD,
Anders Carlsson3c239482011-02-05 04:35:53 +0000221 /*ForVTable=*/false));
Anders Carlssone8eeffd2009-04-16 23:57:24 +0000222}
Anders Carlssoneaa28f72009-04-17 01:58:57 +0000223
John McCall46288ef2011-03-09 08:12:35 +0000224void CodeGenModule::EmitCXXDestructor(const CXXDestructorDecl *dtor,
225 CXXDtorType dtorType) {
John McCalld4324142010-02-19 01:32:20 +0000226 // The complete destructor is equivalent to the base destructor for
227 // classes with no virtual bases, so try to emit it as an alias.
Rafael Espindola3f643bd2013-11-04 18:38:59 +0000228 if (!dtor->getParent()->getNumVBases() &&
229 (dtorType == Dtor_Complete || dtorType == Dtor_Base)) {
230 bool ProducedAlias =
231 !TryEmitDefinitionAsAlias(GlobalDecl(dtor, Dtor_Complete),
232 GlobalDecl(dtor, Dtor_Base), true);
233 if (ProducedAlias) {
234 if (dtorType == Dtor_Complete)
235 return;
236 if (dtor->isVirtual())
237 getVTables().EmitThunks(GlobalDecl(dtor, Dtor_Complete));
238 }
239 }
John McCalld4324142010-02-19 01:32:20 +0000240
John McCallf8ff7b92010-02-23 00:48:20 +0000241 // The base destructor is equivalent to the base destructor of its
242 // base class if there is exactly one non-virtual base class with a
243 // non-trivial destructor, there are no fields with a non-trivial
244 // destructor, and the body of the destructor is trivial.
John McCall46288ef2011-03-09 08:12:35 +0000245 if (dtorType == Dtor_Base && !TryEmitBaseDestructorAsAlias(dtor))
John McCallf8ff7b92010-02-23 00:48:20 +0000246 return;
247
John McCalla729c622012-02-17 03:33:10 +0000248 const CGFunctionInfo &fnInfo =
249 getTypes().arrangeCXXDestructor(dtor, dtorType);
John McCalla738c252011-03-09 04:27:21 +0000250
John McCall46288ef2011-03-09 08:12:35 +0000251 llvm::Function *fn =
252 cast<llvm::Function>(GetAddrOfCXXDestructor(dtor, dtorType, &fnInfo));
Peter Collingbourne4d90dba2013-06-05 17:49:37 +0000253 setFunctionLinkage(GlobalDecl(dtor, dtorType), fn);
Mike Stump11289f42009-09-09 15:08:12 +0000254
John McCall46288ef2011-03-09 08:12:35 +0000255 CodeGenFunction(*this).GenerateCode(GlobalDecl(dtor, dtorType), fn, fnInfo);
Mike Stump11289f42009-09-09 15:08:12 +0000256
John McCall46288ef2011-03-09 08:12:35 +0000257 SetFunctionDefinitionAttributes(dtor, fn);
258 SetLLVMFunctionAttributesForDefinition(dtor, fn);
Anders Carlssoneaa28f72009-04-17 01:58:57 +0000259}
260
John McCalld4324142010-02-19 01:32:20 +0000261llvm::GlobalValue *
John McCall46288ef2011-03-09 08:12:35 +0000262CodeGenModule::GetAddrOfCXXDestructor(const CXXDestructorDecl *dtor,
263 CXXDtorType dtorType,
Reid Klecknere7de47e2013-07-22 13:51:44 +0000264 const CGFunctionInfo *fnInfo,
265 llvm::FunctionType *fnType) {
266 // If the class has no virtual bases, then the complete and base destructors
267 // are equivalent, for all C++ ABIs supported by clang. We can save on code
268 // size by calling the base dtor directly, especially if we'd have to emit a
269 // thunk otherwise.
270 // FIXME: We should do this for Itanium, after verifying that nothing breaks.
271 if (dtorType == Dtor_Complete && dtor->getParent()->getNumVBases() == 0 &&
272 getCXXABI().useThunkForDtorVariant(dtor, Dtor_Complete))
273 dtorType = Dtor_Base;
274
John McCall46288ef2011-03-09 08:12:35 +0000275 GlobalDecl GD(dtor, dtorType);
Anders Carlsson09b5fe62010-06-09 02:30:12 +0000276
Chris Lattner0e62c1c2011-07-23 10:55:15 +0000277 StringRef name = getMangledName(GD);
John McCall46288ef2011-03-09 08:12:35 +0000278 if (llvm::GlobalValue *existing = GetGlobalValue(name))
279 return existing;
John McCalld4324142010-02-19 01:32:20 +0000280
Reid Klecknere7de47e2013-07-22 13:51:44 +0000281 if (!fnType) {
282 if (!fnInfo) fnInfo = &getTypes().arrangeCXXDestructor(dtor, dtorType);
283 fnType = getTypes().GetFunctionType(*fnInfo);
284 }
John McCall46288ef2011-03-09 08:12:35 +0000285 return cast<llvm::Function>(GetOrCreateLLVMFunction(name, fnType, GD,
Anders Carlsson3c239482011-02-05 04:35:53 +0000286 /*ForVTable=*/false));
Anders Carlssoneaa28f72009-04-17 01:58:57 +0000287}
288
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000289static llvm::Value *BuildAppleKextVirtualCall(CodeGenFunction &CGF,
290 GlobalDecl GD,
291 llvm::Type *Ty,
292 const CXXRecordDecl *RD) {
Timur Iskhodzhanov88fd4392013-08-21 06:25:03 +0000293 assert(!CGF.CGM.getTarget().getCXXABI().isMicrosoft() &&
294 "No kext in Microsoft ABI");
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000295 GD = GD.getCanonicalDecl();
296 CodeGenModule &CGM = CGF.CGM;
Timur Iskhodzhanov8b5987e2013-09-27 14:48:01 +0000297 llvm::Value *VTable = CGM.getCXXABI().getAddrOfVTable(RD, CharUnits());
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000298 Ty = Ty->getPointerTo()->getPointerTo();
299 VTable = CGF.Builder.CreateBitCast(VTable, Ty);
300 assert(VTable && "BuildVirtualCall = kext vtbl pointer is null");
Timur Iskhodzhanov58776632013-11-05 15:54:58 +0000301 uint64_t VTableIndex = CGM.getItaniumVTableContext().getMethodVTableIndex(GD);
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000302 uint64_t AddressPoint =
Timur Iskhodzhanov58776632013-11-05 15:54:58 +0000303 CGM.getItaniumVTableContext().getVTableLayout(RD)
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000304 .getAddressPoint(BaseSubobject(RD, CharUnits::Zero()));
305 VTableIndex += AddressPoint;
306 llvm::Value *VFuncPtr =
307 CGF.Builder.CreateConstInBoundsGEP1_64(VTable, VTableIndex, "vfnkxt");
Anders Carlssone828c362009-11-13 04:45:41 +0000308 return CGF.Builder.CreateLoad(VFuncPtr);
309}
310
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000311/// BuildAppleKextVirtualCall - This routine is to support gcc's kext ABI making
Fariborz Jahanian47609b02011-01-20 17:19:02 +0000312/// indirect call to virtual functions. It makes the call through indexing
313/// into the vtable.
314llvm::Value *
315CodeGenFunction::BuildAppleKextVirtualCall(const CXXMethodDecl *MD,
316 NestedNameSpecifier *Qual,
Chris Lattner2192fe52011-07-18 04:24:23 +0000317 llvm::Type *Ty) {
Fariborz Jahanian47609b02011-01-20 17:19:02 +0000318 assert((Qual->getKind() == NestedNameSpecifier::TypeSpec) &&
319 "BuildAppleKextVirtualCall - bad Qual kind");
320
321 const Type *QTy = Qual->getAsType();
322 QualType T = QualType(QTy, 0);
323 const RecordType *RT = T->getAs<RecordType>();
324 assert(RT && "BuildAppleKextVirtualCall - Qual type must be record");
325 const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
Fariborz Jahanian265c3252011-02-01 23:22:34 +0000326
327 if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD))
328 return BuildAppleKextVirtualDestructorCall(DD, Dtor_Complete, RD);
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000329
330 return ::BuildAppleKextVirtualCall(*this, MD, Ty, RD);
Fariborz Jahanian47609b02011-01-20 17:19:02 +0000331}
332
Fariborz Jahanian265c3252011-02-01 23:22:34 +0000333/// BuildVirtualCall - This routine makes indirect vtable call for
334/// call to virtual destructors. It returns 0 if it could not do it.
335llvm::Value *
336CodeGenFunction::BuildAppleKextVirtualDestructorCall(
337 const CXXDestructorDecl *DD,
338 CXXDtorType Type,
339 const CXXRecordDecl *RD) {
Fariborz Jahanian265c3252011-02-01 23:22:34 +0000340 const CXXMethodDecl *MD = cast<CXXMethodDecl>(DD);
341 // FIXME. Dtor_Base dtor is always direct!!
342 // It need be somehow inline expanded into the caller.
343 // -O does that. But need to support -O0 as well.
344 if (MD->isVirtual() && Type != Dtor_Base) {
Fariborz Jahanian265c3252011-02-01 23:22:34 +0000345 // Compute the function type we're calling.
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000346 const CGFunctionInfo &FInfo =
347 CGM.getTypes().arrangeCXXDestructor(DD, Dtor_Complete);
John McCalla729c622012-02-17 03:33:10 +0000348 llvm::Type *Ty = CGM.getTypes().GetFunctionType(FInfo);
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000349 return ::BuildAppleKextVirtualCall(*this, GlobalDecl(DD, Type), Ty, RD);
Fariborz Jahanian265c3252011-02-01 23:22:34 +0000350 }
Timur Iskhodzhanov03e87462013-07-19 08:14:45 +0000351 return 0;
Fariborz Jahanian265c3252011-02-01 23:22:34 +0000352}