LLVM  4.0.0
NameMapBuilder.h
Go to the documentation of this file.
1 //===- NameMapBuilder.h - PDB Name Map Builder ------------------*- 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_PDBNAMEMAPBUILDER_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAPBUILDER_H
12 
13 #include "llvm/ADT/StringMap.h"
14 #include "llvm/Support/Error.h"
15 
16 #include <cstdint>
17 #include <memory>
18 
19 namespace llvm {
20 namespace msf {
21 class StreamWriter;
22 }
23 namespace pdb {
24 class NameMap;
25 
27 public:
29 
30  void addMapping(StringRef Name, uint32_t Mapping);
31 
33  Error commit(msf::StreamWriter &Writer) const;
34 
36 
37 private:
39  uint32_t StringDataBytes = 0;
40 };
41 
42 } // end namespace pdb
43 } // end namespace llvm
44 
45 #endif // LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAPBUILDER_H
Tagged union holding either a T or a Error.
Expected< std::unique_ptr< NameMap > > build()
Error commit(msf::StreamWriter &Writer) const
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
void addMapping(StringRef Name, uint32_t Mapping)
uint32_t calculateSerializedLength() const