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 18namespace llvm { 19namespace codeview { 20class StreamReader; 21class StreamWriter; 22} 23namespace pdb { 24 25class NameMap { 26public: 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 36private: 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