[lld] r176925 - [Pass][Layout] Add extra debugging information

Shankar Easwaran shankare at codeaurora.org
Tue Mar 12 21:05:38 PDT 2013


Author: shankare
Date: Tue Mar 12 23:05:38 2013
New Revision: 176925

URL: http://llvm.org/viewvc/llvm-project?rev=176925&view=rev
Log:
[Pass][Layout] Add extra debugging information

Modified:
    lld/trunk/lib/Passes/LayoutPass.cpp

Modified: lld/trunk/lib/Passes/LayoutPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Passes/LayoutPass.cpp?rev=176925&r1=176924&r2=176925&view=diff
==============================================================================
--- lld/trunk/lib/Passes/LayoutPass.cpp (original)
+++ lld/trunk/lib/Passes/LayoutPass.cpp Tue Mar 12 23:05:38 2013
@@ -29,29 +29,35 @@ bool LayoutPass::CompareAtoms::operator(
   if (left == right)
     return false;
 
-  DEBUG(llvm::dbgs() << "Sorting by perms\n");
-
   // Sort same permissions together.
   DefinedAtom::ContentPermissions leftPerms = left->permissions();
   DefinedAtom::ContentPermissions rightPerms = right->permissions();
+
+  DEBUG(llvm::dbgs() << "Sorting by contentPerms"
+                     << "(" << leftPerms << "," << rightPerms << ")\n");
+
   if (leftPerms != rightPerms)
     return leftPerms < rightPerms;
 
-  DEBUG(llvm::dbgs() << "Sorting by contentType\n");
-
   // Sort same content types together.
   DefinedAtom::ContentType leftType = left->contentType();
   DefinedAtom::ContentType rightType = right->contentType();
+
+  DEBUG(llvm::dbgs() << "Sorting by contentType"
+                     << "(" << leftType << "," << rightType << ")\n");
+
   if (leftType != rightType)
     return leftType < rightType;
 
   // TO DO: Sort atoms in customs sections together.
 
-  DEBUG(llvm::dbgs() << "Sorting by sectionPos\n");
-
   // Sort by section position preference.
   DefinedAtom::SectionPosition leftPos = left->sectionPosition();
   DefinedAtom::SectionPosition rightPos = right->sectionPosition();
+
+  DEBUG(llvm::dbgs() << "Sorting by sectionPos"
+                     << "(" << leftPos << "," << rightPos << ")\n");
+
   bool leftSpecialPos = (leftPos != DefinedAtom::sectionPositionAny);
   bool rightSpecialPos = (rightPos != DefinedAtom::sectionPositionAny);
   if (leftSpecialPos || rightSpecialPos) {
@@ -83,19 +89,25 @@ bool LayoutPass::CompareAtoms::operator(
     }
   }
 
-  DEBUG(llvm::dbgs() << "Sorting by .o order\n");
-
   // Sort by .o order.
   const File *leftFile = &left->file();
   const File *rightFile = &right->file();
+
+  DEBUG(llvm::dbgs()
+        << "Sorting by .o order("
+        << "(" << leftFile->ordinal() << "," << rightFile->ordinal() << ")"
+        << "[" << leftFile->path() << "," << rightFile->path() << "]\n");
+
   if (leftFile != rightFile)
     return leftFile->ordinal() < rightFile->ordinal();
 
-  DEBUG(llvm::dbgs() << "Sorting by ordinal\n");
-
   // Sort by atom order with .o file.
   uint64_t leftOrdinal = left->ordinal();
   uint64_t rightOrdinal = right->ordinal();
+
+  DEBUG(llvm::dbgs() << "Sorting by ordinal(" << left->ordinal() << ","
+                     << right->ordinal() << ")\n");
+
   if (leftOrdinal != rightOrdinal)
     return leftOrdinal < rightOrdinal;
 





More information about the llvm-commits mailing list