1//===- TargetFragment.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 10#ifndef MCLD_LD_TARGET_FRAGMENT_H 11#define MCLD_LD_TARGET_FRAGMENT_H 12#ifdef ENABLE_UNITTEST 13#include <gtest.h> 14#endif 15 16#include <mcld/LD/Fragment.h> 17 18namespace mcld 19{ 20 21class SectionData; 22 23/** \class TargetFragment 24 * \brief TargetFragment is a kind of MCFragment inherited by 25 * target-depedent Fragment. 26 */ 27class TargetFragment : public Fragment 28{ 29protected: 30 TargetFragment(Fragment::Type pKind, SectionData* pSD = NULL) 31 : Fragment(pKind, pSD) {} 32 33public: 34 virtual ~TargetFragment() {} 35 36 virtual size_t getSize() const = 0; 37 38public: 39 static bool classof(const Fragment *F) 40 { return F->getKind() == Fragment::Target; } 41 42 static bool classof(const TargetFragment *) 43 { return true; } 44}; 45 46} // namespace of mcld 47 48#endif 49 50