[llvm-commits] CVS: llvm/include/llvm/CodeGen/ELFWriter.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Jul 11 23:57:37 PDT 2005
Changes in directory llvm/include/llvm/CodeGen:
ELFWriter.h updated: 1.6 -> 1.7
---
Log message:
Add support for emitting 64-bit integers
---
Diffs of the changes: (+28 -1)
ELFWriter.h | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletion(-)
Index: llvm/include/llvm/CodeGen/ELFWriter.h
diff -u llvm/include/llvm/CodeGen/ELFWriter.h:1.6 llvm/include/llvm/CodeGen/ELFWriter.h:1.7
--- llvm/include/llvm/CodeGen/ELFWriter.h:1.6 Tue Jul 12 01:40:29 2005
+++ llvm/include/llvm/CodeGen/ELFWriter.h Tue Jul 12 01:57:26 2005
@@ -208,11 +208,38 @@
OutputBuffer.push_back((X >> 0) & 255);
}
}
+ void outxword(uint64_t X) {
+ if (isLittleEndian) {
+ OutputBuffer.push_back((X >> 0) & 255);
+ OutputBuffer.push_back((X >> 8) & 255);
+ OutputBuffer.push_back((X >> 16) & 255);
+ OutputBuffer.push_back((X >> 24) & 255);
+ OutputBuffer.push_back((X >> 32) & 255);
+ OutputBuffer.push_back((X >> 40) & 255);
+ OutputBuffer.push_back((X >> 48) & 255);
+ OutputBuffer.push_back((X >> 56) & 255);
+ } else {
+ OutputBuffer.push_back((X >> 56) & 255);
+ OutputBuffer.push_back((X >> 48) & 255);
+ OutputBuffer.push_back((X >> 40) & 255);
+ OutputBuffer.push_back((X >> 32) & 255);
+ OutputBuffer.push_back((X >> 24) & 255);
+ OutputBuffer.push_back((X >> 16) & 255);
+ OutputBuffer.push_back((X >> 8) & 255);
+ OutputBuffer.push_back((X >> 0) & 255);
+ }
+ }
+ void outaddr32(unsigned X) {
+ outword(X);
+ }
+ void outaddr64(uint64_t X) {
+ outxword(X);
+ }
void outaddr(uint64_t X) {
if (!is64Bit)
outword((unsigned)X);
else
- assert(0 && "Emission of 64-bit data not implemented yet!");
+ outxword(X);
}
// fix functions - Replace an existing entry at an offset.
More information about the llvm-commits
mailing list