LLVM  3.7.0
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_LIB_DEBUGINFO_DWARFABBREVIATIONDECLARATION_H
11 #define LLVM_LIB_DEBUGINFO_DWARFABBREVIATIONDECLARATION_H
12 
13 #include "llvm/ADT/SmallVector.h"
15 
16 namespace llvm {
17 
18 class raw_ostream;
19 
21 public:
22  struct AttributeSpec {
23  AttributeSpec(uint16_t Attr, uint16_t Form) : Attr(Attr), Form(Form) {}
24  uint16_t Attr;
25  uint16_t Form;
26  };
28 
30 
31  uint32_t getCode() const { return Code; }
32  uint32_t getTag() const { return Tag; }
33  bool hasChildren() const { return HasChildren; }
34 
37 
39  return attr_iterator_range(AttributeSpecs.begin(), AttributeSpecs.end());
40  }
41 
42  uint16_t getFormByIndex(uint32_t idx) const {
43  return idx < AttributeSpecs.size() ? AttributeSpecs[idx].Form : 0;
44  }
45 
46  uint32_t findAttributeIndex(uint16_t attr) const;
47  bool extract(DataExtractor Data, uint32_t* OffsetPtr);
48  void dump(raw_ostream &OS) const;
49 
50 private:
51  void clear();
52 
53  uint32_t Code;
54  uint32_t Tag;
55  bool HasChildren;
56 
57  AttributeSpecVector AttributeSpecs;
58 };
59 
60 }
61 
62 #endif
bool extract(DataExtractor Data, uint32_t *OffsetPtr)
iterator_range< AttributeSpecVector::const_iterator > attr_iterator_range
uint32_t findAttributeIndex(uint16_t attr) const
uint16_t getFormByIndex(uint32_t idx) const
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:38
SmallVector< AttributeSpec, 8 > AttributeSpecVector