mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
MC: Add dyn_cast support to MCSection.
- Of questionable utility, since in general anything which wants to do this should probably be within a target specific hook, which can rely on the sections being of the appropriate type. However, it can be useful for short term hacks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103980 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -44,7 +44,8 @@ namespace llvm {
|
||||
unsigned Size;
|
||||
|
||||
PIC16Section(StringRef name, SectionKind K, StringRef addr, int color)
|
||||
: MCSection(K), Name(name), Address(addr), Color(color), Size(0) {
|
||||
: MCSection(SV_PIC16, K), Name(name), Address(addr),
|
||||
Color(color), Size(0) {
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -86,6 +87,11 @@ namespace llvm {
|
||||
/// to a section.
|
||||
virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
|
||||
raw_ostream &OS) const;
|
||||
|
||||
static bool classof(const MCSection *S) {
|
||||
return S->getVariant() == SV_PIC16;
|
||||
}
|
||||
static bool classof(const PIC16Section *) { return true; }
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
Reference in New Issue
Block a user