1 //===- SectLinkerOption.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_SECTLINKERDATA_H 10 #define MCLD_SECTLINKERDATA_H 11 #ifdef ENABLE_UNITTEST 12 #include <gtest.h> 13 #endif 14 15 #include "mcld/MC/MCLDInfo.h" 16 #include "mcld/Support/PositionDependentOption.h" 17 18 #include <string> 19 20 namespace mcld 21 { 22 class PositionDependentOption; 23 24 /** \class SectLinkerOption 25 * \brief This file collects inputs to linker. 26 */ 27 class SectLinkerOption 28 { 29 public: 30 // Constructor. 31 SectLinkerOption(MCLDInfo &pLDInfo); 32 33 // ----- Position-dependent Options ----- // 34 inline void appendOption(PositionDependentOption *pOption) 35 { m_PosDepOptions.push_back(pOption); } 36 37 inline void prependOption(PositionDependentOption *pOption) 38 { m_PosDepOptions.insert(m_PosDepOptions.begin(), pOption); } 39 40 inline const PositionDependentOptions &pos_dep_options() const 41 { return m_PosDepOptions; } 42 inline PositionDependentOptions &pos_dep_options() 43 { return m_PosDepOptions; } 44 45 inline const MCLDInfo &info() const { return *m_pLDInfo; } 46 inline MCLDInfo &info() { return *m_pLDInfo; } 47 48 ~SectLinkerOption(); 49 50 private: 51 MCLDInfo *m_pLDInfo; 52 PositionDependentOptions m_PosDepOptions; 53 }; 54 55 } // namespace of mcld 56 57 #endif 58