aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bytecode/Reader
Commit message (Collapse)AuthorAgeFilesLines
...
* Added LLVM copyright header.John Criswell2003-10-211-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM copyright notice to Makefiles.John Criswell2003-10-201-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-205-0/+35
| | | | | | | Header files will be on the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the Opcode enum for PHI nodes from "Instruction::PHINode" to ↵Chris Lattner2003-10-191-1/+1
| | | | | | "Instruction::PHI" to be more consistent with the other instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warningChris Lattner2003-10-181-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9236 91177308-0d34-0410-b5e6-96231b3b80d8
* add support for new linkage typesChris Lattner2003-10-181-4/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9228 91177308-0d34-0410-b5e6-96231b3b80d8
* * New revised variable argument handling supportChris Lattner2003-10-185-149/+290
| | | | | | | | * More dense bytecode encoding for varargs calls (like printf) * Eliminated the extremely old bytecode format. rev #0 is now 1.0 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9220 91177308-0d34-0410-b5e6-96231b3b80d8
* Add separator between different types of readers.Misha Brukman2003-10-161-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9183 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for 'weak' linkage.Chris Lattner2003-10-161-2/+12
| | | | | | | | | For now, we translate linkonce into weak linkage in the bytecode format because we don't have enough bits to represent it. We will rev the bytecode version soon anyways, so this will be fixed in the near future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9170 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanupsChris Lattner2003-10-131-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9079 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid calling getTypeSlot moreChris Lattner2003-10-133-4/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9077 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a header file, thus it needs a -*-C++-*-Chris Lattner2003-10-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9072 91177308-0d34-0410-b5e6-96231b3b80d8
* Regularize header file commentsChris Lattner2003-10-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
* Ok, the "fix" for this is to do a real associative container. Symbol tablesChris Lattner2003-10-101-15/+11
| | | | | | | | are ordered by name, not by slot, so the previous solution wasn't any good. On a large testcase, this reduces time to parse from 2.17s to 1.58s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9002 91177308-0d34-0410-b5e6-96231b3b80d8
* Another 10% performance improvement by not using replaceAllUsesWithChris Lattner2003-10-091-13/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8994 91177308-0d34-0410-b5e6-96231b3b80d8
* Reserve space for PHI nodes when we read them in. This provides a VERYChris Lattner2003-10-091-0/+1
| | | | | | | tasty 15% speedup on the testcase from Bill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8993 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the version of getValue that takes the type plane instead of the typeChris Lattner2003-10-092-17/+18
| | | | | | | if possible. This provides a consistent 8.5% speedup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8991 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass a vector around to reduce dynamic allocationChris Lattner2003-10-093-13/+17
| | | | | | | Throw the RawInst class in an anon namespace git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8990 91177308-0d34-0410-b5e6-96231b3b80d8
* Change getConstantValue to throw an exception on error, not return nullChris Lattner2003-10-092-10/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8988 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove potentially N^2 algorithm from symbol table reader. No speedupChris Lattner2003-10-091-5/+13
| | | | | | | in practice though git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8985 91177308-0d34-0410-b5e6-96231b3b80d8
* Major refactoring of the bytecode reader. This includes the followingChris Lattner2003-10-094-315/+171
| | | | | | | | | | | | | | | | changes: * BytecodeReader::getType(...) used to return a null pointer on error. This was only checked about half the time. Now we convert it to throw an exception, and delete the half that checked for error. This was checked in before, but psmith crashed and lost the change :( * insertValue no longer returns -1 on error, so callers don't need to check for it. * Substantial rewrite of InstructionReader.cpp, to use more efficient, simpler, data structures. This provides another 5% speedup. This also makes the code much easier to read and understand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8984 91177308-0d34-0410-b5e6-96231b3b80d8
* Significantly clean up parsing of instructions. This exceptionizes andChris Lattner2003-10-093-144/+106
| | | | | | | | simplifies the control flow a bit. This provides a small (~3%) speedup, but it's primarily a cleanup exercise. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8983 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the instruction placeholder. Simplify a bunch of code.Chris Lattner2003-10-092-15/+1
| | | | | | | This results in no significant speedup, but does provide simpler code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8980 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the old LateResolveValues data structure, replacing it with aChris Lattner2003-10-092-25/+27
| | | | | | | | | | | | | | new, simpler, ForwardReferences data structure. This is just the first simple replacement, subsequent changes will improve the code more. This simple change improves the performance of loading a file from HDF5 (contributed by Bill) from 2.36s to 1.93s, a 22% improvement. This presumably has to do with the fact that we only create ONE placeholder for a particular forward referenced values, and also may be because the data structure is much simpler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8979 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a dead methodChris Lattner2003-10-092-12/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8978 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch substantially simplifies and cleans up handling of basic blocksChris Lattner2003-10-083-60/+84
| | | | | | | | | | | | | | in the bytecode parser. Before we tried to shoehorn basic blocks into the "getValue" code path with other types of values. For a variety of reasons this was a bad idea, so this patch separates it out into its own data structure. This simplifies the code, makes it fit in 80 columns, and is also much faster. In a testcase provided by Bill, which has lots of PHI nodes, this patch speeds up bytecode parsing from taking 6.9s to taking 2.32s. More speedups to follow later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8977 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline the postResolveValues method. It was poorly named anywayChris Lattner2003-10-082-34/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8976 91177308-0d34-0410-b5e6-96231b3b80d8
* Various cleanups and simplifications. This speeds up reading a bytecode fileChris Lattner2003-10-083-61/+57
| | | | | | | Bill gave me from 8.69s to 6.90s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8971 91177308-0d34-0410-b5e6-96231b3b80d8
* Destroy allocated resources on exception.Misha Brukman2003-10-081-3/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8969 91177308-0d34-0410-b5e6-96231b3b80d8
* All of our supported operating systems (so far) and FreeBSD technicallyBrian Gaeke2003-10-061-0/+1
| | | | | | | want you to include <sys/stat.h> for fstat(), struct stat, and friends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8887 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename AbstractModuleProvider -> ModuleProvider, to match the header file name,Chris Lattner2003-10-042-7/+5
| | | | | | | | and because, while the class used by the interface is abstract, the actual concept is not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8850 91177308-0d34-0410-b5e6-96231b3b80d8
* Transform two methods to return pointers directly instead of returning themChris Lattner2003-10-043-66/+42
| | | | | | | as 'by reference' arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8849 91177308-0d34-0410-b5e6-96231b3b80d8
* Use V for values, not D.Chris Lattner2003-10-041-16/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8848 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not leak the ModuleProvider if releaseModule() throws.Chris Lattner2003-10-041-11/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8847 91177308-0d34-0410-b5e6-96231b3b80d8
* There is no need for BytecodeParser to be an AbstractTypeUser. Instead, itChris Lattner2003-10-022-28/+3
| | | | | | | can just use PATypeHolders git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8832 91177308-0d34-0410-b5e6-96231b3b80d8
* Just rethrow previous exception instead of making a new oneChris Lattner2003-09-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8718 91177308-0d34-0410-b5e6-96231b3b80d8
* Define the instance variable Buffer, not the automatic variable Buffer.Chris Lattner2003-09-251-3/+2
| | | | | | | This was causing us to munmap random stuff, which is obviously bad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8709 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix alignment problemChris Lattner2003-09-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8707 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually assign the string correctly through the std::string pointer.Misha Brukman2003-09-241-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8704 91177308-0d34-0410-b5e6-96231b3b80d8
* * Eliminate BytecodeBufferReader::Length member variableMisha Brukman2003-09-241-26/+7
| | | | | | | | * Kill unused ALIN_PTRS #define * Set the error string if user passed it in to be compatible with former API git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8701 91177308-0d34-0410-b5e6-96231b3b80d8
* Added code that ensures that we pass the beginning of the data buffer toJohn Criswell2003-09-231-1/+1
| | | | | | | the parsing routines regardless of whether the buffer is re-aligned or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8693 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop returning bool and pass Instruction by reference;Misha Brukman2003-09-232-135/+146
| | | | | | | return std::auto_ptr and use exceptions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8684 91177308-0d34-0410-b5e6-96231b3b80d8
* Suggestions made by Chris:Misha Brukman2003-09-231-10/+14
| | | | | | | | | | * Instead of a #define, use inline function * Fix the name on the #define, errr... now inline function to be more logical: it doesn't CHECK the alignment, it PERFORMS the alignment * To get string name of a Type*, use getDescription(), not getName() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8683 91177308-0d34-0410-b5e6-96231b3b80d8
* * Group class definitions & implementations togetherMisha Brukman2003-09-231-58/+110
| | | | | | | | | * Make sure we align the buffer we're given * Do not let exceptions propagate when the caller asks for a Module* * Add doxygenified comments to wrapper functions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8682 91177308-0d34-0410-b5e6-96231b3b80d8
* * Constantify arguments to copy functionMisha Brukman2003-09-231-8/+4
| | | | | | | * Stop using a #define, make it an inline if statement git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8678 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed no longer used member variable.Misha Brukman2003-09-221-4/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8677 91177308-0d34-0410-b5e6-96231b3b80d8
* Added file header comment.Misha Brukman2003-09-221-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8675 91177308-0d34-0410-b5e6-96231b3b80d8
* Update file header for renamed fileChris Lattner2003-09-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8673 91177308-0d34-0410-b5e6-96231b3b80d8
* * Cleaned up code:Misha Brukman2003-09-224-340/+443
| | | | | | | | | | - no more passing around a string pointer to set errors - no more returning booleans and checking for errors, we use C++ exceptions * Broke functionality into 2 new classes, one reads from file, one from a stream * Implemented lazy function streaming - the parser can read in a function at-a-time git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8671 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed spelling and grammar.Misha Brukman2003-09-114-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8489 91177308-0d34-0410-b5e6-96231b3b80d8