blob: 4f1908ae3efb648ef40e112d1a2b76c06a3a99f2 [file] [log] [blame]
//===- RegionFragment.h ---------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_FRAGMENT_REGIONFRAGMENT_H
#define MCLD_FRAGMENT_REGIONFRAGMENT_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
#include <mcld/Fragment/Fragment.h>
#include <llvm/ADT/StringRef.h>
namespace mcld {
/** \class RegionFragment
* \brief RegionFragment is a kind of Fragment containing input memory region
*/
class RegionFragment : public Fragment
{
public:
RegionFragment(llvm::StringRef pRegion, SectionData* pSD = NULL);
~RegionFragment();
const llvm::StringRef getRegion() const { return m_Region; }
llvm::StringRef getRegion() { return m_Region; }
static bool classof(const Fragment *F)
{ return F->getKind() == Fragment::Region; }
static bool classof(const RegionFragment *)
{ return true; }
size_t size() const;
private:
llvm::StringRef m_Region;
};
} // namespace of mcld
#endif