aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/OutputBuffer.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2007-01-18 01:23:11 +0000
committerBill Wendling <isanbard@gmail.com>2007-01-18 01:23:11 +0000
commitc904a5b925ce9981ad7501b14ee39cbc8795e23c (patch)
tree01dc4a2700cdae4e7837bb9a57b7c16b115b2abe /include/llvm/Support/OutputBuffer.h
parentb266ccd0f41b3ac9d9ad733e73204d9177c12e9f (diff)
Have the OutputBuffer take the is64Bit and isLittleEndian booleans.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/OutputBuffer.h')
-rw-r--r--include/llvm/Support/OutputBuffer.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/llvm/Support/OutputBuffer.h b/include/llvm/Support/OutputBuffer.h
index 24a655cef6..73a4a631de 100644
--- a/include/llvm/Support/OutputBuffer.h
+++ b/include/llvm/Support/OutputBuffer.h
@@ -14,6 +14,7 @@
#ifndef LLVM_SUPPORT_OUTPUTBUFFER_H
#define LLVM_SUPPORT_OUTPUTBUFFER_H
+#include <string>
#include <vector>
namespace llvm {
@@ -26,11 +27,9 @@ namespace llvm {
/// 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 @@ namespace llvm {
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;