aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-09 21:33:21 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-09 21:33:21 +0000
commit0aebc81e02397a5987aaa8e8c7acbdb01a31d7c3 (patch)
tree244e1626acebcedf768fd386036799602daa598c /lib/CodeGen/CGCXX.cpp
parentcfcd7fd0de701c5ce05e96de1ed2d0bf8c7035d9 (diff)
If a cast expression needs either a conversion function or a constructor to be called, generate implicit child expressions that call them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r--lib/CodeGen/CGCXX.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index e311912d95..9963a9b048 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -264,28 +264,6 @@ CodeGenFunction::EmitCXXOperatorMemberCallExpr(const CXXOperatorCallExpr *E,
E->arg_begin() + 1, E->arg_end());
}
-RValue
-CodeGenFunction::EmitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *E) {
- assert((E->getCastKind() == CastExpr::CK_UserDefinedConversion) &&
- "EmitCXXFunctionalCastExpr - called with wrong cast");
-
- CXXMethodDecl *MD = E->getTypeConversionMethod();
- assert(MD && "EmitCXXFunctionalCastExpr - null conversion method");
- assert(isa<CXXConversionDecl>(MD) && "EmitCXXFunctionalCastExpr - not"
- " method decl");
- const FunctionProtoType *FPT = MD->getType()->getAsFunctionProtoType();
-
- const llvm::Type *Ty =
- CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD),
- FPT->isVariadic());
- llvm::Constant *Callee = CGM.GetAddrOfFunction(GlobalDecl(MD), Ty);
- llvm::Value *This = EmitLValue(E->getSubExpr()).getAddress();
- RValue RV = EmitCXXMemberCall(MD, Callee, This, 0, 0);
- if (RV.isAggregate())
- RV = RValue::get(RV.getAggregateAddr());
- return RV;
-}
-
llvm::Value *CodeGenFunction::LoadCXXThis() {
assert(isa<CXXMethodDecl>(CurFuncDecl) &&
"Must be in a C++ member function decl to load 'this'");