• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- RegionFragment.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_REGIONFRAGMENT_H
10 #define MCLD_FRAGMENT_REGIONFRAGMENT_H
11 
12 #include <mcld/Fragment/Fragment.h>
13 #include <llvm/ADT/StringRef.h>
14 
15 namespace mcld {
16 
17 /** \class RegionFragment
18  *  \brief RegionFragment is a kind of Fragment containing input memory region
19  */
20 class RegionFragment : public Fragment
21 {
22 public:
23   RegionFragment(llvm::StringRef pRegion, SectionData* pSD = NULL);
24 
25   ~RegionFragment();
26 
getRegion()27   const llvm::StringRef getRegion() const { return m_Region; }
getRegion()28   llvm::StringRef       getRegion()       { return m_Region; }
29 
classof(const Fragment * F)30   static bool classof(const Fragment *F)
31   { return F->getKind() == Fragment::Region; }
32 
classof(const RegionFragment *)33   static bool classof(const RegionFragment *)
34   { return true; }
35 
36   size_t size() const;
37 
38 private:
39   llvm::StringRef m_Region;
40 };
41 
42 } // namespace of mcld
43 
44 #endif
45 
46