NullFragment.h revision f33f6de54db174aa679a4b6d1e040d37e95541c0
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#ifdef ENABLE_UNITTEST 12#include <gtest.h> 13#endif 14 15#include <mcld/Fragment/Fragment.h> 16 17namespace mcld { 18 19class 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 */ 25class NullFragment : public Fragment 26{ 27public: 28 NullFragment(SectionData* pSD = NULL); 29 30 /// size - 31 size_t size() const { return 0x0; } 32 33 static bool classof(const Fragment *F) 34 { return F->getKind() == Fragment::Null; } 35 36 static bool classof(const NullFragment *) 37 { return true; } 38}; 39 40} // namespace of mcld 41 42#endif 43 44