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