LLVM  3.7.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::DWARFFormValue Class Reference

#include <DWARFFormValue.h>

Public Types

enum  FormClass {
  FC_Unknown, FC_Address, FC_Block, FC_Constant,
  FC_String, FC_Flag, FC_Reference, FC_Indirect,
  FC_SectionOffset, FC_Exprloc
}
 

Public Member Functions

 DWARFFormValue (uint16_t Form=0)
 
uint16_t getForm () const
 
bool isFormClass (FormClass FC) const
 
void dump (raw_ostream &OS, const DWARFUnit *U) const
 
bool extractValue (DataExtractor data, uint32_t *offset_ptr, const DWARFUnit *u)
 extracts a value in data at offset *offset_ptr. More...
 
bool isInlinedCStr () const
 
Optional< uint64_t > getAsReference (const DWARFUnit *U) const
 getAsFoo functions below return the extracted value as Foo if only DWARFFormValue has form class is suitable for representing Foo. More...
 
Optional< uint64_t > getAsUnsignedConstant () const
 
Optional< int64_t > getAsSignedConstant () const
 
Optional< const char * > getAsCString (const DWARFUnit *U) const
 
Optional< uint64_t > getAsAddress (const DWARFUnit *U) const
 
Optional< uint64_t > getAsSectionOffset () const
 
Optional< ArrayRef< uint8_t > > getAsBlock () const
 
bool skipValue (DataExtractor debug_info_data, uint32_t *offset_ptr, const DWARFUnit *u) const
 

Static Public Member Functions

static bool skipValue (uint16_t form, DataExtractor debug_info_data, uint32_t *offset_ptr, const DWARFUnit *u)
 
static ArrayRef< uint8_t > getFixedFormSizes (uint8_t AddrSize, uint16_t Version)
 

Detailed Description

Definition at line 22 of file DWARFFormValue.h.

Member Enumeration Documentation

Enumerator
FC_Unknown 
FC_Address 
FC_Block 
FC_Constant 
FC_String 
FC_Flag 
FC_Reference 
FC_Indirect 
FC_SectionOffset 
FC_Exprloc 

Definition at line 24 of file DWARFFormValue.h.

Constructor & Destructor Documentation

llvm::DWARFFormValue::DWARFFormValue ( uint16_t  Form = 0)
inline

Definition at line 55 of file DWARFFormValue.h.

Member Function Documentation

void DWARFFormValue::dump ( raw_ostream OS,
const DWARFUnit U 
) const
bool DWARFFormValue::extractValue ( DataExtractor  data,
uint32_t *  offset_ptr,
const DWARFUnit u 
)

extracts a value in data at offset *offset_ptr.

The passed DWARFUnit is allowed to be nullptr, in which case no relocation processing will be performed and some kind of forms that depend on Unit information are disallowed.

Returns
whether the extraction succeeded.

Definition at line 134 of file DWARFFormValue.cpp.

References llvm::StringRef::data(), llvm::dwarf::DW_FORM_addr, llvm::dwarf::DW_FORM_block, llvm::dwarf::DW_FORM_block1, llvm::dwarf::DW_FORM_block2, llvm::dwarf::DW_FORM_block4, llvm::dwarf::DW_FORM_data1, llvm::dwarf::DW_FORM_data2, llvm::dwarf::DW_FORM_data4, llvm::dwarf::DW_FORM_data8, llvm::dwarf::DW_FORM_exprloc, llvm::dwarf::DW_FORM_flag, llvm::dwarf::DW_FORM_flag_present, llvm::dwarf::DW_FORM_GNU_addr_index, llvm::dwarf::DW_FORM_GNU_ref_alt, llvm::dwarf::DW_FORM_GNU_str_index, llvm::dwarf::DW_FORM_GNU_strp_alt, llvm::dwarf::DW_FORM_indirect, llvm::dwarf::DW_FORM_ref1, llvm::dwarf::DW_FORM_ref2, llvm::dwarf::DW_FORM_ref4, llvm::dwarf::DW_FORM_ref8, llvm::dwarf::DW_FORM_ref_addr, llvm::dwarf::DW_FORM_ref_sig8, llvm::dwarf::DW_FORM_ref_udata, llvm::dwarf::DW_FORM_sdata, llvm::dwarf::DW_FORM_sec_offset, llvm::dwarf::DW_FORM_string, llvm::dwarf::DW_FORM_strp, llvm::dwarf::DW_FORM_udata, llvm::StringRef::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::DWARFUnit::getAddressByteSize(), llvm::DataExtractor::getCStr(), llvm::DataExtractor::getData(), llvm::DWARFUnit::getRelocMap(), llvm::DataExtractor::getSLEB128(), llvm::DataExtractor::getU16(), llvm::DataExtractor::getU32(), llvm::DataExtractor::getU64(), llvm::DataExtractor::getU8(), llvm::DataExtractor::getULEB128(), llvm::DataExtractor::getUnsigned(), llvm::DWARFUnit::getVersion(), and llvm::StringRef::substr().

Referenced by llvm::DWARFDebugInfoEntryMinimal::dumpAttribute(), and llvm::DWARFDebugInfoEntryMinimal::getAttributeValue().

Optional< uint64_t > DWARFFormValue::getAsAddress ( const DWARFUnit U) const
Optional< ArrayRef< uint8_t > > DWARFFormValue::getAsBlock ( ) const

Definition at line 584 of file DWARFFormValue.cpp.

References llvm::None.

Optional< const char * > DWARFFormValue::getAsCString ( const DWARFUnit U) const
Optional< uint64_t > DWARFFormValue::getAsReference ( const DWARFUnit U) const
Optional< uint64_t > DWARFFormValue::getAsSectionOffset ( ) const
Optional< int64_t > DWARFFormValue::getAsSignedConstant ( ) const
Optional< uint64_t > DWARFFormValue::getAsUnsignedConstant ( ) const
ArrayRef< uint8_t > DWARFFormValue::getFixedFormSizes ( uint8_t  AddrSize,
uint16_t  Version 
)
static

Definition at line 66 of file DWARFFormValue.cpp.

References llvm::None.

Referenced by llvm::DWARFDebugInfoEntryMinimal::extractFast().

uint16_t llvm::DWARFFormValue::getForm ( ) const
inline

Definition at line 56 of file DWARFFormValue.h.

bool DWARFFormValue::isFormClass ( DWARFFormValue::FormClass  FC) const
bool llvm::DWARFFormValue::isInlinedCStr ( ) const
inline

Definition at line 69 of file DWARFFormValue.h.

bool DWARFFormValue::skipValue ( DataExtractor  debug_info_data,
uint32_t *  offset_ptr,
const DWARFUnit u 
) const
bool DWARFFormValue::skipValue ( uint16_t  form,
DataExtractor  debug_info_data,
uint32_t *  offset_ptr,
const DWARFUnit u 
)
static

The documentation for this class was generated from the following files: