diff options
| author | Owen Anderson <resistor@mac.com> | 2009-07-14 23:10:40 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2009-07-14 23:10:40 +0000 |
| commit | 170229f68d84a4f479474e1d4fe21f6e51c9a3ec (patch) | |
| tree | df2274c44c6de254cc78545a99c3e49f27cc0d93 /clang/lib/CodeGen/CGExprComplex.cpp | |
| parent | b6b2530000366d6982736dd0d0cc3585b01cf37b (diff) | |
| download | llvm-170229f68d84a4f479474e1d4fe21f6e51c9a3ec.zip llvm-170229f68d84a4f479474e1d4fe21f6e51c9a3ec.tar.gz llvm-170229f68d84a4f479474e1d4fe21f6e51c9a3ec.tar.bz2 | |
Update for LLVM API change, and contextify a bunch of related stuff.
llvm-svn: 75705
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGExprComplex.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp index c4aaa1f..b5597ad 100644 --- a/clang/lib/CodeGen/CGExprComplex.cpp +++ b/clang/lib/CodeGen/CGExprComplex.cpp @@ -367,6 +367,8 @@ ComplexPairTy ComplexExprEmitter::EmitCast(Expr *Op, QualType DestTy) { ComplexPairTy ComplexExprEmitter::VisitPrePostIncDec(const UnaryOperator *E, bool isInc, bool isPre) { + llvm::LLVMContext &VMContext = CGF.getLLVMContext(); + LValue LV = CGF.EmitLValue(E->getSubExpr()); ComplexPairTy InVal = EmitLoadOfComplex(LV.getAddress(), LV.isVolatileQualified()); @@ -374,7 +376,7 @@ ComplexPairTy ComplexExprEmitter::VisitPrePostIncDec(const UnaryOperator *E, llvm::Value *NextVal; if (isa<llvm::IntegerType>(InVal.first->getType())) { uint64_t AmountVal = isInc ? 1 : -1; - NextVal = llvm::ConstantInt::get(InVal.first->getType(), AmountVal, true); + NextVal = VMContext.getConstantInt(InVal.first->getType(), AmountVal, true); // Add the inc/dec to the real part. NextVal = Builder.CreateAdd(InVal.first, NextVal, isInc ? "inc" : "dec"); @@ -384,7 +386,7 @@ ComplexPairTy ComplexExprEmitter::VisitPrePostIncDec(const UnaryOperator *E, llvm::APFloat FVal(CGF.getContext().getFloatTypeSemantics(ElemTy), 1); if (!isInc) FVal.changeSign(); - NextVal = llvm::ConstantFP::get(FVal); + NextVal = VMContext.getConstantFP(FVal); // Add the inc/dec to the real part. NextVal = Builder.CreateFAdd(InVal.first, NextVal, isInc ? "inc" : "dec"); |
