mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Give the MCStreamer class hierarchy LLVM RTTI facilities for use with
isa<> and dyn_cast<>. In several places, code is already hacking around the absence of this, and there seem to be several interfaces that might be lifted and/or devirtualized using this. This change was based on a discussion with Jim Grosbach about how best to handle testing for specific MCStreamer subclasses. He said that this was the correct end state, and everything else was too hacky so I decided to just make it so. No functionality should be changed here, this is just threading the kind through all the constructors and setting up the classof overloads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174113 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -733,7 +733,8 @@ namespace {
|
||||
return Symbols.end();
|
||||
}
|
||||
|
||||
RecordStreamer(MCContext &Context) : MCStreamer(Context) {}
|
||||
RecordStreamer(MCContext &Context)
|
||||
: MCStreamer(SK_RecordStreamer, Context) {}
|
||||
|
||||
virtual void EmitInstruction(const MCInst &Inst) {
|
||||
// Scan for values.
|
||||
@@ -804,6 +805,10 @@ namespace {
|
||||
const MCSymbol *Label,
|
||||
unsigned PointerSize) {}
|
||||
virtual void FinishImpl() {}
|
||||
|
||||
static bool classof(const MCStreamer *S) {
|
||||
return S->getKind == SK_RecordStreamer;
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
|
Reference in New Issue
Block a user