[llvm] r200309 - Provide a stub Target Streamer implementation for PPC MachO
Iain Sandoe
iain at codesourcery.com
Tue Jan 28 03:03:18 PST 2014
Author: iains
Date: Tue Jan 28 05:03:17 2014
New Revision: 200309
URL: http://llvm.org/viewvc/llvm-project?rev=200309&view=rev
Log:
Provide a stub Target Streamer implementation for PPC MachO
At present, this handles .tc (error) and needs to be expanded to deal properly with .machine
Modified:
llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
Modified: llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp?rev=200309&r1=200308&r2=200309&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp Tue Jan 28 05:03:17 2014
@@ -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(cons
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);
More information about the llvm-commits
mailing list