1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Make strings SByte* arrays instead of UByte * arrays

llvm-svn: 1469
This commit is contained in:
Chris Lattner 2001-12-14 16:41:18 +00:00
parent 98a6e485b0
commit ba664bbc27

View File

@ -436,12 +436,12 @@ ConstantArray *ConstantArray::get(const string &Str) {
vector<Constant*> ElementVals;
for (unsigned i = 0; i < Str.length(); ++i)
ElementVals.push_back(ConstantUInt::get(Type::UByteTy, Str[i]));
ElementVals.push_back(ConstantSInt::get(Type::SByteTy, Str[i]));
// Add a null terminator to the string...
ElementVals.push_back(ConstantUInt::get(Type::UByteTy, 0));
ElementVals.push_back(ConstantSInt::get(Type::SByteTy, 0));
ArrayType *ATy = ArrayType::get(Type::UByteTy/*,stringConstant.length()*/);
ArrayType *ATy = ArrayType::get(Type::SByteTy, Str.length()+1);
return ConstantArray::get(ATy, ElementVals);
}