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_LD_NULL_FRAGMENT_H 10 #define MCLD_LD_NULL_FRAGMENT_H 11 #ifdef ENABLE_UNITTEST 12 #include <gtest.h> 13 #endif 14 15 #include <mcld/Fragment/Fragment.h> 16 17 namespace mcld { 18 19 class SectionData; 20 21 /** \class NullFragment 22 * \brief NullFragment is a kind of MCFragment that presents the "end fragment" 23 * referenced by some special symbols 24 */ 25 class NullFragment : public Fragment 26 { 27 public: 28 NullFragment(SectionData* pSD = NULL); 29 30 /// size - size()31 size_t size() const { return 0x0; } 32 classof(const Fragment * F)33 static bool classof(const Fragment *F) 34 { return F->getKind() == Fragment::Null; } 35 classof(const NullFragment *)36 static bool classof(const NullFragment *) 37 { return true; } 38 }; 39 40 } // namespace of mcld 41 42 #endif 43 44