summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitstreamReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [BitstreamReader] Make sure the Array operand type is an encodingFilipe Cabecinhas2015-05-271-0/+3
| | | | | | Bug found with AFL fuzz. llvm-svn: 238269
* clang-format a couple of linesFilipe Cabecinhas2015-05-271-2/+2
| | | | llvm-svn: 238268
* [BitcodeReader] Make sure abbrev records have at least one operand (record code)Filipe Cabecinhas2015-05-261-0/+3
| | | | | | Bug found with AFL fuzz. llvm-svn: 238265
* Simplify boolean conditional return statements.Rafael Espindola2015-05-251-4/+1
| | | | | | Patch by Richard <legalize@xmission.com> llvm-svn: 238134
* [BitcodeReader] It's a malformed block if CodeLenWidth is too bigFilipe Cabecinhas2015-05-191-0/+4
| | | | | | Bug found with AFL fuzz. llvm-svn: 237646
* Turn an assert into report_fatal_error since it's reachable based on user inputFilipe Cabecinhas2015-04-291-1/+2
| | | | | | Bug found with AFL fuzz. llvm-svn: 236076
* Be more strict about the operand for the array type in BitcodeReaderFilipe Cabecinhas2015-04-231-0/+3
| | | | | | | | | | | | Summary: Bug found with AFL fuzz. Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9016 llvm-svn: 235596
* Verify sizes when trying to read a BitcodeAbbrevOpFilipe Cabecinhas2015-04-231-0/+9
| | | | | | | | | | | | | | | | Summary: Make sure the abbrev operands are valid and that we can read/skip them afterwards. Bug found with AFL fuzz. Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9030 llvm-svn: 235595
* Revert "Verify sizes when trying to read a VBR"Filipe Cabecinhas2015-04-151-2/+0
| | | | | | | This reverts r234984 since it seems to break some bots (most of them seemed arm*-selfhost). llvm-svn: 234998
* Verify sizes when trying to read a VBRFilipe Cabecinhas2015-04-151-0/+2
| | | | | | Also added an assert to ReadVBR64. llvm-svn: 234984
* Simplify expressions involving boolean constants with clang-tidyDavid Blaikie2015-03-091-1/+1
| | | | | | | | Patch by Richard (legalize at xmission dot com). Differential Revision: http://reviews.llvm.org/D8154 llvm-svn: 231617
* Clean up some inappropriate choices of type in the bitcode reader. None ofRichard Smith2015-02-131-1/+1
| | | | | | these are expected to fix any 64->32 bit real truncation issues. llvm-svn: 229153
* [Bitcode] Diagnose errors instead of asserting from bad inputFilipe Cabecinhas2015-01-241-1/+5
| | | | | | | | | | | | | | | Eventually we can make some of these pass the error along to the caller. Reports a fatal error if: We find an invalid abbrev record We try to get an invalid abbrev number We can't fill the current word due to an EOF Fixed an invalid bitcode test to check for output with FileCheck Bugs found with afl-fuzz llvm-svn: 226986
* Silence MSVC warning on missing return after fully covered switchReid Kleckner2014-11-131-0/+1
| | | | llvm-svn: 221943
* Move calls to push_back out of readAbbreviated(Literal|Field).Rafael Espindola2014-11-131-26/+13
| | | | | | | These functions always return a single value and not all callers want to push them into a SmallVector. llvm-svn: 221934
* Make a few helper functions static. NFC.Rafael Espindola2014-11-131-16/+18
| | | | llvm-svn: 221930
* Factor out call to push_back. NFC.Rafael Espindola2014-11-061-3/+5
| | | | llvm-svn: 221490
* Use IntrusiveRefCntPtr to manage the lifetime of BitCodeAbbrevs.Benjamin Kramer2014-09-151-36/+3
| | | | | | | | | This doesn't change the interface or gives additional safety but removes a ton of retain/release boilerplate. No functionality change. llvm-svn: 217778
* Replace some assert(0)'s with llvm_unreachable.Craig Topper2014-06-181-2/+2
| | | | llvm-svn: 211141
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-151-1/+1
| | | | | | instead of comparing to nullptr. llvm-svn: 206252
* Micro-optimization: don't shift an entire bitcode record over to get the code.Jordan Rose2013-05-101-3/+10
| | | | | | | | | | | Previously, BitstreamCursor read an abbreviated record by splatting the whole thing into a data vector, then extracting and removing the /first/ element. Now, it reads the first element--the record code--separately from the actual field values. No (intended) functionality change. llvm-svn: 181639
* Whitespace cleanupJoe Abbey2013-04-011-1/+1
| | | | llvm-svn: 178454
* Simplify code. No functionality change.Jakub Staszak2013-02-191-14/+7
| | | | llvm-svn: 175501
* Fix the underlying problem that was causing read(0) to be called: sometimes theChris Lattner2013-02-091-3/+14
| | | | | | | | | | | | | | | bitcode writer would generate abbrev records saying that the abbrev should be filled with fixed zero-bit bitfields (this happens in the .bc writer when the number of types used in a module is exactly one, since log2(1) == 0). In this case, just handle it as a literal zero. We can't "just fix" the writer without breaking compatibility with existing bc files, so have the abbrev reader do the substitution. Strengthen the assert in read to reject reads of zero bits so we catch such crimes in the future, and remove the special case designed to handle this. llvm-svn: 174801
* Code Custodian (trivial whitespace cleanup)Joe Abbey2013-02-061-39/+38
| | | | llvm-svn: 174550
* Fix a heinous inefficiency introduced in r149918, wherein reading each byte of aChris Lattner2013-01-211-9/+8
| | | | | | | | BLOB (i.e., large, performance intensive data) in a bitcode file was switched to invoking one virtual method call per byte read. Now we do one virtual call per BLOB. llvm-svn: 173065
* wean Blob handling logic off of banging on NextChar directly. Instead, makeChris Lattner2013-01-211-10/+13
| | | | | | | it reason about the current bit position, which is always independent of the underlying cursors word size. llvm-svn: 173063
* rename "SkipToWord" to "SkipToFourByteBoundary" since a word is not always 4 ↵Chris Lattner2013-01-211-3/+3
| | | | | | bytes. llvm-svn: 173062
* convert the bitstream reader itself and the IR .bc file parser to use the ↵Chris Lattner2013-01-201-10/+14
| | | | | | | | new advance() APIs, simplifying things and making a bunch of details more private to BitstreamCursor. llvm-svn: 172947
* stringref'ize readRecord and properly capitalize it. Add a compatibility ↵Chris Lattner2013-01-201-6/+7
| | | | | | | | method to easy the transition. llvm-svn: 172940
* move some private methods out of line, add a skipRecord() method.Chris Lattner2013-01-201-3/+111
| | | | llvm-svn: 172931
* Add a new BitstreamEntry concept, and add two helper methods for walkingChris Lattner2013-01-191-1/+1
| | | | | | | | through a BitstreamCursor that produce it: advance() and advanceSkippingSubblocks(), representing the two most common ways clients want to walk through bitcode. llvm-svn: 172919
* BitstreamReader hasn't aged well. It's been hacked on by various people andChris Lattner2013-01-191-0/+253
has past the point of making sense. Lets tidy things up: first step, moving a ton of big functions out of line. llvm-svn: 172904
OpenPOWER on IntegriCloud