aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-07-12 06:57:26 +0000
committerChris Lattner <sabre@nondot.org>2005-07-12 06:57:26 +0000
commit39429617e05721c7cee22b745311d60d6741c8fc (patch)
tree4670aa8c0058a4df61958b88ec0267765a0ea198
parentf5d507e90568574bdc10b11e53f479eb698c98b0 (diff)
Add support for emitting 64-bit integers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22399 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/ELFWriter.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/ELFWriter.h b/include/llvm/CodeGen/ELFWriter.h
index 2afc3dd3f3..b2b00efa62 100644
--- a/include/llvm/CodeGen/ELFWriter.h
+++ b/include/llvm/CodeGen/ELFWriter.h
@@ -208,11 +208,38 @@ namespace llvm {
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.