r236751 - [opaque pointer type] Correctly pass the pointee type when creating a GEP constant expression
David Blaikie
dblaikie at gmail.com
Thu May 7 10:27:56 PDT 2015
Author: dblaikie
Date: Thu May 7 12:27:56 2015
New Revision: 236751
URL: http://llvm.org/viewvc/llvm-project?rev=236751&view=rev
Log:
[opaque pointer type] Correctly pass the pointee type when creating a GEP constant expression
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=236751&r1=236750&r2=236751&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu May 7 12:27:56 2015
@@ -2690,7 +2690,8 @@ CodeGenModule::GetAddrOfConstantCFString
}
// 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.
More information about the cfe-commits
mailing list