1 //===- NullFragment.h -----------------------------------------------------===// 2 // 3 // The MCLinker Project 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #ifndef MCLD_FRAGMENT_NULLFRAGMENT_H 10 #define MCLD_FRAGMENT_NULLFRAGMENT_H 11 12 #include <mcld/Fragment/Fragment.h> 13 14 namespace mcld { 15 16 class SectionData; 17 18 /** \class NullFragment 19 * \brief NullFragment is a kind of MCFragment that presents the "end fragment" 20 * referenced by some special symbols 21 */ 22 class NullFragment : public Fragment 23 { 24 public: 25 NullFragment(SectionData* pSD = NULL); 26 27 /// size - size()28 size_t size() const { return 0x0; } 29 classof(const Fragment * F)30 static bool classof(const Fragment *F) 31 { return F->getKind() == Fragment::Null; } 32 classof(const NullFragment *)33 static bool classof(const NullFragment *) 34 { return true; } 35 }; 36 37 } // namespace of mcld 38 39 #endif 40 41