FillFragment.h revision 533eae20118036f425f27bf0536ef0ccbb090b65
1//===- FillFragment.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_FILLFRAGMENT_H
10#define MCLD_FRAGMENT_FILLFRAGMENT_H
11
12#include <llvm/Support/DataTypes.h>
13
14#include <mcld/Fragment/Fragment.h>
15
16namespace mcld {
17
18class SectionData;
19
20class FillFragment : public Fragment
21{
22public:
23  FillFragment(int64_t pValue, unsigned int pValueSize, uint64_t pSize,
24               SectionData* pSD = NULL);
25
26  int64_t getValue() const { return m_Value; }
27
28  unsigned getValueSize() const { return m_ValueSize; }
29
30  static bool classof(const Fragment *F)
31  { return F->getKind() == Fragment::Fillment; }
32
33  static bool classof(const FillFragment *) { return true; }
34
35  size_t size() const { return m_Size; }
36
37private:
38  /// m_Value - Value used for filling bytes
39  int64_t m_Value;
40
41  /// m_ValueSize - The size (in bytes) of \arg Value to use when filling, or 0
42  /// if this is a virtual fill fragment.
43  unsigned int m_ValueSize;
44
45  /// m_Size - The number of bytes to insert.
46  uint64_t m_Size;
47};
48
49} // namespace of mcld
50
51#endif
52
53