Pass DIEHash::collectAttributes output argument by-pointer instead of by-value.

Before this, collectAttributes() was operating on a local object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188254 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evgeniy Stepanov 2013-08-13 07:57:01 +00:00
parent 6aa9315353
commit 15ab9f4aaa
3 changed files with 7 additions and 7 deletions

View File

@ -103,13 +103,13 @@ void DIEHash::addParentContext(DIE *Parent) {
}
// Collect all of the attributes for a particular DIE in single structure.
void DIEHash::collectAttributes(DIE *Die, DIEAttrs Attrs) {
void DIEHash::collectAttributes(DIE *Die, DIEAttrs *Attrs) {
const SmallVectorImpl<DIEValue *> &Values = Die->getValues();
const DIEAbbrev &Abbrevs = Die->getAbbrev();
#define COLLECT_ATTR(NAME) \
Attrs.NAME.Val = Values[i]; \
Attrs.NAME.Desc = &Abbrevs.getData()[i];
Attrs->NAME.Val = Values[i]; \
Attrs->NAME.Desc = &Abbrevs.getData()[i];
for (size_t i = 0, e = Values.size(); i != e; ++i) {
DEBUG(dbgs() << "Attribute: "
@ -165,7 +165,7 @@ void DIEHash::hashAttributes(DIEAttrs Attrs) {
void DIEHash::addAttributes(DIE *Die) {
DIEAttrs Attrs;
memset(&Attrs, 0, sizeof(Attrs));
collectAttributes(Die, Attrs);
collectAttributes(Die, &Attrs);
hashAttributes(Attrs);
}

View File

@ -59,7 +59,7 @@ private:
/// \brief Collects the attributes of DIE \param Die into the \param Attrs
/// structure.
void collectAttributes(DIE *Die, DIEAttrs Attrs);
void collectAttributes(DIE *Die, DIEAttrs *Attrs);
/// \brief Hashes the attributes in \param Attrs in order.
void hashAttributes(DIEAttrs Attrs);

View File

@ -3,8 +3,8 @@
; The source is an empty file.
; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x356a7d50a77f5177)
; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x356a7d50a77f5177)
; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0xa188c11a9264c05d)
; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0xa188c11a9264c05d)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3}