LLVM  10.0.0svn
DWARFDebugMacro.h
Go to the documentation of this file.
1 //===- DWARFDebugMacro.h ----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H
11 
12 #include "llvm/ADT/SmallVector.h"
14 #include <cstdint>
15 
16 namespace llvm {
17 
18 class raw_ostream;
19 
21  /// A single macro entry within a macro list.
22  struct Entry {
23  /// The type of the macro entry.
24  uint32_t Type;
25  union {
26  /// The source line where the macro is defined.
27  uint64_t Line;
28  /// Vendor extension constant value.
29  uint64_t ExtConstant;
30  };
31 
32  union {
33  /// The string (name, value) of the macro entry.
34  const char *MacroStr;
35  // An unsigned integer indicating the identity of the source file.
36  uint64_t File;
37  /// Vendor extension string.
38  const char *ExtStr;
39  };
40  };
41 
43 
44  /// A list of all the macro entries in the debug_macinfo section.
45  MacroList Macros;
46 
47 public:
48  DWARFDebugMacro() = default;
49 
50  /// Print the macro list found within the debug_macinfo section.
51  void dump(raw_ostream &OS) const;
52 
53  /// Parse the debug_macinfo section accessible via the 'data' parameter.
54  void parse(DataExtractor data);
55 
56  /// Return whether the section has any entries.
57  bool empty() const { return Macros.empty(); }
58 };
59 
60 } // end namespace llvm
61 
62 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
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
Instrumentation for Order File
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:55
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45