summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make the side-numbering of instructions used by metadata (which is needed toNick Lewycky2010-02-251-2/+1
| | | | | | | | | keep track of instructions that return void) per-function. This fixes PR5278. This breaks backwards compatibility with the metadata format. That's okay because we haven't released the metadata bitcode yet. llvm-svn: 97132
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-1/+1
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Function-local metadata whose operands had been optimized to no longer refer ↵Victor Hernandez2010-02-061-2/+2
| | | | | | to function-local IR were not getting written by BitcodeWriter; solution is for these metadata to be enumerated just like global metadata. llvm-svn: 95467
* Fix (and test) function-local metadata that occurs before the instruction ↵Victor Hernandez2010-02-041-4/+8
| | | | | | that it refers to; fix is to not enumerate operands of function-local metadata until after all instructions have been enumerated llvm-svn: 95269
* Respect operator precedence (and silence a gcc 4.3 warning).Benjamin Kramer2010-01-231-1/+1
| | | | llvm-svn: 94304
* Remove MetadataBase class because it is not adding significant value.Devang Patel2010-01-221-4/+5
| | | | llvm-svn: 94243
* Simplify code that chooses when to enumerate function-local metadata operandsVictor Hernandez2010-01-141-26/+28
| | | | llvm-svn: 93446
* Clean up unnecessary return and bracketsVictor Hernandez2010-01-141-3/+1
| | | | llvm-svn: 93401
* Enumerate function-local metadata (and its types and operands) only during ↵Victor Hernandez2010-01-131-17/+31
| | | | | | function-incorporation, global metadata continues to be enumerated during creation of ValueEnumerator llvm-svn: 93338
* NamedMDNode is never used so there is no need to enumerate it here.Devang Patel2010-01-091-1/+1
| | | | llvm-svn: 93039
* Derive NamedMDNode from Value.Devang Patel2010-01-091-10/+22
| | | | llvm-svn: 93032
* Use separate namespace for named metadata.Devang Patel2010-01-071-2/+11
| | | | llvm-svn: 92931
* Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null}Devang Patel2010-01-051-1/+2
| | | | llvm-svn: 92783
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-1/+1
| | | | | | dereference the type pointer. llvm-svn: 92726
* rename "elements" of metadata to "operands". "Elements" areChris Lattner2009-12-311-6/+6
| | | | | | | things that occur in types. "operands" are things that occur in values. llvm-svn: 92322
* tidyChris Lattner2009-12-311-3/+4
| | | | llvm-svn: 92320
* This is a major cleanup of the instruction metadata interfaces thatChris Lattner2009-12-281-9/+4
| | | | | | | | | | | | | | | | | | | | | | I asked Devang to do back on Sep 27. Instead of going through the MetadataContext class with methods like getMD() and getMDs(), just ask the instruction directly for its metadata with getMetadata() and getAllMetadata(). This includes a variety of other fixes and improvements: previously all Value*'s were bloated because the HasMetadata bit was thrown into value, adding a 9th bit to a byte. Now this is properly sunk down to the Instruction class (the only place where it makes sense) and it will be folded away somewhere soon. This also fixes some confusion in getMDs and its clients about whether the returned list is indexed by the MDID or densely packed. This is now returned sorted and densely packed and the comments make this clear. This introduces a number of fixme's which I'll follow up on. llvm-svn: 92235
* change the strange MetadataContext::getMDs function to expose lessChris Lattner2009-12-281-1/+1
| | | | | | irrelevant internal implementation details to clients. llvm-svn: 92210
* eliminate the elem_* iterator stuff from NamedMDNode.Chris Lattner2009-12-281-5/+2
| | | | llvm-svn: 92208
* Revert 85678/85680. The decision is to stay with the current form of Chris Lattner2009-11-011-5/+3
| | | | | | | indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it for simplicity. llvm-svn: 85699
* Make blockaddress(@func, null) be valid, and make 'deleting a basic Chris Lattner2009-10-311-3/+5
| | | | | | | | | | | | block with a blockaddress still referring to it' replace the invalid blockaddress with a new blockaddress(@func, null) instead of a inttoptr(1). This changes the bitcode encoding format, and still needs codegen support (this should produce a non-zero value, referring to the entry block of the function would also be quite reasonable). llvm-svn: 85678
* bitcode writer support for blockaddress.Chris Lattner2009-10-281-8/+36
| | | | llvm-svn: 85376
* Type.h doesn't need to #include LLVMContext.hChris Lattner2009-10-271-0/+1
| | | | llvm-svn: 85254
* Fix getMDs() interface such that it does not expose implementation details.Devang Patel2009-10-221-5/+7
| | | | llvm-svn: 84885
* Using TrackingVH instead of WeakVH or WeakMetadataVH.Devang Patel2009-10-221-2/+1
| | | | llvm-svn: 84884
* Do not use SmallVector to store MDNode elements.Devang Patel2009-10-211-4/+3
| | | | llvm-svn: 84784
* s/class Metadata/class MetadataContext/gDevang Patel2009-09-281-3/+3
| | | | llvm-svn: 83019
* Tabs -> spaces, and remove trailing whitespace.Daniel Dunbar2009-09-201-40/+39
| | | | llvm-svn: 82355
* Write and read metadata attachments.Devang Patel2009-09-181-1/+22
| | | | llvm-svn: 82259
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-3/+4
| | | | llvm-svn: 78948
* Use separate ValueList for metadata.Devang Patel2009-08-041-26/+55
| | | | | | This fixes PR4666. llvm-svn: 78056
* Work around a dangling pointer dereference when enumerating NamedMDNodes.Benjamin Kramer2009-07-311-0/+3
| | | | llvm-svn: 77675
* Enumerate NamedMDNode elements first.Devang Patel2009-07-301-4/+0
| | | | llvm-svn: 77636
* Read and write NamedMDNode.Devang Patel2009-07-291-0/+12
| | | | llvm-svn: 77517
* Rename MDNode.h header. It defines MDnode and other metadata classes.Devang Patel2009-07-281-1/+1
| | | | | | New name is Metadata.h. llvm-svn: 77370
* Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into ↵Devang Patel2009-07-231-13/+15
| | | | | | METADATA_BLOCK in bitcode file. llvm-svn: 76834
* Use isa<> instead of dyn_cast<>.Devang Patel2009-07-221-1/+1
| | | | llvm-svn: 76767
* Fixed build warning. No functionality change.Sanjiv Gupta2009-07-221-1/+1
| | | | llvm-svn: 76761
* Introduce MetadataBase, a base class for MDString and MDNode.Devang Patel2009-07-221-3/+7
| | | | | | | Derive MDString directly from MetadataBase. Introduce new bitcode block to hold metadata. llvm-svn: 76759
* Don't remove aggregate-typed module level constants before encoding functionsNick Lewycky2009-06-121-16/+0
| | | | | | since functions may contain aggregate constants too. llvm-svn: 73220
* Make MDNode use CallbackVH. Also change MDNode to store Value* instead ofNick Lewycky2009-05-101-0/+18
| | | | | | | Constant* in preperation of a future change to support holding non-Constants in an MDNode. llvm-svn: 71407
* Large mechanical patch.Devang Patel2008-09-251-8/+8
| | | | | | | | | | | | | | | s/ParamAttr/Attribute/g s/PAList/AttrList/g s/FnAttributeWithIndex/AttributeWithIndex/g s/FnAttr/Attribute/g This sets the stage - to implement function notes as function attributes and - to distinguish between function attributes and return value attributes. This requires corresponding changes in llvm-gcc and clang. llvm-svn: 56622
* Make structs and arrays first-class types, and add assemblyDan Gohman2008-05-231-7/+7
| | | | | | | | | and bitcode support for the extractvalue and insertvalue instructions and constant expressions. Note that this does not yet include CodeGen support. llvm-svn: 51468
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-13/+15
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Reimplement the parameter attributes support, phase #1. hilights:Chris Lattner2008-03-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 1. There is now a "PAListPtr" class, which is a smart pointer around the underlying uniqued parameter attribute list object, and manages its refcount. It is now impossible to mess up the refcount. 2. PAListPtr is now the main interface to the underlying object, and the underlying object is now completely opaque. 3. Implementation details like SmallVector and FoldingSet are now no longer part of the interface. 4. You can create a PAListPtr with an arbitrary sequence of ParamAttrsWithIndex's, no need to make a SmallVector of a specific size (you can just use an array or scalar or vector if you wish). 5. All the client code that had to check for a null pointer before dereferencing the pointer is simplified to just access the PAListPtr directly. 6. The interfaces for adding attrs to a list and removing them is a bit simpler. Phase #2 will rename some stuff (e.g. PAListPtr) and do other less invasive changes. llvm-svn: 48289
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Fix PR1146: parameter attributes are longer part ofDuncan Sands2007-11-271-5/+12
| | | | | | | | | | | | 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
* Fix a nasty problem where we would miss enumeration of some types. This fixesChris Lattner2007-05-061-1/+17
| | | | | | issues with CE_CAST etc. llvm-svn: 36864
* enumerate the operands of a constant before we enumerate the constant itselfChris Lattner2007-05-061-9/+22
| | | | | | This avoids fwd references in the reader. llvm-svn: 36822
* implement the 'string constant' optimization. This shrinks kc.bit fromChris Lattner2007-05-061-4/+5
| | | | | | 2878544 to 2815788 llvm-svn: 36818
OpenPOWER on IntegriCloud