• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- ScriptOptions.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_SCRIPT_OPTIONS_H
10 #define MCLD_SCRIPT_OPTIONS_H
11 #ifdef ENABLE_UNITTEST
12 #include <gtest.h>
13 #endif
14 #include <string>
15 #include <llvm/ADT/StringRef.h>
16 #include <mcld/ADT/StringEntry.h>
17 #include <mcld/ADT/StringHash.h>
18 #include <mcld/ADT/HashTable.h>
19 #include <mcld/Object/SectionMap.h>
20 
21 namespace mcld {
22 
23 /** \class ScriptOptions
24  *
25  */
26 class ScriptOptions
27 {
28 public:
29   typedef HashTable<StringEntry<llvm::StringRef>,
30                     StringHash<ELF>,
31                     StringEntryFactory<llvm::StringRef> > SymbolRenameMap;
32 
33   typedef HashTable<StringEntry<uint64_t>,
34                     StringHash<ELF>,
35                     StringEntryFactory<uint64_t> > AddressMap;
36 
37 public:
38   ScriptOptions();
39 
40   ~ScriptOptions();
41 
renameMap()42   const SymbolRenameMap& renameMap() const { return m_SymbolRenames; }
renameMap()43   SymbolRenameMap&       renameMap()       { return m_SymbolRenames; }
44 
addressMap()45   const AddressMap& addressMap() const { return m_AddressMap; }
addressMap()46   AddressMap&       addressMap()       { return m_AddressMap; }
47 
sectionMap()48   const SectionMap& sectionMap() const { return m_SectionMap; }
sectionMap()49   SectionMap&       sectionMap()       { return m_SectionMap; }
50 
51 private:
52   SymbolRenameMap m_SymbolRenames;
53   AddressMap m_AddressMap;
54   SectionMap m_SectionMap;
55 };
56 
57 } // namespace of mcld
58 
59 #endif
60 
61