summaryrefslogtreecommitdiff
path: root/lib/Target/PIC16
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-17 21:54:26 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-17 21:54:26 +0000
commit9a744e38607bc3046dffea56efec0b2dfc51d5e4 (patch)
tree4bf44a58963ea7ef65b4dea08df69fe73dff1ee1 /lib/Target/PIC16
parentdb9014dd8b7b0b2581d10357b305f99f1b529316 (diff)
downloadllvm-9a744e38607bc3046dffea56efec0b2dfc51d5e4.tar.gz
llvm-9a744e38607bc3046dffea56efec0b2dfc51d5e4.tar.bz2
llvm-9a744e38607bc3046dffea56efec0b2dfc51d5e4.tar.xz
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
Diffstat (limited to 'lib/Target/PIC16')
-rw-r--r--lib/Target/PIC16/PIC16Section.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/PIC16/PIC16Section.h b/lib/Target/PIC16/PIC16Section.h
index 9039ca781a..5b33b51a38 100644
--- a/lib/Target/PIC16/PIC16Section.h
+++ b/lib/Target/PIC16/PIC16Section.h
@@ -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