trivial micro-optimization: lazily call the virtual method instead of eagerly calling it.
authorChris Lattner <sabre@nondot.org>
Sun, 20 Jan 2013 02:54:05 +0000 (02:54 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 20 Jan 2013 02:54:05 +0000 (02:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172953 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Bitcode/BitstreamReader.h
lib/Bitcode/Reader/BitcodeReader.cpp

index 0d9bd3e4665d268e886aba875fd3fc0606053b61..847aaade76dab57634fb7e669e749fc5f465f125 100644 (file)
@@ -158,7 +158,6 @@ struct BitstreamEntry {
     BitstreamEntry E; E.Kind = Record; E.ID = AbbrevID; return E;
   }
 };
-  
 
 /// BitstreamCursor - This represents a position within a bitcode file.  There
 /// may be multiple independent cursors reading within one bitstream, each
@@ -251,7 +250,7 @@ public:
   }
 
   bool AtEndOfStream() {
-    return isEndPos(NextChar) && BitsInCurWord == 0;
+    return BitsInCurWord == 0 && isEndPos(NextChar);
   }
 
   /// getAbbrevIDWidth - Return the number of bits used to encode an abbrev #.
index 219fc1877df52fa8d0830b081be2cc7de1d22db1..00474ec6dad605f63276a8b99a488b115de0220e 100644 (file)
@@ -796,7 +796,7 @@ bool BitcodeReader::ParseMetadata() {
     default:  // Default behavior: ignore.
       break;
     case bitc::METADATA_NAME: {
-      // Read named of the named metadata.
+      // Read name of the named metadata.
       SmallString<8> Name(Record.begin(), Record.end());
       Record.clear();
       Code = Stream.ReadCode();