do not charge subblock sizes to the parent block.
authorChris Lattner <sabre@nondot.org>
Sat, 5 May 2007 01:29:31 +0000 (01:29 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 5 May 2007 01:29:31 +0000 (01:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36772 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp

index 4390f4d75ea48ae685a4c380691eb7839fcbe5a2..971ef5cd4e6f4c6753af8c40a06ba9f7aaacf5d1 100644 (file)
@@ -312,11 +312,17 @@ static bool ParseBlock(BitstreamReader &Stream, unsigned IndentLevel) {
       }
       return false;
     } 
-    case bitc::ENTER_SUBBLOCK:
+    case bitc::ENTER_SUBBLOCK: {
+      uint64_t SubBlockBitStart = Stream.GetCurrentBitNo();
       if (ParseBlock(Stream, IndentLevel+1))
         return true;
       ++BlockStats.NumSubBlocks;
+      uint64_t SubBlockBitEnd = Stream.GetCurrentBitNo();
+      
+      // Don't include subblock sizes in the size of this block.
+      BlockBitStart += SubBlockBitEnd-SubBlockBitStart;
       break;
+    }
     case bitc::DEFINE_ABBREV:
       Stream.ReadAbbrevRecord();
       ++BlockStats.NumAbbrevs;