summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2013-01-20 02:54:05 +0000
committerChris Lattner <sabre@nondot.org>2013-01-20 02:54:05 +0000
commit8d14053545837ab221c84f3614e65661002a3bda (patch)
tree55908f772ac50f032f48683efd751f217f63aa3a /llvm
parent0271af8dc91d0564135a75ae06eb9e153aab5517 (diff)
downloadbcm5719-llvm-8d14053545837ab221c84f3614e65661002a3bda.tar.gz
bcm5719-llvm-8d14053545837ab221c84f3614e65661002a3bda.zip
trivial micro-optimization: lazily call the virtual method instead of eagerly calling it.
llvm-svn: 172953
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Bitcode/BitstreamReader.h3
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp2
2 files changed, 2 insertions, 3 deletions
diff --git a/llvm/include/llvm/Bitcode/BitstreamReader.h b/llvm/include/llvm/Bitcode/BitstreamReader.h
index 0d9bd3e4665..847aaade76d 100644
--- a/llvm/include/llvm/Bitcode/BitstreamReader.h
+++ b/llvm/include/llvm/Bitcode/BitstreamReader.h
@@ -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 #.
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 219fc1877df..00474ec6dad 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -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();
OpenPOWER on IntegriCloud