diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-04-04 16:54:41 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-04-04 16:54:41 +0000 |
| commit | f3bc75afcfb2bf799776b0f765e145e8cc72d351 (patch) | |
| tree | db6a8dad9a8efb4e4d68a161962442a1a08305e9 /clang/lib/CodeGen/CGExpr.cpp | |
| parent | 50ad37b6d95cf680aa482cd14419dbb393b69c92 (diff) | |
Since isComplexType() no longer returns true for _Complex integers, the code
generator needs to call isAnyComplexType(). This fixes PR1960.
llvm-svn: 49220
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index c80b6a7a8b39..817573017169 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -37,7 +37,7 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(const llvm::Type *Ty, /// expression and compare the result against zero, returning an Int1Ty value. llvm::Value *CodeGenFunction::EvaluateExprAsBool(const Expr *E) { QualType BoolTy = getContext().BoolTy; - if (!E->getType()->isComplexType()) + if (!E->getType()->isAnyComplexType()) return EmitScalarConversion(EmitScalarExpr(E), E->getType(), BoolTy); return EmitComplexToScalarConversion(EmitComplexExpr(E), E->getType(),BoolTy); @@ -51,7 +51,7 @@ RValue CodeGenFunction::EmitAnyExpr(const Expr *E, llvm::Value *AggLoc, bool isAggLocVolatile) { if (!hasAggregateLLVMType(E->getType())) return RValue::get(EmitScalarExpr(E)); - else if (E->getType()->isComplexType()) + else if (E->getType()->isAnyComplexType()) return RValue::getComplex(EmitComplexExpr(E)); EmitAggExpr(E, AggLoc, isAggLocVolatile); @@ -620,7 +620,7 @@ RValue CodeGenFunction::EmitCallExpr(llvm::Value *Callee, QualType FnType, if (!hasAggregateLLVMType(ArgTy)) { // Scalar argument is passed by-value. Args.push_back(EmitScalarExpr(ArgExprs[i])); - } else if (ArgTy->isComplexType()) { + } else if (ArgTy->isAnyComplexType()) { // Make a temporary alloca to pass the argument. llvm::Value *DestMem = CreateTempAlloca(ConvertType(ArgTy)); EmitComplexExprIntoAddr(ArgExprs[i], DestMem, false); @@ -637,7 +637,7 @@ RValue CodeGenFunction::EmitCallExpr(llvm::Value *Callee, QualType FnType, CI->setCallingConv(F->getCallingConv()); if (CI->getType() != llvm::Type::VoidTy) CI->setName("call"); - else if (ResultType->isComplexType()) + else if (ResultType->isAnyComplexType()) return RValue::getComplex(LoadComplexFromAddr(Args[0], false)); else if (hasAggregateLLVMType(ResultType)) // Struct return. |
