#ifndef LLVM_SUPPORT_DWARF_H
#define LLVM_SUPPORT_DWARF_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataTypes.h"
namespace llvm {
//===----------------------------------------------------------------------===//
// Debug info constants.
-enum {
+enum LLVM_ENUM_INT_TYPE(uint32_t) {
LLVMDebugVersion = (12 << 16), // Current version of debug information.
LLVMDebugVersion11 = (11 << 16), // Constant for version 11.
LLVMDebugVersion10 = (10 << 16), // Constant for version 10.
// Do not mix the following two enumerations sets. DW_TAG_invalid changes the
// enumeration base type.
-enum LLVMConstants {
+enum LLVMConstants LLVM_ENUM_INT_TYPE(uint32_t) {
// llvm mock tags
DW_TAG_invalid = ~0U, // Tag for invalid results.
DWARF_VERSION = 4, // Default dwarf version we output.
DW_CIE_VERSION = 1, // Common frame information version.
DW_PUBTYPES_VERSION = 2, // Section version number for .debug_pubtypes.
- DW_PUBNAMES_VERSION = 2 // Section version number for .debug_pubnames.
+ DW_PUBNAMES_VERSION = 2, // Section version number for .debug_pubnames.
+ DW_ARANGES_VERSION = 2 // Section version number for .debug_aranges.
};
// Special ID values that distinguish a CIE from a FDE in DWARF CFI.
GIEK_OTHER,
GIEK_UNUSED5,
GIEK_UNUSED6,
- GIEK_UNUSED7,
+ GIEK_UNUSED7
};
+const char *GDBIndexEntryKindString(GDBIndexEntryKind Kind);
+
enum GDBIndexEntryLinkage {
GIEL_EXTERNAL,
GIEL_STATIC
};
+const char *GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);
+
/// The gnu_pub* kind looks like:
///
/// 0-3 reserved
/// offset of the cu within the debug_info section stored in those 24 bits.
struct PubIndexEntryDescriptor {
GDBIndexEntryKind Kind;
- bool Static;
- PubIndexEntryDescriptor(GDBIndexEntryKind Kind, bool Static)
- : Kind(Kind), Static(Static) {}
+ GDBIndexEntryLinkage Linkage;
+ PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
+ : Kind(Kind), Linkage(Linkage) {}
/* implicit */ PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
- : Kind(Kind), Static(false) {}
+ : Kind(Kind), Linkage(GIEL_EXTERNAL) {}
explicit PubIndexEntryDescriptor(uint8_t Value)
: Kind(static_cast<GDBIndexEntryKind>((Value & KIND_MASK) >>
KIND_OFFSET)),
- Static(Value & STATIC_MASK) {}
- uint8_t toBits() {
- return Kind << KIND_OFFSET | Static << STATIC_OFFSET;
- }
+ Linkage(static_cast<GDBIndexEntryLinkage>((Value & LINKAGE_MASK) >>
+ LINKAGE_OFFSET)) {}
+ uint8_t toBits() { return Kind << KIND_OFFSET | Linkage << LINKAGE_OFFSET; }
+
private:
enum {
KIND_OFFSET = 4,
KIND_MASK = 7 << KIND_OFFSET,
- STATIC_OFFSET = 7,
- STATIC_MASK = 1 << STATIC_OFFSET
+ LINKAGE_OFFSET = 7,
+ LINKAGE_MASK = 1 << LINKAGE_OFFSET
};
};