LLVM API Documentation

DWARFDebugAbbrev.h
Go to the documentation of this file.
00001 //===-- DWARFDebugAbbrev.h --------------------------------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef LLVM_LIB_DEBUGINFO_DWARFDEBUGABBREV_H
00011 #define LLVM_LIB_DEBUGINFO_DWARFDEBUGABBREV_H
00012 
00013 #include "DWARFAbbreviationDeclaration.h"
00014 #include <list>
00015 #include <map>
00016 #include <vector>
00017 
00018 namespace llvm {
00019 
00020 class DWARFAbbreviationDeclarationSet {
00021   uint32_t Offset;
00022   /// Code of the first abbreviation, if all abbreviations in the set have
00023   /// consecutive codes. UINT32_MAX otherwise.
00024   uint32_t FirstAbbrCode;
00025   std::vector<DWARFAbbreviationDeclaration> Decls;
00026 
00027 public:
00028   DWARFAbbreviationDeclarationSet();
00029 
00030   uint32_t getOffset() const { return Offset; }
00031   void dump(raw_ostream &OS) const;
00032   bool extract(DataExtractor Data, uint32_t *OffsetPtr);
00033 
00034   const DWARFAbbreviationDeclaration *
00035   getAbbreviationDeclaration(uint32_t AbbrCode) const;
00036 
00037 private:
00038   void clear();
00039 };
00040 
00041 class DWARFDebugAbbrev {
00042   typedef std::map<uint64_t, DWARFAbbreviationDeclarationSet>
00043     DWARFAbbreviationDeclarationSetMap;
00044 
00045   DWARFAbbreviationDeclarationSetMap AbbrDeclSets;
00046   mutable DWARFAbbreviationDeclarationSetMap::const_iterator PrevAbbrOffsetPos;
00047 
00048 public:
00049   DWARFDebugAbbrev();
00050 
00051   const DWARFAbbreviationDeclarationSet *
00052   getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const;
00053 
00054   void dump(raw_ostream &OS) const;
00055   void extract(DataExtractor Data);
00056 
00057 private:
00058   void clear();
00059 };
00060 
00061 }
00062 
00063 #endif