summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCUDARuntime.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2016-10-26 23:46:34 +0000
committerJohn McCall <rjmccall@apple.com>2016-10-26 23:46:34 +0000
commitb92ab1afd5aa1418402918ef70380ccb9470af7b (patch)
tree5d650c681c9a1aa0865add5522af59e98e39d023 /clang/lib/CodeGen/CGCUDARuntime.cpp
parent48ef6ca0c381cf7b90592ceba9239757b54723cb (diff)
downloadbcm5719-llvm-b92ab1afd5aa1418402918ef70380ccb9470af7b.tar.gz
bcm5719-llvm-b92ab1afd5aa1418402918ef70380ccb9470af7b.zip
Refactor call emission to package the function pointer together with
abstract information about the callee. NFC. The goal here is to make it easier to recognize indirect calls and trigger additional logic in certain cases. That logic will come in a later patch; in the meantime, I felt that this was a significant improvement to the code. llvm-svn: 285258
Diffstat (limited to 'clang/lib/CodeGen/CGCUDARuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGCUDARuntime.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGCUDARuntime.cpp b/clang/lib/CodeGen/CGCUDARuntime.cpp
index 014a5dbd46d..1936f9f1369 100644
--- a/clang/lib/CodeGen/CGCUDARuntime.cpp
+++ b/clang/lib/CodeGen/CGCUDARuntime.cpp
@@ -36,16 +36,7 @@ RValue CGCUDARuntime::EmitCUDAKernelCallExpr(CodeGenFunction &CGF,
eval.begin(CGF);
CGF.EmitBlock(ConfigOKBlock);
-
- const Decl *TargetDecl = nullptr;
- if (const ImplicitCastExpr *CE = dyn_cast<ImplicitCastExpr>(E->getCallee())) {
- if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(CE->getSubExpr())) {
- TargetDecl = DRE->getDecl();
- }
- }
-
- llvm::Value *Callee = CGF.EmitScalarExpr(E->getCallee());
- CGF.EmitCall(E->getCallee()->getType(), Callee, E, ReturnValue, TargetDecl);
+ CGF.EmitSimpleCallExpr(E, ReturnValue);
CGF.EmitBranch(ContBlock);
CGF.EmitBlock(ContBlock);
OpenPOWER on IntegriCloud