[llvm-commits] [llvm] r172953 - in /llvm/trunk: include/llvm/Bitcode/BitstreamReader.h lib/Bitcode/Reader/BitcodeReader.cpp
Chris Lattner
sabre at nondot.org
Sat Jan 19 18:54:05 PST 2013
Author: lattner
Date: Sat Jan 19 20:54:05 2013
New Revision: 172953
URL: http://llvm.org/viewvc/llvm-project?rev=172953&view=rev
Log:
trivial micro-optimization: lazily call the virtual method instead of eagerly calling it.
Modified:
llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
Modified: llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitstreamReader.h?rev=172953&r1=172952&r2=172953&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/BitstreamReader.h (original)
+++ llvm/trunk/include/llvm/Bitcode/BitstreamReader.h Sat Jan 19 20:54:05 2013
@@ -158,7 +158,6 @@
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 @@
}
bool AtEndOfStream() {
- return isEndPos(NextChar) && BitsInCurWord == 0;
+ return BitsInCurWord == 0 && isEndPos(NextChar);
}
/// getAbbrevIDWidth - Return the number of bits used to encode an abbrev #.
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=172953&r1=172952&r2=172953&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Sat Jan 19 20:54:05 2013
@@ -796,7 +796,7 @@
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();
More information about the llvm-commits
mailing list