forked from OSchip/llvm-project
This patch changes a static_cast to dyn_cast
for MipsELFStreamer objects. Contributer: Jack Carter llvm-svn: 174354
This commit is contained in:
parent
0120178909
commit
10be6aef15
|
@ -57,6 +57,7 @@ namespace llvm {
|
|||
SK_ARMELFStreamer,
|
||||
SK_MachOStreamer,
|
||||
SK_PureStreamer,
|
||||
SK_MipsELFStreamer,
|
||||
SK_WinCOFFStreamer
|
||||
};
|
||||
|
||||
|
|
|
@ -19,12 +19,16 @@ public:
|
|||
MipsELFStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
raw_ostream &OS, MCCodeEmitter *Emitter,
|
||||
bool RelaxAll, bool NoExecStack)
|
||||
: MCELFStreamer(Context, TAB, OS, Emitter) {
|
||||
: MCELFStreamer(SK_MipsELFStreamer, Context, TAB, OS, Emitter) {
|
||||
}
|
||||
|
||||
~MipsELFStreamer() {}
|
||||
void emitELFHeaderFlagsCG(const MipsSubtarget &Subtarget);
|
||||
// void emitELFHeaderFlagCG(unsigned Val);
|
||||
|
||||
static bool classof(const MCStreamer *S) {
|
||||
return S->getKind() == SK_MipsELFStreamer;
|
||||
}
|
||||
};
|
||||
|
||||
MCELFStreamer* createMipsELFStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
|
|
|
@ -551,8 +551,8 @@ void MipsAsmPrinter::EmitEndOfAsmFile(Module &M) {
|
|||
// Emit Mips ELF register info
|
||||
Subtarget->getMReginfo().emitMipsReginfoSectionCG(
|
||||
OutStreamer, getObjFileLowering(), *Subtarget);
|
||||
MipsELFStreamer & MES = static_cast<MipsELFStreamer &>(OutStreamer);
|
||||
MES.emitELFHeaderFlagsCG(*Subtarget);
|
||||
if (MipsELFStreamer *MES = dyn_cast<MipsELFStreamer>(&OutStreamer))
|
||||
MES->emitELFHeaderFlagsCG(*Subtarget);
|
||||
}
|
||||
|
||||
MachineLocation
|
||||
|
|
Loading…
Reference in New Issue