diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-25 21:28:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-25 21:28:50 +0000 |
commit | 3cde760023ea65b9f1359dd8a238085b8b5ebeaa (patch) | |
tree | c57fe45c0311b57093cbcdf6e21202d893dad27d /llvm/lib/MC/MCAsmStreamer.cpp | |
parent | 70c8fe5e4e3dfdc2f676b71ba6241bd0891667b2 (diff) | |
download | bcm5719-llvm-3cde760023ea65b9f1359dd8a238085b8b5ebeaa.tar.gz bcm5719-llvm-3cde760023ea65b9f1359dd8a238085b8b5ebeaa.zip |
mcstreamerize gprel32 emission.
llvm-svn: 94452
Diffstat (limited to 'llvm/lib/MC/MCAsmStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCAsmStreamer.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index f9a3128f90a..d177f9525a1 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -110,6 +110,8 @@ public: virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace); virtual void EmitIntValue(uint64_t Value, unsigned Size, unsigned AddrSpace); + virtual void EmitGPRel32Value(const MCExpr *Value); + virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue, unsigned AddrSpace); @@ -182,12 +184,6 @@ static inline int64_t truncateToSize(int64_t Value, unsigned Bytes) { return Value & ((uint64_t) (int64_t) -1 >> (64 - Bytes * 8)); } -static inline const MCExpr *truncateToSize(const MCExpr *Value, - unsigned Bytes) { - // FIXME: Do we really need this routine? - return Value; -} - void MCAsmStreamer::SwitchSection(const MCSection *Section) { assert(Section && "Cannot switch to a null section!"); if (Section != CurSection) { @@ -425,10 +421,17 @@ void MCAsmStreamer::EmitValue(const MCExpr *Value, unsigned Size, } assert(Directive && "Invalid size for machine code value!"); - OS << Directive << *truncateToSize(Value, Size); + OS << Directive << *Value; EmitEOL(); } +void MCAsmStreamer::EmitGPRel32Value(const MCExpr *Value) { + assert(MAI.getGPRel32Directive() != 0); + OS << MAI.getGPRel32Directive() << *Value; + EmitEOL(); +} + + /// EmitFill - Emit NumBytes bytes worth of the value specified by /// FillValue. This implements directives such as '.space'. void MCAsmStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue, |