aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVTables.cpp
diff options
context:
space:
mode:
authorJoao Matos <ripzonetriton@gmail.com>2012-07-17 17:10:11 +0000
committerJoao Matos <ripzonetriton@gmail.com>2012-07-17 17:10:11 +0000
commit285baac67d722beb6854f5faa45ee1aa62a7ce92 (patch)
tree5ff38a036a92fc9c70c94c105122940c253cda5c /lib/CodeGen/CGVTables.cpp
parente1da3305158d1ecbb6d0cb2cc4ae0c1b3457b29d (diff)
[Windows] Abstract pure virtual method calls in the ABI. Fix the Windows ABI to forward to the correct function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTables.cpp')
-rw-r--r--lib/CodeGen/CGVTables.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp
index 0d3d023313..c2c42f6e00 100644
--- a/lib/CodeGen/CGVTables.cpp
+++ b/lib/CodeGen/CGVTables.cpp
@@ -569,15 +569,15 @@ CodeGenVTables::CreateVTableInitializer(const CXXRecordDecl *RD,
if (cast<CXXMethodDecl>(GD.getDecl())->isPure()) {
// We have a pure virtual member function.
- if (!PureVirtualFn) {
- llvm::FunctionType *Ty =
- llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false);
- PureVirtualFn =
- CGM.CreateRuntimeFunction(Ty, "__cxa_pure_virtual");
- PureVirtualFn = llvm::ConstantExpr::getBitCast(PureVirtualFn,
- Int8PtrTy);
+ if (!PureVirtualFn ) {
+ llvm::FunctionType *Ty =
+ llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false);
+ StringRef PureCallName = CGM.getCXXABI().GetPureVirtualCallName();
+ PureVirtualFn = CGM.CreateRuntimeFunction(Ty, PureCallName);
+ PureVirtualFn = llvm::ConstantExpr::getBitCast(PureVirtualFn,
+ CGM.Int8PtrTy);
}
-
+
Init = PureVirtualFn;
} else {
// Check if we should use a thunk.