LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DWARFAbbreviationDeclaration.h
Go to the documentation of this file.
1 //===-- DWARFAbbreviationDeclaration.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_DWARFABBREVIATIONDECLARATION_H
11 #define LLVM_DEBUGINFO_DWARFABBREVIATIONDECLARATION_H
12 
13 #include "llvm/ADT/SmallVector.h"
15 
16 namespace llvm {
17 
18 class raw_ostream;
19 
21  uint32_t Code;
22  uint32_t Tag;
23  bool HasChildren;
24 
25  struct AttributeSpec {
26  AttributeSpec(uint16_t Attr, uint16_t Form) : Attr(Attr), Form(Form) {}
27  uint16_t Attr;
28  uint16_t Form;
29  };
31 public:
33 
34  uint32_t getCode() const { return Code; }
35  uint32_t getTag() const { return Tag; }
36  bool hasChildren() const { return HasChildren; }
37  uint32_t getNumAttributes() const { return Attributes.size(); }
38  uint16_t getAttrByIndex(uint32_t idx) const {
39  return idx < Attributes.size() ? Attributes[idx].Attr : 0;
40  }
41  uint16_t getFormByIndex(uint32_t idx) const {
42  return idx < Attributes.size() ? Attributes[idx].Form : 0;
43  }
44 
45  uint32_t findAttributeIndex(uint16_t attr) const;
46  bool extract(DataExtractor Data, uint32_t* OffsetPtr);
47  void dump(raw_ostream &OS) const;
48 
49 private:
50  void clear();
51 };
52 
53 }
54 
55 #endif
bool extract(DataExtractor Data, uint32_t *OffsetPtr)
uint16_t getAttrByIndex(uint32_t idx) const
uint32_t findAttributeIndex(uint16_t attr) const
uint16_t getFormByIndex(uint32_t idx) const