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 public: 24 explicit NullFragment(SectionData* pSD = NULL); 25 26 /// size - size()27 size_t size() const { return 0x0; } 28 classof(const Fragment * F)29 static bool classof(const Fragment* F) { 30 return F->getKind() == Fragment::Null; 31 } 32 classof(const NullFragment *)33 static bool classof(const NullFragment*) { return true; } 34 }; 35 36 } // namespace mcld 37 38 #endif // MCLD_FRAGMENT_NULLFRAGMENT_H_ 39