aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-08-08 17:29:04 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-08-08 17:29:04 +0000
commit3e0094d9694a27c9e925f789fa26e740dc445fbe (patch)
treebf79d815b7a022383924549bd9eab653bc9daae5 /include
parentcf1e764a1c1a15f3710ca41ecad5662527fca21f (diff)
downloadexternal_llvm-3e0094d9694a27c9e925f789fa26e740dc445fbe.zip
external_llvm-3e0094d9694a27c9e925f789fa26e740dc445fbe.tar.gz
external_llvm-3e0094d9694a27c9e925f789fa26e740dc445fbe.tar.bz2
ELF improvements:
Handle large integers, x86_fp80, ConstantAggregateZero, and two more ConstantExpr: GetElementPtr and IntToPtr Set SHF_MERGE bit for mergeable strings Avoid zero initialized strings to be classified as a bss symbol Don't allow common symbols to be classified as STB_WEAK Add a constant to be used as a global value offset in data relocations git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78476 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/BinaryObject.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/BinaryObject.h b/include/llvm/CodeGen/BinaryObject.h
index 542a177..2d4bd73 100644
--- a/include/llvm/CodeGen/BinaryObject.h
+++ b/include/llvm/CodeGen/BinaryObject.h
@@ -68,6 +68,13 @@ public:
return !Relocations.empty();
}
+ /// emitZeros - This callback is invoked to emit a arbitrary number
+ /// of zero bytes to the data stream.
+ inline void emitZeros(unsigned Size) {
+ for (unsigned i=0; i < Size; ++i)
+ emitByte(0);
+ }
+
/// emitByte - This callback is invoked when a byte needs to be
/// written to the data stream.
inline void emitByte(uint8_t B) {
@@ -124,6 +131,19 @@ public:
emitDWordBE(W);
}
+ /// emitWord64 - This callback is invoked when a x86_fp80 needs to be
+ /// written to the data stream in correct endian format.
+ inline void emitWordFP80(const uint64_t *W, unsigned PadSize) {
+ if (IsLittleEndian) {
+ emitWord64(W[0]);
+ emitWord16(W[1]);
+ } else {
+ emitWord16(W[1]);
+ emitWord64(W[0]);
+ }
+ emitZeros(PadSize);
+ }
+
/// emitWordLE - This callback is invoked when a 32-bit word needs to be
/// written to the data stream in little-endian format.
inline void emitWordLE(uint32_t W) {