DebugInfoPDB: Make the symbol base case hold an IPDBSession ref.
[oota-llvm.git] / include / llvm / DebugInfo / PDB / PDBSymbolCustom.h
1 //===- PDBSymbolCustom.h - compiler-specific types --------------*- 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_PDBSYMBOLCUSTOM_H
11 #define LLVM_DEBUGINFO_PDB_PDBSYMBOLCUSTOM_H
12
13 #include "llvm/ADT/SmallVector.h"
14
15 #include "PDBSymbol.h"
16 #include "PDBTypes.h"
17
18 namespace llvm {
19
20 class raw_ostream;
21
22 /// PDBSymbolCustom represents symbols that are compiler-specific and do not
23 /// fit anywhere else in the lexical hierarchy.
24 /// https://msdn.microsoft.com/en-us/library/d88sf09h.aspx
25 class PDBSymbolCustom : public PDBSymbol {
26 public:
27   PDBSymbolCustom(IPDBSession &PDBSession,
28                   std::unique_ptr<IPDBRawSymbol> CustomSymbol);
29
30   void dump(llvm::raw_ostream &OS) const override;
31
32   void getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes);
33   FORWARD_SYMBOL_METHOD(getSymIndexId)
34
35   static bool classof(const PDBSymbol *S) {
36     return S->getSymTag() == PDB_SymType::Custom;
37   }
38 };
39
40 } // namespace llvm
41
42 #endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLCUSTOM_H