[llvm-commits] [llvm] r172946 - /llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
Chris Lattner
sabre at nondot.org
Sat Jan 19 18:12:39 PST 2013
Author: lattner
Date: Sat Jan 19 20:12:39 2013
New Revision: 172946
URL: http://llvm.org/viewvc/llvm-project?rev=172946&view=rev
Log:
add an option to not auto-process abbreviations in advance()
Modified:
llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
Modified: llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitstreamReader.h?rev=172946&r1=172945&r2=172946&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/BitstreamReader.h (original)
+++ llvm/trunk/include/llvm/Bitcode/BitstreamReader.h Sat Jan 19 20:12:39 2013
@@ -159,7 +159,6 @@
}
};
-
/// BitstreamCursor - This represents a position within a bitcode file. There
/// may be multiple independent cursors reading within one bitstream, each
/// maintaining their own local state.
@@ -271,7 +270,14 @@
/// Flags that modify the behavior of advance().
enum {
- AF_DontPopBlockAtEnd = 1
+ /// AF_DontPopBlockAtEnd - If this flag is used, the advance() method does
+ /// not automatically pop the block scope when the end of a block is
+ /// reached.
+ AF_DontPopBlockAtEnd = 1,
+
+ /// AF_DontAutoprocessAbbrevs - If this flag is used, abbrev entries are
+ /// returned just like normal records.
+ AF_DontAutoprocessAbbrevs = 2
};
/// advance - Advance the current bitstream, returning the next entry in the
@@ -289,7 +295,8 @@
if (Code == bitc::ENTER_SUBBLOCK)
return BitstreamEntry::getSubBlock(ReadSubBlockID());
- if (Code == bitc::DEFINE_ABBREV) {
+ if (Code == bitc::DEFINE_ABBREV &&
+ !(Flags & AF_DontAutoprocessAbbrevs)) {
// We read and accumulate abbrev's, the client can't do anything with
// them anyway.
ReadAbbrevRecord();
@@ -483,7 +490,7 @@
BlockScope.pop_back();
}
- //===--------------------------------------------------------------------===//
+ //===--------------------------------------------------------------------===//
// Record Processing
//===--------------------------------------------------------------------===//
More information about the llvm-commits
mailing list