From d3c127e232164e1f15eb901d047dbc409ac6198d Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 7 May 2015 17:27:56 +0000 Subject: [opaque pointer type] Correctly pass the pointee type when creating a GEP constant expression llvm-svn: 236751 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 4bd67e069618..ee659bc4f7fb 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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. -- cgit v1.2.3