From 4c58fdea8180e70ff0aaf97c9c716e2ea40b0c58 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 7 May 2015 17:27:56 +0000 Subject: [PATCH] [opaque pointer type] Correctly pass the pointee type when creating a GEP constant expression git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236751 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 4bd67e0696..ee659bc4f7 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -2690,7 +2690,8 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { } // String. - Fields[2] = llvm::ConstantExpr::getGetElementPtr(GV->getType(), GV, Zeros); + Fields[2] = + llvm::ConstantExpr::getGetElementPtr(GV->getValueType(), GV, Zeros); if (isUTF16) // Cast the UTF16 string to the correct type. -- 2.50.1