aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/Reader.cpp
AgeCommit message (Collapse)Author
2005-05-05Add some extra checks. Opaque types don't have a null marker.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21700 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21Remove trailing whitespaceMisha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21417 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-05second argument to Value::setName is now gone.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20463 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-24use more specific cast.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20297 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13Make sure to clear the LazyFunctionLoadMap after we ParseAllFunctionBodies.Chris Lattner
Otherwise, clients who call ParseAllFunctionBodies will attempt to parse the function bodies twice, which is (uh) very very bad (tm). This fixes gccld on python. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20152 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31Fix the regressions my User changes introduced. Apparently some parts ofChris Lattner
LLVM make the very reasonable assumption that constant expressions will have at least one operand! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19943 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29Adjust to changes in User class and minor changes in instruction ctors.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19894 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-20Fix problems uncovered by VC++ (first time compiled by VC++)Jeff Cohen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19056 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09Remove a dead field, make the map go to integer type ID to hash better andChris Lattner
avoid a getType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18691 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09Remove #include inadvertently addedChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18686 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09Eliminate this ugly hack. This was put back in when replaceAllUsesOf usedChris Lattner
a different algorithm that was extremely inefficient for instructions with many operands. This reduces the time of this code snippet from .23s for 176.gcc to 0.03s in a debug build, which speeds up total llvm-dis time just barely. It's more of a code cleanup than a speedup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18685 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-04Provide more information in the error message that occurs when there areReid Spencer
unresolved constants remaining. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18502 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-04Do not allow bytecode files with unresolved references to be read. DoingChris Lattner
so lets wierd ConstantPlaceholder objects sneak into the system which confuses it greatly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18487 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30RevisionNum is read by error(), initialize it early.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18386 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19Add note that this is for old bytecode files.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17991 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15Use a per-function flag bit to indicate whether or not there is a functionChris Lattner
body for the function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17858 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15Make *SURE* to null out the pointer before throwing an exception, otherwiseChris Lattner
the dtor for the BytecodeReader class will try to free it again! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17856 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15Make functions default to having external linkage if they have noChris Lattner
FunctionBlock. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17853 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14Simplify decompression code by using the high level interface to the CompressorReid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17768 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14Mark an unmaterialized function as having GhostLinkageMisha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17748 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-07* Comments & cleanup per CL code review.Reid Spencer
* Accept 'llvc' as signature for compressed bytecode git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17579 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-06Add support for compressed bytecodeReid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17535 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16Do not erroneously accept revision 6 bytecode files when the format hasn'tChris Lattner
been defined yet! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17063 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16Add support for undef, unreachable, and function flagsChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17054 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-14Fit in 80 columnsChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16962 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-28Fix doxygen commentMisha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16542 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-27The system ranlib on darwin occasionally adds two extra newlines to theChris Lattner
end of files, breaking the CFE build. As a gross hack around this, ignore any trailing garbage on bytecode files. Thanks to Brian for digging in and identifying the problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16525 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-15Convert code to compile with vc7.1.Reid Spencer
Patch contributed by Paolo Invernizzi. Thanks Paolo! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16368 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-03Fixes to make LLVM compile with vc7.1.Alkis Evlogimenos
Patch contributed by Paolo Invernizzi! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16152 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01Changes For Bug 352Reid Spencer
Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21Get rid of an extraneous local variable.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15984 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21Bytecode Reader Cleanup:Reid Spencer
- provide the correct conversion for ModuleBlockID in read_block (a potential bug but not actually exploited because reading module block ids doesn't use read_block). - install support for handleTypeList handler - install support for handleDependentLibrary handler - install support for handleTargetTriple handler - clean up comments, output strings, - ensure that processing function arguments doesn't SIGSEGV if one of the arguments is a null pointer (yeah, it happened .. weird) - prepare for version 5 bytecode by documenting what will change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15981 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20Packed types, brought to you by Brad JonesBrian Gaeke
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17Bytecode File Format Changes:Reid Spencer
- File format version number bumped to 4 - Writer will now align nothing - Reader now only expects alignment for version 3 or earlier git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15875 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04Turn a use of intptr_t into a reinterpret_cast<uint64_t> instead to getReid Spencer
rid of compilation warnings on some platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15512 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04Make getGlobalTableValue not use getTypeSlot, this speeds up the bc readerChris Lattner
by 5% on eon git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15452 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-03Do not do a linear std::find to reconstruct information we had, but later threwChris Lattner
away. This speeds up by .bc reader by 30% in a profile build on 252.eon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15450 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27Simplify code and silence warningChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15255 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25Fix a serious bug in the double constant reader. In particular, becauseChris Lattner
(At[3] << 24) is an int type and it is being coerced to uint64_t, it was getting sign extended, causing us to get FFFFFFFFxxxxxxxx constants all of the time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15224 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25Always write FP values correctly.Reid Spencer
Adjust for new Module.h interface for dependent libraries. Excise unused backwards compatibility flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15220 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25bug 263:Reid Spencer
- encode/decode target triple and dependent libraries bug 401: - fix encoding/decoding of FP values to be little-endian only bug 402: - initial (compatible) cut at 24-bit types instead of 32-bit - reduce size of block headers by 50% Other: - cleanup Writer by consolidating to one compilation unit, rem. other files - use a std::vector instead of std::deque so the buffer can be allocated in multiples of 64KByte chunks rather than in multiples of some smaller (default) number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15210 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18bug 122:Reid Spencer
- Replace ConstantPointerRef usage with GlobalValue usage - Correct isa<Constant> for GlobalValue subclass git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14939 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14Actually set the endian/pointersize flags on the module being read in!Brian Gaeke
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14826 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13Fix warning on SparcV9, where sizeof (int) != sizeof (void *).Brian Gaeke
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14786 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11Various cleanups:Reid Spencer
- Remove tabs - Standardize use of space around ( and ). - Consolidate the ConstantPlaceHolder class - Rename two methods to be more meaningful (ParseType, ParseTypes) - Correct indentation of blocks - Add documentation - Convert input dependent asserts to error(...) so it throws instead. Provide placeholder implementations of read_float and read_double that still read in platform-specific endianess. When I figure out how to do this without knowing the endianess of the platform, it will get implemented correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14765 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09Error Handling Cleanup:Reid Spencer
- get rid of PARSE_ERROR macro - add error(std::string) function - use error(std::string) for all errors - make input dependent asserts call error(std::string) instead - ensure asserts are only for logic bugs, not input discrepancies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14729 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09Fix a backwards compatibility bug found by Tanya. In version 1.2, theReid Spencer
global type plane starts with a length and the TypeTyID value to identify the type plane has having type definitions. This doesn't happen in 1.3 because the types are read from a known position in the file. However, the TypeTyID must be read in (and ignored) if its a 1.2 bytecode file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14728 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-05Finalize bytecode dumping. The "handleFinish" method was getting calledReid Spencer
too soon so the function data was not getting dumped (it was generated after the call handleFinish). Also cleaned up the output format for proper indentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14627 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04- Don't use macros to call the BytecodeHandlerReid Spencer
- Don't use PARSE_ERROR macro unnecessarily (for simple strings) - Add comments before each function - Convert for bug 122 (Type != Value) - Handle new value range on Type::PrimitiveTypeId enumeration by augmenting the reader with a new read_typeid method and sanitizeTypeId method. - Remove BytecodeHandler's default method implementations to header file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14604 91177308-0d34-0410-b5e6-96231b3b80d8