//
// The LLVM Compiler Infrastructure
//
-// This file was developed by Bill Wendling and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// aligned to the specified power of two boundary.
void align(unsigned Boundary) {
assert(Boundary && (Boundary & (Boundary - 1)) == 0 &&
- "Must alitypedef std::vector<unsigned char> DataBuffer;gn to 2^k boundary");
+ "Must align to 2^k boundary");
size_t Size = Output.size();
if (Size & (Boundary - 1)) {
outxword(X);
}
void outstring(const std::string &S, unsigned Length) {
- unsigned len_to_copy = S.length() < Length ? S.length() : Length;
- unsigned len_to_fill = S.length() < Length ? Length - S.length() : 0;
+ unsigned len_to_copy = static_cast<unsigned>(S.length()) < Length
+ ? static_cast<unsigned>(S.length()) : Length;
+ unsigned len_to_fill = static_cast<unsigned>(S.length()) < Length
+ ? Length - static_cast<unsigned>(S.length()) : 0;
for (unsigned i = 0; i < len_to_copy; ++i)
outbyte(S[i]);
assert(0 && "Emission of 64-bit data not implemented yet!");
}
- std::vector<unsigned char>::reference
- operator [] (unsigned Index) {
+ unsigned char &operator[](unsigned Index) {
return Output[Index];
}
- std::vector<unsigned char>::const_reference
- operator [] (unsigned Index) const {
+ const unsigned char &operator[](unsigned Index) const {
return Output[Index];
}
};