1 //===- DWARFDebugMacro.h ----------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H
12 #include "llvm/ADT/SmallVector.h"
13 #include "llvm/Support/DataExtractor.h"
20 class DWARFDebugMacro
{
21 /// A single macro entry within a macro list.
23 /// The type of the macro entry.
26 /// The source line where the macro is defined.
28 /// Vendor extension constant value.
33 /// The string (name, value) of the macro entry.
35 // An unsigned integer indicating the identity of the source file.
37 /// Vendor extension string.
42 using MacroList
= SmallVector
<Entry
, 4>;
44 /// A list of all the macro entries in the debug_macinfo section.
48 DWARFDebugMacro() = default;
50 /// Print the macro list found within the debug_macinfo section.
51 void dump(raw_ostream
&OS
) const;
53 /// Parse the debug_macinfo section accessible via the 'data' parameter.
54 void parse(DataExtractor data
);
56 /// Return whether the section has any entries.
57 bool empty() const { return Macros
.empty(); }
60 } // end namespace llvm
62 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H