r194827 - [-cxx-abi microsoft] Emit thunks for pointers to virtual member functions

Hans Wennborg hans at chromium.org
Fri Nov 15 10:46:36 PST 2013


On Fri, Nov 15, 2013 at 10:42 AM, Mark Lacey <mark.lacey at apple.com> wrote:
> Hi Hans,
>
> On Nov 15, 2013, at 9:24 AM, Hans Wennborg <hans at hanshq.net> wrote:
>> +llvm::Function *
>> +MicrosoftCXXABI::EmitVirtualMemPtrThunk(const CXXMethodDecl *MD,
>> +                                        StringRef ThunkName) {
>> +  // If the thunk has been generated previously, just return it.
>> +  if (llvm::GlobalValue *GV = CGM.getModule().getNamedValue(ThunkName))
>> +    return cast<llvm::Function>(GV);
>> +
>> +  // Create the llvm::Function.
>> +  const CGFunctionInfo &FnInfo = CGM.getTypes().arrangeGlobalDeclaration(MD);
>> +  llvm::FunctionType *ThunkTy = CGM.getTypes().GetFunctionType(FnInfo);
>> +  llvm::Function *ThunkFn =
>> +      llvm::Function::Create(ThunkTy, llvm::Function::ExternalLinkage,
>> +                             ThunkName.str(), &CGM.getModule());
>> +  assert(ThunkFn->getName() == ThunkName && "name was uniqued!");
>> +
>> +  LinkageInfo LV = MD->getLinkageAndVisibility();
>
> LV is unused. Did you intend to use it in the call to setLinkage below?

No, this was a leftover from an earlier version of the patch. Alp
removed it in r194835.

Cheers,
Hans



More information about the cfe-commits mailing list