diff options
author | Carlo Bertolli <cbertol@us.ibm.com> | 2015-05-08 18:03:10 -0400 |
---|---|---|
committer | Craig Griffiths <craig.griffiths@codethink.co.uk> | 2015-08-14 10:21:40 +0100 |
commit | 8cfe7f554d5c8f1639e3dc337aafb8956c7a8b7f (patch) | |
tree | ab13af59203b765cac0a2a02b556e6a8685f7648 | |
parent | bd5cc9c68333bc6fd42c4c14bdcf7d4f4c5f31ea (diff) | |
download | flang-8cfe7f554d5c8f1639e3dc337aafb8956c7a8b7f.tar.gz |
Change first parameter of GEP to element type, as required by instruction creation. Close Issue #7.
-rw-r--r-- | lib/CodeGen/CGExprCharacter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExprCharacter.cpp b/lib/CodeGen/CGExprCharacter.cpp index fd86b09541..4c466b6c99 100644 --- a/lib/CodeGen/CGExprCharacter.cpp +++ b/lib/CodeGen/CGExprCharacter.cpp @@ -188,9 +188,9 @@ llvm::Value *CodeGenFunction::GetCharacterTypeLength(QualType T) { CharacterValueTy CodeGenFunction::GetCharacterValueFromPtr(llvm::Value *Ptr, QualType StorageType) { - return CharacterValueTy(Builder.CreateConstInBoundsGEP2_32(Ptr->getType(), - Ptr, 0, 0), - GetCharacterTypeLength(StorageType)); + return CharacterValueTy(Builder.CreateConstInBoundsGEP2_32( + Ptr->getType()->getArrayElementType(),Ptr, 0, 0), + GetCharacterTypeLength(StorageType)); } CharacterValueTy CodeGenFunction::EmitCharacterExpr(const Expr *E) { |