]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
MFV r316922: 5380 receive of a send -p stream doesn't need to try renaming snapshots
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / DWARF / DWARFDebugMacro.h
1 //===-- DWARFDebugMacro.h ---------------------------------------*- 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_DWARF_DWARFDEBUGMACRO_H
11 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H
12
13 #include "llvm/ADT/SmallVector.h"
14 #include "llvm/Support/DataExtractor.h"
15 #include <cstdint>
16
17 namespace llvm {
18
19 class raw_ostream;
20
21 class DWARFDebugMacro {
22   /// A single macro entry within a macro list.
23   struct Entry {
24     /// The type of the macro entry.
25     uint32_t Type;
26     union {
27       /// The source line where the macro is defined.
28       uint64_t Line;
29       /// Vendor extension constant value.
30       uint64_t ExtConstant;
31     };
32
33     union {
34       /// The string (name, value) of the macro entry.
35       const char *MacroStr;
36       // An unsigned integer indicating the identity of the source file.
37       uint64_t File;
38       /// Vendor extension string.
39       const char *ExtStr;
40     };
41   };
42
43   typedef SmallVector<Entry, 4> MacroList;
44
45   /// A list of all the macro entries in the debug_macinfo section.
46   MacroList Macros;
47
48 public:
49   DWARFDebugMacro() = default;
50
51   /// Print the macro list found within the debug_macinfo section.
52   void dump(raw_ostream &OS) const;
53   /// Parse the debug_macinfo section accessible via the 'data' parameter.
54   void parse(DataExtractor data);
55 };
56
57 } // end namespace llvm
58
59 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H