mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-06 01:27:08 +00:00
Make strings SByte* arrays instead of UByte * arrays
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1469 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c933344f1e
commit
a2644f60ce
@ -436,12 +436,12 @@ ConstantArray *ConstantArray::get(const string &Str) {
|
|||||||
vector<Constant*> ElementVals;
|
vector<Constant*> ElementVals;
|
||||||
|
|
||||||
for (unsigned i = 0; i < Str.length(); ++i)
|
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...
|
// 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);
|
return ConstantArray::get(ATy, ElementVals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user