PageRenderTime 70ms CodeModel.GetById 39ms app.highlight 5ms RepoModel.GetById 12ms app.codeStats 0ms

/3rd_party/llvm/lib/DebugInfo/DWARFDebugAbbrev.h

https://code.google.com/p/softart/
C++ Header | 73 lines | 52 code | 13 blank | 8 comment | 0 complexity | c1bed9779877a3252c8f7b1bfe211ace MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, JSON, MPL-2.0-no-copyleft-exception, GPL-2.0, GPL-3.0, LGPL-3.0, BSD-2-Clause
 1//===-- DWARFDebugAbbrev.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_DWARFDEBUGABBREV_H
11#define LLVM_DEBUGINFO_DWARFDEBUGABBREV_H
12
13#include "DWARFAbbreviationDeclaration.h"
14#include <list>
15#include <map>
16#include <vector>
17
18namespace llvm {
19
20typedef std::vector<DWARFAbbreviationDeclaration>
21  DWARFAbbreviationDeclarationColl;
22typedef DWARFAbbreviationDeclarationColl::iterator
23  DWARFAbbreviationDeclarationCollIter;
24typedef DWARFAbbreviationDeclarationColl::const_iterator
25  DWARFAbbreviationDeclarationCollConstIter;
26
27class DWARFAbbreviationDeclarationSet {
28  uint32_t Offset;
29  uint32_t IdxOffset;
30  std::vector<DWARFAbbreviationDeclaration> Decls;
31  public:
32  DWARFAbbreviationDeclarationSet()
33    : Offset(0), IdxOffset(0) {}
34
35  DWARFAbbreviationDeclarationSet(uint32_t offset, uint32_t idxOffset)
36    : Offset(offset), IdxOffset(idxOffset) {}
37
38  void clear() {
39    IdxOffset = 0;
40    Decls.clear();
41  }
42  uint32_t getOffset() const { return Offset; }
43  void dump(raw_ostream &OS) const;
44  bool extract(DataExtractor data, uint32_t* offset_ptr);
45
46  const DWARFAbbreviationDeclaration *
47    getAbbreviationDeclaration(uint32_t abbrCode) const;
48};
49
50class DWARFDebugAbbrev {
51public:
52  typedef std::map<uint64_t, DWARFAbbreviationDeclarationSet>
53    DWARFAbbreviationDeclarationCollMap;
54  typedef DWARFAbbreviationDeclarationCollMap::iterator
55    DWARFAbbreviationDeclarationCollMapIter;
56  typedef DWARFAbbreviationDeclarationCollMap::const_iterator
57    DWARFAbbreviationDeclarationCollMapConstIter;
58
59private:
60  DWARFAbbreviationDeclarationCollMap AbbrevCollMap;
61  mutable DWARFAbbreviationDeclarationCollMapConstIter PrevAbbrOffsetPos;
62
63public:
64  DWARFDebugAbbrev();
65  const DWARFAbbreviationDeclarationSet *
66    getAbbreviationDeclarationSet(uint64_t cu_abbr_offset) const;
67  void dump(raw_ostream &OS) const;
68  void parse(DataExtractor data);
69};
70
71}
72
73#endif