]> granicus.if.org Git - clang/commitdiff
[opaque pointer type] Correctly pass the pointee type when creating a GEP constant...
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 7 May 2015 17:27:56 +0000 (17:27 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 7 May 2015 17:27:56 +0000 (17:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236751 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index 4bd67e06961867cfed1ec94f0565a3b617859ed1..ee659bc4f7fb040939d6f56622a971ca4d4f85e5 100644 (file)
@@ -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.