+/// AddAddress - Add an address attribute to a die based on the location
+/// provided.
+void DwarfWriter::AddAddress(DIE *Die, unsigned Attribute,
+ MachineLocation &Location) {
+ DIEBlock *Block = new DIEBlock();
+ if (Location.isRegister()) {
+ Block->AddUInt(DW_FORM_data1, DW_OP_reg0 + Location.getRegister());
+ } else {
+ Block->AddUInt(DW_FORM_data1, DW_OP_breg0 + Location.getRegister());
+ Block->AddUInt(DW_FORM_sdata, Location.getOffset());
+ }
+ Block->ComputeSize(*this);
+ Die->AddBlock(Attribute, 0, Block);
+}
+