diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-06-11 00:45:44 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-06-11 00:45:44 +0000 |
commit | ac936ff5ab80256b7c6484b9b0252a451d2e71b9 (patch) | |
tree | 4580dec180217c5ec80094cd9bf54868d6c081e8 /clang/lib/CodeGen/MicrosoftCXXABI.cpp | |
parent | 01b9bb42d43a041bbe75c56d3dd70c15e3cdc3a6 (diff) | |
download | bcm5719-llvm-ac936ff5ab80256b7c6484b9b0252a451d2e71b9.tar.gz bcm5719-llvm-ac936ff5ab80256b7c6484b9b0252a451d2e71b9.zip |
[MS ABI] Allow fastcall member function pointers to get CodeGen'd
This restriction appears unnecessary and most likely came about during
early work for musttail.
llvm-svn: 239500
Diffstat (limited to 'clang/lib/CodeGen/MicrosoftCXXABI.cpp')
-rw-r--r-- | clang/lib/CodeGen/MicrosoftCXXABI.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp index bb95a123c55..e19ad690fb9 100644 --- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -2423,20 +2423,15 @@ MicrosoftCXXABI::BuildMemberPointer(const CXXRecordDecl *RD, FirstField = CGM.GetAddrOfFunction(MD, Ty); FirstField = llvm::ConstantExpr::getBitCast(FirstField, CGM.VoidPtrTy); } else { - if (FPT->getCallConv() == CC_X86FastCall) { - CGM.ErrorUnsupported(MD, "pointer to fastcall virtual member function"); - FirstField = llvm::Constant::getNullValue(CGM.VoidPtrTy); - } else { - auto &VTableContext = CGM.getMicrosoftVTableContext(); - MicrosoftVTableContext::MethodVFTableLocation ML = - VTableContext.getMethodVFTableLocation(MD); - llvm::Function *Thunk = EmitVirtualMemPtrThunk(MD, ML); - FirstField = llvm::ConstantExpr::getBitCast(Thunk, CGM.VoidPtrTy); - // Include the vfptr adjustment if the method is in a non-primary vftable. - NonVirtualBaseAdjustment += ML.VFPtrOffset; - if (ML.VBase) - VBTableIndex = VTableContext.getVBTableIndex(RD, ML.VBase) * 4; - } + auto &VTableContext = CGM.getMicrosoftVTableContext(); + MicrosoftVTableContext::MethodVFTableLocation ML = + VTableContext.getMethodVFTableLocation(MD); + llvm::Function *Thunk = EmitVirtualMemPtrThunk(MD, ML); + FirstField = llvm::ConstantExpr::getBitCast(Thunk, CGM.VoidPtrTy); + // Include the vfptr adjustment if the method is in a non-primary vftable. + NonVirtualBaseAdjustment += ML.VFPtrOffset; + if (ML.VBase) + VBTableIndex = VTableContext.getVBTableIndex(RD, ML.VBase) * 4; } // The rest of the fields are common with data member pointers. |