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 #ifndef MCLD_LD_TARGET_FRAGMENT_H 10 #define MCLD_LD_TARGET_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 TargetFragment 22 * \brief TargetFragment is a kind of MCFragment inherited by 23 * target-depedent Fragment. 24 */ 25 class TargetFragment : public Fragment 26 { 27 protected: 28 TargetFragment(Fragment::Type pKind, SectionData* pSD = NULL) 29 : Fragment(pKind, pSD) {} 30 31 public: 32 virtual ~TargetFragment() {} 33 34 static bool classof(const Fragment *F) 35 { return F->getKind() == Fragment::Target; } 36 37 static bool classof(const TargetFragment *) 38 { return true; } 39 }; 40 41 } // namespace of mcld 42 43 #endif 44 45