Provide a stub Target Streamer implementation for PPC MachO
authorIain Sandoe <iain@codesourcery.com>
Tue, 28 Jan 2014 11:03:17 +0000 (11:03 +0000)
committerIain Sandoe <iain@codesourcery.com>
Tue, 28 Jan 2014 11:03:17 +0000 (11:03 +0000)
At present, this handles .tc (error) and needs to be expanded to deal properly with .machine

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200309 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp

index 421a797886b9ee8c4b42697143a201a2568c7874..309c8fcca574d096b2e9069bfcdaf37c6a7fad35 100644 (file)
@@ -139,6 +139,18 @@ public:
     // limit the parser?
   }
 };
+
+class PPCTargetMachOStreamer : public PPCTargetStreamer {
+public:
+  PPCTargetMachOStreamer(MCStreamer &S) : PPCTargetStreamer(S) {}
+  virtual void emitTCEntry(const MCSymbol &S) {
+    llvm_unreachable("Unknown pseudo-op: .tc");
+  }
+  virtual void emitMachine(StringRef CPU) {
+    // FIXME: We should update the CPUType, CPUSubType in the Object file if
+    // the new values are different from the defaults.
+  }
+};
 }
 
 // This is duplicated code. Refactor this.
@@ -149,8 +161,11 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
                                     const MCSubtargetInfo &STI,
                                     bool RelaxAll,
                                     bool NoExecStack) {
-  if (Triple(TT).isOSDarwin())
-    return createMachOStreamer(Ctx, MAB, OS, Emitter, RelaxAll);
+  if (Triple(TT).isOSDarwin()) {
+    MCStreamer *S = createMachOStreamer(Ctx, MAB, OS, Emitter, RelaxAll);
+    new PPCTargetMachOStreamer(*S);
+    return S;
+  }
 
   MCStreamer *S =
       createELFStreamer(Ctx, MAB, OS, Emitter, RelaxAll, NoExecStack);