diff mbox series

dwarf-reader: re-indent a block of code

Message ID 87wo2lf31d.fsf@redhat.com
State New
Headers show
Series dwarf-reader: re-indent a block of code | expand

Commit Message

Dodji Seketeli July 30, 2020, 3:14 p.m. UTC
-- From 63cfd6142cc809de68d34d11f518c90872167332 Mon Sep 17 00:00:00 2001
Hello,

While looking at something else, I noticed that a block of code in
compare_dies wasn't properly indented.  Fixed thus.

Applied to master.
 
	* src/abg-dwarf-reader.cc (compare_dies): Properly indent a
	sub-block of the big switch case statement in there.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-dwarf-reader.cc | 134 ++++++++++++++++++++++++------------------------
 1 file changed, 67 insertions(+), 67 deletions(-)
diff mbox series

Patch

diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index 98ac0f6..533c2dc 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -11875,75 +11875,75 @@  compare_dies(const read_context& ctxt,
 	    || (aggregates_being_compared.find(rn)
 		!= aggregates_being_compared.end()))
 	  result = true;
-      else if (l_tag == DW_TAG_subroutine_type)
-	{
-	  // The string reprs of l and r are already equal.  Now let's
-	  // just check if they both come from the same TU.
-	  bool from_the_same_tu = false;
-	  if (compare_dies_cu_decl_file(l, r, from_the_same_tu)
-	      && from_the_same_tu)
-	    result = true;
-	}
-      else
-	{
-	  if (!fn_die_equal_by_linkage_name(ctxt, l, r))
-	    {
-	      result = false;
-	      break;
-	    }
-
-	  if (!ctxt.die_is_in_c(l) && !ctxt.die_is_in_c(r))
-	    {
-	      // In C, we cannot have two different functions with the
-	      // same linkage name in a given binary.  But here we are
-	      // looking at DIEs that don't originate from C.  So we
-	      // need to compare return types and parameter types.
-	      Dwarf_Die l_return_type, r_return_type;
-	      bool l_return_type_is_void = !die_die_attribute(l, DW_AT_type,
-							      l_return_type);
-	      bool r_return_type_is_void = !die_die_attribute(r, DW_AT_type,
-							      r_return_type);
-	      if (l_return_type_is_void != r_return_type_is_void
-		  || (!l_return_type_is_void
-		      && !compare_dies(ctxt,
-				       &l_return_type, &r_return_type,
-				       aggregates_being_compared,
-				       update_canonical_dies_on_the_fly)))
+	else if (l_tag == DW_TAG_subroutine_type)
+	  {
+	    // The string reprs of l and r are already equal. Now
+	    // let's just check if they both come from the same TU.
+	    bool from_the_same_tu = false;
+	    if (compare_dies_cu_decl_file(l, r, from_the_same_tu)
+		&& from_the_same_tu)
+	      result = true;
+	  }
+	else
+	  {
+	    if (!fn_die_equal_by_linkage_name(ctxt, l, r))
+	      {
 		result = false;
-	      else
-		{
-		  Dwarf_Die l_child, r_child;
-		  bool found_l_child, found_r_child;
-		  for (found_l_child = dwarf_child(const_cast<Dwarf_Die*>(l),
-						   &l_child) == 0,
-			 found_r_child = dwarf_child(const_cast<Dwarf_Die*>(r),
-						     &r_child) == 0;
-		       found_l_child && found_r_child;
-		       found_l_child = dwarf_siblingof(&l_child,
-						       &l_child) == 0,
-			 found_r_child = dwarf_siblingof(&r_child,
-							 &r_child)==0)
-		    {
-		      int l_child_tag = dwarf_tag(&l_child);
-		      int r_child_tag = dwarf_tag(&r_child);
-		      if (l_child_tag != r_child_tag
-			  || (l_child_tag == DW_TAG_formal_parameter
-			      && !compare_dies(ctxt, &l_child, &r_child,
-					       aggregates_being_compared,
-					       update_canonical_dies_on_the_fly)))
-			{
-			  result = false;
-			  break;
-			}
-		    }
-		  if (found_l_child != found_r_child)
-		    result = false;
-		}
-	    }
+		break;
+	      }
 
-	  aggregates_being_compared.erase(ln);
-	  aggregates_being_compared.erase(rn);
-	}
+	    if (!ctxt.die_is_in_c(l) && !ctxt.die_is_in_c(r))
+	      {
+		// In C, we cannot have two different functions with the
+		// same linkage name in a given binary.  But here we are
+		// looking at DIEs that don't originate from C.  So we
+		// need to compare return types and parameter types.
+		Dwarf_Die l_return_type, r_return_type;
+		bool l_return_type_is_void = !die_die_attribute(l, DW_AT_type,
+								l_return_type);
+		bool r_return_type_is_void = !die_die_attribute(r, DW_AT_type,
+								r_return_type);
+		if (l_return_type_is_void != r_return_type_is_void
+		    || (!l_return_type_is_void
+			&& !compare_dies(ctxt,
+					 &l_return_type, &r_return_type,
+					 aggregates_being_compared,
+					 update_canonical_dies_on_the_fly)))
+		  result = false;
+		else
+		  {
+		    Dwarf_Die l_child, r_child;
+		    bool found_l_child, found_r_child;
+		    for (found_l_child = dwarf_child(const_cast<Dwarf_Die*>(l),
+						     &l_child) == 0,
+			   found_r_child = dwarf_child(const_cast<Dwarf_Die*>(r),
+						       &r_child) == 0;
+			 found_l_child && found_r_child;
+			 found_l_child = dwarf_siblingof(&l_child,
+							 &l_child) == 0,
+			   found_r_child = dwarf_siblingof(&r_child,
+							   &r_child)==0)
+		      {
+			int l_child_tag = dwarf_tag(&l_child);
+			int r_child_tag = dwarf_tag(&r_child);
+			if (l_child_tag != r_child_tag
+			    || (l_child_tag == DW_TAG_formal_parameter
+				&& !compare_dies(ctxt, &l_child, &r_child,
+						 aggregates_being_compared,
+						 update_canonical_dies_on_the_fly)))
+			  {
+			    result = false;
+			    break;
+			  }
+		      }
+		    if (found_l_child != found_r_child)
+		      result = false;
+		  }
+	      }
+
+	    aggregates_being_compared.erase(ln);
+	    aggregates_being_compared.erase(rn);
+	  }
       }
       break;