llvm.org GIT mirror llvm / b81715a
Add DWARFFormValue::getAsBlock() and add FC_Flag as an acceptable class for an unsigned constant. To be used in further patches that improve the dumpers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217129 91177308-0d34-0410-b5e6-96231b3b80d8 Frederic Riss 6 years ago
2 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
6969 Optional getAsCString(const DWARFUnit *U) const;
7070 Optional getAsAddress(const DWARFUnit *U) const;
7171 Optional getAsSectionOffset() const;
72 Optional> getAsBlock() const;
7273
7374 bool skipValue(DataExtractor debug_info_data, uint32_t *offset_ptr,
7475 const DWARFUnit *u) const;
542542 }
543543
544544 Optional DWARFFormValue::getAsUnsignedConstant() const {
545 if (!isFormClass(FC_Constant) || Form == DW_FORM_sdata)
545 if ((!isFormClass(FC_Constant) && !isFormClass(FC_Flag))
546 || Form == DW_FORM_sdata)
546547 return None;
547548 return Value.uval;
548549 }
550
551 Optional> DWARFFormValue::getAsBlock() const {
552 if (!isFormClass(FC_Block) && !isFormClass(FC_Exprloc))
553 return None;
554 return ArrayRef(Value.data, Value.uval);
555 }
556