summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Bertolli <cbertol@us.ibm.com>2015-05-08 18:03:10 -0400
committerCraig Griffiths <craig.griffiths@codethink.co.uk>2015-08-14 10:21:40 +0100
commit8cfe7f554d5c8f1639e3dc337aafb8956c7a8b7f (patch)
treeab13af59203b765cac0a2a02b556e6a8685f7648
parentbd5cc9c68333bc6fd42c4c14bdcf7d4f4c5f31ea (diff)
downloadflang-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.cpp6
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) {