From: David Blaikie Date: Thu, 7 May 2015 17:27:56 +0000 (+0000) Subject: [opaque pointer type] Correctly pass the pointee type when creating a GEP constant... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c58fdea8180e70ff0aaf97c9c716e2ea40b0c58;p=clang [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 --- 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.