Pass DIEHash::collectAttributes output argument by-pointer instead of by-value.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 13 Aug 2013 07:57:01 +0000 (07:57 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 13 Aug 2013 07:57:01 +0000 (07:57 +0000)
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

lib/CodeGen/AsmPrinter/DIEHash.cpp
lib/CodeGen/AsmPrinter/DIEHash.h
test/DebugInfo/X86/fission-hash.ll

index c9c4541e93e4ece0b3e4d7e0bb5d8d60df107493..e1166116735e69db357fa11e588bc2d1b13e9b63 100644 (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);
 }
 
index 3c025bb58ee7aec1b261d4c1ea3e3a2d01b1e171..0c7d6e25d5f7e0a97c8958a2debf0c715c4b7d05 100644 (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);
index 8ece061ba780928a5e4ed95477f42c947373ccbf..f0fe0d4cd5b88efbc8890fe68b21440ac5726f76 100644 (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}