TargetFragment.h revision f33f6de54db174aa679a4b6d1e040d37e95541c0
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_FRAGMENT_TARGETFRAGMENT_H
10#define MCLD_FRAGMENT_TARGETFRAGMENT_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 TargetFragment
22 *  \brief TargetFragment is a kind of MCFragment inherited by
23 *  target-depedent Fragment.
24 */
25class TargetFragment : public Fragment
26{
27protected:
28  TargetFragment(Fragment::Type pKind, SectionData* pSD = NULL)
29    : Fragment(pKind, pSD) {}
30
31public:
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