[llvm-commits] CVS: llvm/include/llvm/Support/OutputBuffer.h
Bill Wendling
isanbard at gmail.com
Wed Jan 17 17:23:31 PST 2007
Changes in directory llvm/include/llvm/Support:
OutputBuffer.h updated: 1.1 -> 1.2
---
Log message:
Have the OutputBuffer take the is64Bit and isLittleEndian booleans.
---
Diffs of the changes: (+5 -6)
OutputBuffer.h | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
Index: llvm/include/llvm/Support/OutputBuffer.h
diff -u llvm/include/llvm/Support/OutputBuffer.h:1.1 llvm/include/llvm/Support/OutputBuffer.h:1.2
--- llvm/include/llvm/Support/OutputBuffer.h:1.1 Wed Jan 17 16:17:24 2007
+++ llvm/include/llvm/Support/OutputBuffer.h Wed Jan 17 19:23:11 2007
@@ -14,6 +14,7 @@
#ifndef LLVM_SUPPORT_OUTPUTBUFFER_H
#define LLVM_SUPPORT_OUTPUTBUFFER_H
+#include <string>
#include <vector>
namespace llvm {
@@ -26,11 +27,9 @@
/// machine directly, indicating what header values and flags to set.
bool is64Bit, isLittleEndian;
public:
- OutputBuffer(const TargetMachine& TM,
- std::vector<unsigned char> &Out) : Output(Out) {
- is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
- isLittleEndian = TM.getTargetData()->isLittleEndian();
- }
+ OutputBuffer(std::vector<unsigned char> &Out,
+ bool is64bit, bool le)
+ : Output(Out), is64Bit(is64bit), isLittleEndian(le) {}
// align - Emit padding into the file until the current output position is
// aligned to the specified power of two boundary.
@@ -107,7 +106,7 @@
else
outxword(X);
}
- void outstring(std::string &S, unsigned Length) {
+ 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;
More information about the llvm-commits
mailing list