diff options
author | Chris Lattner <sabre@nondot.org> | 2013-01-20 02:12:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2013-01-20 02:12:39 +0000 |
commit | 099b636562a83dc9acc6bf36ca32d710ac6d62c9 (patch) | |
tree | 8fc49648e62926cf8df4be670b7ce0c484a045de /include/llvm/Bitcode | |
parent | 14268416720155d63f190a6143ee40b3b850e409 (diff) | |
download | external_llvm-099b636562a83dc9acc6bf36ca32d710ac6d62c9.zip external_llvm-099b636562a83dc9acc6bf36ca32d710ac6d62c9.tar.gz external_llvm-099b636562a83dc9acc6bf36ca32d710ac6d62c9.tar.bz2 |
add an option to not auto-process abbreviations in advance()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Bitcode')
-rw-r--r-- | include/llvm/Bitcode/BitstreamReader.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index 3e8d880..3e299e9 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -159,7 +159,6 @@ struct BitstreamEntry { } }; - /// 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 @@ public: /// 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 @@ public: 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 @@ private: BlockScope.pop_back(); } - //===--------------------------------------------------------------------===// + //===--------------------------------------------------------------------===// // Record Processing //===--------------------------------------------------------------------===// |