aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGVTables.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2019-02-05 16:42:33 +0000
committerJames Y Knight <jyknight@google.com>2019-02-05 16:42:33 +0000
commit9871db064d3ee0d364d4d50a9f95e5d51804e19b (patch)
tree270494669a946ea44e1ae0cbc2dfc47e19b3e056 /clang/lib/CodeGen/CGVTables.cpp
parentd9c9dc036ca5ea98de431e6a2c1a3c90e139e9b5 (diff)
downloadllvm-9871db064d3ee0d364d4d50a9f95e5d51804e19b.zip
llvm-9871db064d3ee0d364d4d50a9f95e5d51804e19b.tar.gz
llvm-9871db064d3ee0d364d4d50a9f95e5d51804e19b.tar.bz2
[opaque pointer types] Pass function types for runtime function calls.
Emit{Nounwind,}RuntimeCall{,OrInvoke} have been modified to take a FunctionCallee as an argument, and CreateRuntimeFunction has been modified to return a FunctionCallee. All callers have been updated. Additionally, CreateBuiltinFunction is removed, as it was redundant with CreateRuntimeFunction after some previous changes. Differential Revision: https://reviews.llvm.org/D57668 llvm-svn: 353184
Diffstat (limited to 'clang/lib/CodeGen/CGVTables.cpp')
-rw-r--r--clang/lib/CodeGen/CGVTables.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index 702e18d..8270c27 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -648,7 +648,8 @@ void CodeGenVTables::addVTableComponent(
auto getSpecialVirtualFn = [&](StringRef name) {
llvm::FunctionType *fnTy =
llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false);
- llvm::Constant *fn = CGM.CreateRuntimeFunction(fnTy, name);
+ llvm::Constant *fn = cast<llvm::Constant>(
+ CGM.CreateRuntimeFunction(fnTy, name).getCallee());
if (auto f = dyn_cast<llvm::Function>(fn))
f->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
return llvm::ConstantExpr::getBitCast(fn, CGM.Int8PtrTy);