Avoid code duplication in the many unsupported EmitGPRel32Value implementations.
authorRafael Espindola <rafael.espindola@gmail.com>
Sun, 28 Nov 2010 15:09:24 +0000 (15:09 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sun, 28 Nov 2010 15:09:24 +0000 (15:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120243 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCStreamer.h
lib/MC/MCELFStreamer.cpp
lib/MC/MCMachOStreamer.cpp
lib/MC/MCPureStreamer.cpp
lib/MC/MCStreamer.cpp
lib/MC/WinCOFFStreamer.cpp

index 9cd615adeb878c7b1e03811957a59489644a3b7d..7e3fe665402983b6dc0f6b87f655b30eb2084656 100644 (file)
@@ -274,7 +274,7 @@ namespace llvm {
     ///
     /// This is used to implement assembler directives such as .gprel32 on
     /// targets that support them.
-    virtual void EmitGPRel32Value(const MCExpr *Value) = 0;
+    virtual void EmitGPRel32Value(const MCExpr *Value);
 
     /// EmitFill - Emit NumBytes bytes worth of the value specified by
     /// FillValue.  This implements directives such as '.space'.
index 5b707cb21893c6d1673c67c51e2cc55a615ea54f..2e0d85a1e2db8e369864794c664d0c7d4f9ab5a0 100644 (file)
@@ -125,9 +125,6 @@ public:
   }
   virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
   virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace);
-  virtual void EmitGPRel32Value(const MCExpr *Value) {
-    assert(0 && "ELF doesn't support this directive");
-  }
   virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
                                     unsigned ValueSize = 1,
                                     unsigned MaxBytesToEmit = 0);
index 39b1d4fd4ae96f3650b5eb1dd468eb1ae379d5a3..3f93604caafe0b916d903417e3c4e82a85270305 100644 (file)
@@ -75,9 +75,6 @@ public:
                               uint64_t Size, unsigned ByteAlignment = 0);
   virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
   virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace);
-  virtual void EmitGPRel32Value(const MCExpr *Value) {
-    assert(0 && "macho doesn't support this directive");
-  }
   virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
                                     unsigned ValueSize = 1,
                                     unsigned MaxBytesToEmit = 0);
index 2dfb389f092fe6daa2a7f427bb488e95d93531b2..ad365d981a32828bde25631ae0c6b3b308a60839 100644 (file)
@@ -91,9 +91,6 @@ public:
   virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) {
     report_fatal_error("unsupported directive in pure streamer");
   }
-  virtual void EmitGPRel32Value(const MCExpr *Value) {
-    report_fatal_error("unsupported directive in pure streamer");
-  }
   virtual void EmitFileDirective(StringRef Filename) {
     report_fatal_error("unsupported directive in pure streamer");
   }
index 69318ea354307998b44bfd6fd543ef5e646f5baa..7921957f5423ede410bba54f024cb45d61905e73 100644 (file)
@@ -55,6 +55,10 @@ void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
   EmitValue(MCSymbolRefExpr::Create(Sym, getContext()), Size, AddrSpace);
 }
 
+void MCStreamer::EmitGPRel32Value(const MCExpr *Value) {
+  report_fatal_error("unsupported directive in streamer");
+}
+
 /// EmitFill - Emit NumBytes bytes worth of the value specified by
 /// FillValue.  This implements directives such as '.space'.
 void MCStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue,
index 0f0224891d595350ea8ec1d65db0ea39c5d68c97..cba71882676aef2b873dbd820981f0c15b7fe453 100644 (file)
@@ -70,7 +70,6 @@ public:
   virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
   virtual void EmitValue(const MCExpr *Value, unsigned Size,
                          unsigned AddrSpace);
-  virtual void EmitGPRel32Value(const MCExpr *Value);
   virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
                                    unsigned ValueSize, unsigned MaxBytesToEmit);
   virtual void EmitCodeAlignment(unsigned ByteAlignment,
@@ -368,10 +367,6 @@ void WinCOFFStreamer::EmitValue(const MCExpr *Value, unsigned Size,
   }
 }
 
-void WinCOFFStreamer::EmitGPRel32Value(const MCExpr *Value) {
-  llvm_unreachable("not implemented");
-}
-
 void WinCOFFStreamer::EmitValueToAlignment(unsigned ByteAlignment,
                                            int64_t Value,
                                            unsigned ValueSize,