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