summaryrefslogtreecommitdiff
path: root/lib/Bitcode
Commit message (Collapse)AuthorAge
* Merging r168354: into 3.2 release branchPawel Wodnicki2012-11-22
| | | | | | | | | | | Make the AttrListPtr object a part of the LLVMContext. When code deletes the context, the AttributeImpls that the AttrListPtr points to are now invalid. Therefore, instead of keeping a separate managed static for the AttrListPtrs that's reference counted, move it into the LLVMContext and delete it when deleting the AttributeImpls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168486 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting 168457Pawel Wodnicki2012-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168465 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r168354, r168355 and r168379 into the 3.2 release branch.Pawel Wodnicki2012-11-21
| | | | | | | | | | | | | | | | | | | Set of Attributes patches. Merging r168354: Make the AttrListPtr object a part of the LLVMContext. When code deletes the context, the AttributeImpls that the AttrListPtr points to are now invalid. Therefore, instead of keeping a separate managed static for the AttrListPtrs that's reference counted, move it into the LLVMContext and delete it when deleting the AttributeImpls. Merging r168355: Merging r168379 git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168457 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling2012-10-15
| | | | | | own class named AttrBuilder. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165960 91177308-0d34-0410-b5e6-96231b3b80d8
* Attributes RewriteBill Wendling2012-10-15
| | | | | | | | | | | Convert the internal representation of the Attributes class into a pointer to an opaque object that's uniqued by and stored in the LLVMContext object. The Attributes class then becomes a thin wrapper around this opaque object. Eventually, the internal representation will be expanded to include attributes that represent code generation options, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165917 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary classof()'sSean Silva2012-10-11
| | | | | | | isa<> et al. automatically infer when the cast is an upcast (including a self-cast), so these are no longer necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165767 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some typos 165739, spotted by Duncan.Jan Wen Voung2012-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165753 91177308-0d34-0410-b5e6-96231b3b80d8
* Change encoding of instruction operands in bitcode binaries to be relativeJan Wen Voung2012-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | to the instruction position. The old encoding would give an absolute ID which counts up within a function, and only resets at the next function. I.e., Instead of having: ... = icmp eq i32 n-1, n-2 br i1 ..., label %bb1, label %bb2 it will now be roughly: ... = icmp eq i32 1, 2 br i1 1, label %bb1, label %bb2 This makes it so that ids remain relatively small and can be encoded in fewer bits. With this encoding, forward reference operands will be given negative-valued IDs. Use signed VBRs for the most common case of forward references, which is phi instructions. To retain backward compatibility we bump the bitcode version from 0 to 1 to distinguish between the different encodings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165739 91177308-0d34-0410-b5e6-96231b3b80d8
* Use method to query if there are attributes.Bill Wendling2012-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165213 91177308-0d34-0410-b5e6-96231b3b80d8
* Move remaining methods inside the Attributes class. Merge the 'Attribute' ↵Bill Wendling2012-09-25
| | | | | | namespaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164631 91177308-0d34-0410-b5e6-96231b3b80d8
* BitcodeReader: Correctly insert blockaddress constant referring to a already ↵Benjamin Kramer2012-09-21
| | | | | | | | | | | | parsed function. We inserted a placeholder that was never replaced because the function was already visited. Assert that all placeholders have been resolved when tearing down the bitcode reader. Fixes PR13895. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164369 91177308-0d34-0410-b5e6-96231b3b80d8
* Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Craig Topper2012-09-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163974 91177308-0d34-0410-b5e6-96231b3b80d8
* Dont cast away const needlessly. Found by gcc48 -Wcast-qual.Roman Divacky2012-09-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163324 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Enumerate the InlineAsm dialects and rename the nsdialect toChad Rosier2012-09-05
| | | | | | | inteldialect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163231 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a FIXME that assumes we maintain backward compatibility until the next ↵Chad Rosier2012-09-05
| | | | | | major release. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163195 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add support for the nsdialect keyword in the BitcodeChad Rosier2012-09-05
| | | | | | Reader/Writer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163185 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the `linker_private_weak_def_auto' linkage to `linkonce_odr_auto_hide' toBill Wendling2012-08-17
| | | | | | | | | | | | | | | | | | | | | make it more consistent with its intended semantics. The `linker_private_weak_def_auto' linkage type was meant to automatically hide globals which never had their addresses taken. It has nothing to do with the `linker_private' linkage type, which outputs the symbols with a `l' (ell) prefix among other things. The intended semantic is more like the `linkonce_odr' linkage type. Change the name of the linkage type to `linkonce_odr_auto_hide'. And therefore changing the semantics so that it produces the correct output for the linker. Note: The old linkage name `linker_private_weak_def_auto' will still parse but is not a synonym for `linkonce_odr_auto_hide'. This should be removed in 4.0. <rdar://problem/11754934> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162114 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tabs.Bill Wendling2012-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160479 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/lib: [CMake] Add explicit dependency to intrinsics_gen.NAKAMURA Takumi2012-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159112 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the IL for selecting TLS models (PR9788)Hans Wennborg2012-06-23
| | | | | | | | | | | | | | | This allows the user/front-end to specify a model that is better than what LLVM would choose by default. For example, a variable might be declared as @x = thread_local(initialexec) global i32 42 if it will not be used in a shared library that is dlopen'ed. If the specified model isn't supported by the target, or if LLVM can make a better choice, a different model may be used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159077 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimized usage of new SwitchInst case values (IntegersSubset type) in ↵Stepan Dyatkovskiy2012-06-23
| | | | | | | | | | Local.cpp, Execution.cpp and BitcodeWriter.cpp. I got about 1% of compile-time improvement on my machines (Ubuntu 11.10 i386 and Ubuntu 12.04 x64). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159076 91177308-0d34-0410-b5e6-96231b3b80d8
* PR1255: case ranges.Stepan Dyatkovskiy2012-06-02
| | | | | | | | IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157884 91177308-0d34-0410-b5e6-96231b3b80d8
* ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to ↵Stepan Dyatkovskiy2012-05-29
| | | | | | IntegersSubsetMapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused variable.David Blaikie2012-05-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157586 91177308-0d34-0410-b5e6-96231b3b80d8
* PR12696: Attribute bits above 1<<30 are not encoded in bitcodeMeador Inge2012-05-28
| | | | | | | | | | Attribute bits above 1<<30 are now encoded correctly. Additionally, the encoding/decoding functionality has been hoisted to helper functions in Attributes.h in an effort to help the encoding/decoding to stay in sync with the Attribute bitcode definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157581 91177308-0d34-0410-b5e6-96231b3b80d8
* Random BitcodeReader cleanups.Benjamin Kramer2012-05-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157577 91177308-0d34-0410-b5e6-96231b3b80d8
* PR1255: Case RangesStepan Dyatkovskiy2012-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented IntItem - the wrapper around APInt. Why not to use APInt item directly right now? 1. It will very difficult to implement case ranges as series of small patches. We got several large and heavy patches. Each patch will about 90-120 kb. If you replace ConstantInt with APInt in SwitchInst you will need to changes at the same time all Readers,Writers and absolutely all passes that uses SwitchInst. 2. We can implement APInt pool inside and save memory space. E.g. we use several switches that works with 256 bit items (switch on signatures, or strings). We can avoid value duplicates in this case. 3. IntItem can be easyly easily replaced with APInt. 4. Currenly we can interpret IntItem both as ConstantInt and as APInt. It allows to provide SwitchInst methods that works with ConstantInt for non-updated passes. Why I need it right now? Currently I need to update SimplifyCFG pass (EqualityComparisons). I need to work with APInts directly a lot, so peaces of code ConstantInt *V = ...; if (V->getValue().ugt(AnotherV->getValue()) { ... } will look awful. Much more better this way: IntItem V = ConstantIntVal->getValue(); if (AnotherV < V) { } Of course any reviews are welcome. P.S.: I'm also going to rename ConstantRangesSet to IntegersSubset, and CRSBuilder to IntegersSubsetMapping (allows to map individual subsets of integers to the BasicBlocks). Since in future these classes will founded on APInt, it will possible to use them in more generic ways. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157576 91177308-0d34-0410-b5e6-96231b3b80d8
* switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients.Chris Lattner2012-05-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157556 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r156383: removal of TYPE_CODE_FUNCTION_OLDNuno Lopes2012-05-23
| | | | | | Apparently LLVM only stopped emitting this after LLVM 3.0 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157325 91177308-0d34-0410-b5e6-96231b3b80d8
* SwitchInst cosmetics: renamed "Hash" method to "hash"Stepan Dyatkovskiy2012-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156757 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommited r156374 with critical fixes in BitcodeReader/Writer:Stepan Dyatkovskiy2012-05-12
| | | | | | | | | | Ordinary patch for PR1255. Added new case-ranges orientated methods for adding/removing cases in SwitchInst. After this patch cases will internally representated as ConstantArray-s instead of ConstantInt, externally cases wrapped within the ConstantRangesSet object. Old methods of SwitchInst are also works well, but marked as deprecated. So on this stage we have no side effects except that I added support for case ranges in BitcodeReader/Writer, of course test for Bitcode is also added. Old "switch" format is also supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156704 91177308-0d34-0410-b5e6-96231b3b80d8
* remove autoupgrade code for old function attributes format.Nuno Lopes2012-05-08
| | | | | | I still left another fixme regarding alignment, because I'm unsure how to remove that code without breaking things git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156387 91177308-0d34-0410-b5e6-96231b3b80d8
* remove TYPE_CODE_FUNCTION_OLD type code. it is no longer in use and it was ↵Nuno Lopes2012-05-08
| | | | | | marked for removal in 3.0 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156383 91177308-0d34-0410-b5e6-96231b3b80d8
* Rejected r156374: Ordinary PR1255 patch. Due to clang-x86_64-debian-fnt ↵Stepan Dyatkovskiy2012-05-08
| | | | | | buildbot failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156377 91177308-0d34-0410-b5e6-96231b3b80d8
* Ordinary patch for PR1255.Stepan Dyatkovskiy2012-05-08
| | | | | | | | | Added new case-ranges orientated methods for adding/removing cases in SwitchInst. After this patch cases will internally representated as ConstantArray-s instead of ConstantInt, externally cases wrapped within the ConstantRangesSet object. Old methods of SwitchInst are also works well, but marked as deprecated. So on this stage we have no side effects except that I added support for case ranges in BitcodeReader/Writer, of course test for Bitcode is also added. Old "switch" format is also supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156374 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm::SwitchInstStepan Dyatkovskiy2012-03-11
| | | | | | | | | Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default. Added some notes relative to case iterators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152532 91177308-0d34-0410-b5e6-96231b3b80d8
* Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:Stepan Dyatkovskiy2012-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*". ConstCaseIt is just a read-only iterator. CaseIt is read-write iterator; it allows to change case successor and case value. Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters. Main way of iterator usage looks like this: SwitchInst *SI = ... // intialize it somehow for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) { BasicBlock *BB = i.getCaseSuccessor(); ConstantInt *V = i.getCaseValue(); // Do something. } If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method. If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method. There are also related changes in llvm-clients: klee and clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152297 91177308-0d34-0410-b5e6-96231b3b80d8
* BitstreamWriter: Change primary output buffer to be a SmallVector instead of anDaniel Dunbar2012-02-29
| | | | | | | | | std::vector. - Good for 1-2% speedup on writing PCH for Cocoa.h. - Clang side API match to follow shortly, there wasn't an easy way to make this non-breaking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151750 91177308-0d34-0410-b5e6-96231b3b80d8
* BitcodeWriter: Expose less implementation details -- make BackpatchWord privateDaniel Dunbar2012-02-29
| | | | | | and remove getBuffer(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151748 91177308-0d34-0410-b5e6-96231b3b80d8
* Bitcode: Don't expose WriteBitcodeToStream to clients.Daniel Dunbar2012-02-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151747 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR12080 by ensuring that MaterializeModule actually reads all the bitcodeDerek Schuff2012-02-29
| | | | | | | | in the streaming case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151676 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable streaming of bitcodeDerek Schuff2012-02-06
| | | | | | | | | This CL delays reading of function bodies from initial parse until materialization, allowing overlap of compilation with bitcode download. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149918 91177308-0d34-0410-b5e6-96231b3b80d8
* [unwind removal] Don't write out the dead 'unwind' instruction.Bill Wendling2012-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149905 91177308-0d34-0410-b5e6-96231b3b80d8
* [unwind removal] Remove the 'unwind' instruction parsing bits.Bill Wendling2012-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149897 91177308-0d34-0410-b5e6-96231b3b80d8
* Test commit; also removes some trailing whitespaceDerek Schuff2012-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149887 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve the bitcode reader's handling of constant strings to useChris Lattner2012-02-05
| | | | | | | | ConstantDataArray::getString direction, instead of "boxing" each byte into a ConstantInt and using ConstantArray::get. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149805 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply the patches reverted in r149470 that reenable ConstantDataArray,Chris Lattner2012-02-05
| | | | | | | | | | | but with a critical fix to the SelectionDAG code that optimizes copies from strings into immediate stores: the previous code was stopping reading string data at the first nul. Address this by adding a new argument to llvm::getConstantStringInfo, preserving the behavior before the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149800 91177308-0d34-0410-b5e6-96231b3b80d8
* SwitchInst refactoring.Stepan Dyatkovskiy2012-02-01
| | | | | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149481 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert Chris' commits up to r149348 that started causing VMCoreTests unit ↵Argyrios Kyrtzidis2012-02-01
| | | | | | | | | | | | | | | | | | | test to fail. These are: r149348 r149351 r149352 r149354 r149356 r149357 r149361 r149362 r149364 r149365 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149470 91177308-0d34-0410-b5e6-96231b3b80d8
* with recent changes, ConstantArray is never a "string". Remove the associatedChris Lattner2012-01-31
| | | | | | | methods and constant fold the clients to false. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149362 91177308-0d34-0410-b5e6-96231b3b80d8