summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorCraig Griffiths <craig.griffiths@codethink.co.uk>2015-08-14 10:10:02 +0100
committerCraig Griffiths <craig.griffiths@codethink.co.uk>2015-08-14 10:12:59 +0100
commit1bf7d9907af320e2c95e2dcf826f30c4c0569701 (patch)
tree012475a017daf5a7fe556619d873e5ed83329e0b /lib/CodeGen/CGExprComplex.cpp
parent7d593cf14b6df28480d915e4cb812268f429f49c (diff)
downloadflang-1bf7d9907af320e2c95e2dcf826f30c4c0569701.tar.gz
The difference between the head of:
https://github.com/CodethinkLabs/flang.git and the first commit of: https://github.com/llvm-flang/flang.git as of 14/08/2015
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--lib/CodeGen/CGExprComplex.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index 05e310ef11..2a6a8ebaaf 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -62,15 +62,21 @@ ComplexValueTy ComplexExprEmitter::VisitComplexConstantExpr(const ComplexConstan
}
ComplexValueTy CodeGenFunction::EmitComplexLoad(llvm::Value *Ptr, bool IsVolatile) {
- auto Re = Builder.CreateLoad(Builder.CreateStructGEP(Ptr,0), IsVolatile);
- auto Im = Builder.CreateLoad(Builder.CreateStructGEP(Ptr,1), IsVolatile);
+ auto Re = Builder.CreateLoad(Builder.CreateStructGEP(Ptr->getType(),
+ Ptr,
+ 0), IsVolatile);
+ auto Im = Builder.CreateLoad(Builder.CreateStructGEP(Ptr->getType(),
+ Ptr,
+ 1), IsVolatile);
return ComplexValueTy(Re, Im);
}
void CodeGenFunction::EmitComplexStore(ComplexValueTy Value, llvm::Value *Ptr,
bool IsVolatile) {
- Builder.CreateStore(Value.Re, Builder.CreateStructGEP(Ptr,0), IsVolatile);
- Builder.CreateStore(Value.Im, Builder.CreateStructGEP(Ptr,1), IsVolatile);
+ Builder.CreateStore(Value.Re, Builder.CreateStructGEP(Ptr->getType(),
+ Ptr,0), IsVolatile);
+ Builder.CreateStore(Value.Im, Builder.CreateStructGEP(Ptr->getType(),
+ Ptr,1), IsVolatile);
}
ComplexValueTy ComplexExprEmitter::VisitVarExpr(const VarExpr *E) {