LLVM  8.0.1
DWARFDebugMacro.h
Go to the documentation of this file.
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"
15 #include <cstdint>
16 
17 namespace llvm {
18 
19 class raw_ostream;
20 
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 
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 
54  /// Parse the debug_macinfo section accessible via the 'data' parameter.
55  void parse(DataExtractor data);
56 
57  /// Return whether the section has any entries.
58  bool empty() const { return Macros.empty(); }
59 };
60 
61 } // end namespace llvm
62 
63 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
bool empty() const
Return whether the section has any entries.
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
void parse(DataExtractor data)
Parse the debug_macinfo section accessible via the &#39;data&#39; parameter.
void dump(raw_ostream &OS) const
Print the macro list found within the debug_macinfo section.
LLVM_NODISCARD bool empty() const
Definition: SmallVector.h:56
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46