summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
AgeCommit message (Collapse)Author
2007-12-17Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb
of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. llvm-svn: 45082
2007-12-11Implement address space attribute for LLVM pointer types. Address spaces are Christopher Lamb
regions of memory that have a target specific relationship, as described in the Embedded C Technical Report. This also implements the 2007-12-11-AddressSpaces test, which demonstrates how address space attributes can be used in LLVM IR. In addition, this patch changes the bitcode signature for stores (in a backwards compatible manner), such that the pointer type, rather than the pointee type, is encoded. This permits type information in the pointer (e.g. address space) to be preserved for stores. LangRef updates are forthcoming. llvm-svn: 44858
2007-12-10Adding a collector name attribute to Function in the IR. These Gordon Henriksen
methods are new to Function: bool hasCollector() const; const std::string &getCollector() const; void setCollector(const std::string &); void clearCollector(); The assembly representation is as such: define void @f() gc "shadow-stack" { ... The implementation uses an on-the-side table to map Functions to collector names, such that there is no overhead. A StringPool is further used to unique collector names, which are extremely likely to be unique per process. llvm-svn: 44769
2007-11-27Unbreak backwards compatibility with bytecode format. RegressionChris Lattner
introduced by this patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071126/055824.html llvm-svn: 44364
2007-11-27Fix PR1146: parameter attributes are longer part ofDuncan Sands
the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. llvm-svn: 44359
2007-11-20In order for parameter attribute uniquing to makeDuncan Sands
any sense it is important that ParamAttr::None gets treated the same as not supplying an attribute at all. Rather than stripping ParamAttr::None out of the list of attributes, assert if ParamAttr::None is seen. Fix up the bitcode reader which liked to insert ParamAttr::None all over the place. Patch based on one by Török Edwin. llvm-svn: 44250
2007-11-19Add explicit keywords.Dan Gohman
llvm-svn: 44234
2007-11-05Make labels work in asm blocks; allow labels asDale Johannesen
parameters. Rename ValueRefList to ParamList in AsmParser, since its only use is for parameters. llvm-svn: 43734
2007-10-11Next PPC long double bits. First cut at constants.Dale Johannesen
No compile-time support for constant operations yet, just format transformations. Make readers and writers work. Split constants into 2 doubles in Legalize. llvm-svn: 42865
2007-09-12Revise previous patch per review comments.Dale Johannesen
Next round of x87 long double stuff. Getting close now, basically works. llvm-svn: 41875
2007-09-11Add APInt interfaces to APFloat (allows directlyDale Johannesen
access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). llvm-svn: 41858
2007-09-07Revert previous change to IR.Dale Johannesen
llvm-svn: 41769
2007-09-06Next round of APFloat changes.Dale Johannesen
Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
2007-09-04Update GEP constructors to use an iterator interface to fixDavid Greene
GLIBCXX_DEBUG issues. llvm-svn: 41697
2007-08-27Update InvokeInst to work like CallInstDavid Greene
llvm-svn: 41506
2007-08-09Patch 10 for long double. Doing constants right needs expanding ConstantFPDale Johannesen
to handle values bigger than double. If we assume host==target and host long double works correctly, this is not too bad, but we don't want to have that limitation longterm. I could implement accepting double constants as long double or something like that, which would lead to incorrect codegen with no errors; the more I think about that the worse it seems. Rather than do such a hack that would be backed out later, I'm settling for giving reasonable error messages, for now. llvm-svn: 40974
2007-08-04This is the patch to provide clean intrinsic function overloading support in ↵Chandler Carruth
LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported. llvm-svn: 40807
2007-08-03Long double, part 1 of N. Support in IR.Dale Johannesen
llvm-svn: 40774
2007-08-01New CallInst interface to address GLIBCXX_DEBUG errors caused byDavid Greene
indexing an empty std::vector. Updates to all clients. llvm-svn: 40660
2007-07-05Here is the bulk of the sanitizing.Gabor Greif
Almost all occurrences of "bytecode" in the sources have been eliminated. llvm-svn: 37913
2007-05-18Fix PR1434 and test/Linker/link-archive.ll, this is a regression from 1.9.Chris Lattner
llvm-svn: 37204
2007-05-15implement the ModuleProvider::dematerializeFunction hookChris Lattner
llvm-svn: 37080
2007-05-08Make a preemptive bitcode format change to support PR1146. This lets us doChris Lattner
pr1146 in llvm 2.1 without ugly code to emulate old behavior. This should be merged into the 2.0 release branch. llvm-svn: 36928
2007-05-06fix off-by-one that caused the llvm2cpp test to failChris Lattner
llvm-svn: 36880
2007-05-06Allow structs with zero fields.Chris Lattner
llvm-svn: 36862
2007-05-06add a missing checkChris Lattner
llvm-svn: 36859
2007-05-06implement reading/writing of inlineasm objectsChris Lattner
llvm-svn: 36827
2007-05-06add a denser encoding for null terminated strings, add a 6-bit abbrev asChris Lattner
well. This shrinks kc++ from 2724088 to 2717360 bytes. llvm-svn: 36821
2007-05-06implement the 'string constant' optimization. This shrinks kc.bit fromChris Lattner
2878544 to 2815788 llvm-svn: 36818
2007-05-06further reduce the redundancy of types in the instruction encoding. ThisChris Lattner
shrinks function bodies in kc++ from 891913B to 884073B llvm-svn: 36817
2007-05-06stop encoding type/value pairs when the type is implied by the value.Chris Lattner
This shrinks the function block of kc++ from 1055K to 906K llvm-svn: 36816
2007-05-05add support for BLOCKINFO records at the module level. This fixes the readerChris Lattner
issues reid noticed last night. llvm-svn: 36785
2007-05-05Implement support for globally associating abbrevs with block IDs, whichChris Lattner
relieves us from having to emit the abbrevs into each instance of the block. This shrinks kc.bit from 3368K to 3333K, but will be a more significant win once instructions are abbreviated. The VST went from: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.29508e+07b/1.61885e+06B/404713W Average Size: 5522.73b/690.342B/172.585W % of file: 48.0645 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 7035/3 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 to: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.26713e+07b/1.58391e+06B/395978W Average Size: 5403.53b/675.442B/168.86W % of file: 47.5198 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 because we didn't emit the same 3 abbrevs 2345 times :) llvm-svn: 36767
2007-05-04eliminate internal length fields from record. Records already know theirChris Lattner
total length llvm-svn: 36752
2007-05-04storeinst ctor takes isvolatile before alignment. With this, 176.gcc roundtripsChris Lattner
llvm-svn: 36738
2007-05-04fix a misplaced errorChris Lattner
llvm-svn: 36736
2007-05-04encode and read param attrs along with function type. WE can now roundtrip ↵Chris Lattner
Olden/voronoi loslessly llvm-svn: 36735
2007-05-04add support for reading the param attrs blockChris Lattner
llvm-svn: 36731
2007-05-04remove dead codeChris Lattner
llvm-svn: 36728
2007-05-04Allow this to compile with gcc 4.0.XReid Spencer
llvm-svn: 36723
2007-05-03Encoding calling conv info in call/invoke instrs, tree add now round trips ↵Chris Lattner
completely llvm-svn: 36707
2007-05-03the type field for a store is the type of the pointer, not the value.Chris Lattner
With this fix I can round trip treeaadd, only losing calling conv info. llvm-svn: 36706
2007-05-03fix encoding of BB names in the symtabChris Lattner
llvm-svn: 36704
2007-05-03bug fixesChris Lattner
llvm-svn: 36701
2007-05-03implement the rest of the instructionsChris Lattner
llvm-svn: 36699
2007-05-03add a few more instructions, getting closeChris Lattner
llvm-svn: 36688
2007-05-02add reader logic for terminator instrs.Chris Lattner
llvm-svn: 36642
2007-05-02add reader support for a bunch of new instructionsChris Lattner
llvm-svn: 36641
2007-05-02read a few instructions, fix some bugs. This is enough to be able to roundChris Lattner
trip function bodies like this: define <2 x i64> @foo(<2 x i64> %x, <2 x i64> %y) { %tmp4 = bitcast <2 x i64> %y to <8 x i16> ; <<8 x i16>> [#uses=1] %tmp5 = bitcast <2 x i64> %x to <8 x i16> ; <<8 x i16>> [#uses=1] %tmp = add <8 x i16> %tmp5, %tmp4 ; <<8 x i16>> [#uses=1] %tmp6 = bitcast <8 x i16> %tmp to <2 x i64> ; <<2 x i64>> [#uses=1] ret <2 x i64> %tmp6 } llvm-svn: 36640
2007-05-01handle function-level forward references, read binops.Chris Lattner
llvm-svn: 36620