1 //===- NameMap.h - PDB Name Map ---------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAP_H 11 #define LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAP_H 12 13 #include "llvm/ADT/StringMap.h" 14 #include "llvm/ADT/StringRef.h" 15 #include "llvm/Support/Error.h" 16 #include <cstdint> 17 18 namespace llvm { 19 namespace codeview { 20 class StreamReader; 21 class StreamWriter; 22 } 23 namespace pdb { 24 25 class NameMap { 26 public: 27 NameMap(); 28 29 Error load(codeview::StreamReader &Stream); 30 Error commit(codeview::StreamWriter &Writer); 31 32 bool tryGetValue(StringRef Name, uint32_t &Value) const; 33 34 iterator_range<StringMapConstIterator<uint32_t>> entries() const; 35 36 private: 37 StringMap<uint32_t> Mapping; 38 }; 39 40 } // end namespace pdb 41 } // end namespace llvm 42 43 #endif // LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAP_H 44