diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-05-17 21:54:26 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-05-17 21:54:26 +0000 |
commit | 9a744e38607bc3046dffea56efec0b2dfc51d5e4 (patch) | |
tree | 4bf44a58963ea7ef65b4dea08df69fe73dff1ee1 /include/llvm/MC/MCSectionELF.h | |
parent | db9014dd8b7b0b2581d10357b305f99f1b529316 (diff) | |
download | external_llvm-9a744e38607bc3046dffea56efec0b2dfc51d5e4.zip external_llvm-9a744e38607bc3046dffea56efec0b2dfc51d5e4.tar.gz external_llvm-9a744e38607bc3046dffea56efec0b2dfc51d5e4.tar.bz2 |
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 'include/llvm/MC/MCSectionELF.h')
-rw-r--r-- | include/llvm/MC/MCSectionELF.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/MC/MCSectionELF.h b/include/llvm/MC/MCSectionELF.h index 7054668..5fe8171 100644 --- a/include/llvm/MC/MCSectionELF.h +++ b/include/llvm/MC/MCSectionELF.h @@ -40,7 +40,7 @@ private: friend class MCContext; MCSectionELF(StringRef Section, unsigned type, unsigned flags, SectionKind K, bool isExplicit) - : MCSection(K), SectionName(Section), Type(type), Flags(flags), + : MCSection(SV_ELF, K), SectionName(Section), Type(type), Flags(flags), IsExplicit(isExplicit) {} ~MCSectionELF(); public: @@ -178,6 +178,11 @@ public: virtual bool isBaseAddressKnownZero() const { return (getFlags() & SHF_ALLOC) == 0; } + + static bool classof(const MCSection *S) { + return S->getVariant() == SV_ELF; + } + static bool classof(const MCSectionELF *) { return true; } }; } // end namespace llvm |