summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Value.cpp
Commit message (Collapse)AuthorAgeFilesLines
* teach Value::isDereferenceablePointer that byval arguments are alwaysChris Lattner2011-01-231-0/+4
| | | | | | dereferencable, noticed by inspection. llvm-svn: 124085
* Move the implementation of the User class into a new source file,Jay Foad2011-01-161-23/+0
| | | | | | User.cpp. llvm-svn: 123575
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-231-1/+1
| | | | | | | new gcc warning that complains on self-assignments and self-initializations. llvm-svn: 122458
* Revert r122114 (CallbackVH observing use-list changes) because it caused ↵Owen Anderson2010-12-201-38/+0
| | | | | | severe slowdowns on the Linux self-host configuration. llvm-svn: 122279
* Add support to CallbackVH to receive notification when a Value's use-list ↵Owen Anderson2010-12-181-0/+38
| | | | | | changes. llvm-svn: 122114
* Move Value::getUnderlyingObject to be a standaloneDan Gohman2010-12-151-21/+0
| | | | | | | function so that it can live in Analysis instead of VMCore. llvm-svn: 121885
* DoxygenifyNick Lewycky2010-11-111-1/+1
| | | | llvm-svn: 118846
* Factor out Instruction::isSafeToSpeculativelyExecute's code forDan Gohman2010-11-111-0/+55
| | | | | | | | | | | | testing for dereferenceable pointers into a helper function, isDereferenceablePointer. Teach it how to reason about GEPs with simple non-zero indices. Also eliminate ArgumentPromtion's IsAlwaysValidPointer, which didn't check for weak externals or out of range gep indices. llvm-svn: 118840
* After updating value handles for RAUW, check that no weak or tracking handlesDuncan Sands2010-07-271-1/+19
| | | | | | | | are still on the list. This might happen if a CallbackVH created some new value handles for the old value when doing RAUW. Barf if it occurs, since it is almost certainly a mistake. llvm-svn: 109495
* Clarify that if a new value handle is added while dropping value handlesDuncan Sands2010-07-241-4/+9
| | | | | | | hanging off a value, then the dropping code will intentionally not drop it too (since this is almost certainly a bug). llvm-svn: 109337
* Make NamedMDNode not be a subclass of Value, and simplify the interfaceDan Gohman2010-07-211-4/+0
| | | | | | for creating and populating NamedMDNodes. llvm-svn: 109061
* Fix Value::stripPointerCasts and BasicAA to avoid trouble onDan Gohman2010-06-281-1/+9
| | | | | | | code in unreachable blocks, which have have use-def cycles. This fixes PR7514. llvm-svn: 107071
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-251-3/+3
| | | | llvm-svn: 99564
* Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move someDuncan Sands2010-02-161-2/+2
| | | | | | methods to try to have the type predicates be more logically positioned. llvm-svn: 96349
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-5/+5
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Change Value::getUnderlyingObject to have the MaxLookup value specified as aBob Wilson2010-01-251-4/+3
| | | | | | | | | | | | parameter with a default value, instead of just hardcoding it in the implementation. The limit of MaxLookup = 6 was introduced in r69151 to fix a performance problem with O(n^2) behavior in instcombine, but the scalarrepl pass is relying on getUnderlyingObject to go all the way back to an AllocaInst. Making the limit part of the method signature makes it clear that by default the result is limited and should help avoid similar problems in the future. This fixes pr6126. llvm-svn: 94433
* Introduce Twine::toStringRef, a variant of toVector which avoids the copy if theBenjamin Kramer2010-01-131-9/+6
| | | | | | | twine can be represented as a single StringRef. Use the new methode to simplify some twine users. llvm-svn: 93317
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-7/+4
| | | | | | dereference the type pointer. llvm-svn: 92726
* Change errs() to dbgs().David Greene2010-01-051-3/+3
| | | | llvm-svn: 92663
* When doing v1->RAUW(v2), don't do anything to metadata. We don't knowChris Lattner2009-12-291-9/+0
| | | | | | | | why one was replaced with the other. Even in the specific case of debug information, it doesn't make sense to transfer the location over, this will just result in jumbled loc info. llvm-svn: 92241
* This is a major cleanup of the instruction metadata interfaces thatChris Lattner2009-12-281-10/+9
| | | | | | | | | | | | | | | | | | | | | | 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
* remove a bunch of locking from LLVMContextImpl. Since only one threadChris Lattner2009-11-011-2/+0
| | | | | | | can be banging on a context at a time, this isn't needed. Owen, please review. llvm-svn: 85728
* Remove unnecessary include.Daniel Dunbar2009-10-171-1/+0
| | | | llvm-svn: 84336
* Copy metadata when value is RAUW'd. It is debatable whether this is the ↵Devang Patel2009-10-131-0/+4
| | | | | | right approach for custom metadata data in general. However, right now the only custom data user, "dbg", expects this behavior while FE is constructing llvm IR with debug info. llvm-svn: 83977
* Fix http://llvm.org/PR5160, to let CallbackVHs modify other ValueHandles on theJeffrey Yasskin2009-10-121-23/+46
| | | | | | same Value without breaking things. llvm-svn: 83861
* Fix commento.Daniel Dunbar2009-09-221-2/+1
| | | | llvm-svn: 82544
* Add a TrackingVH value handle.Daniel Dunbar2009-09-221-0/+13
| | | | | | | | | | This is designed for tracking a value even when it might move (like WeakVH), but it is an error to delete the referenced value (unlike WeakVH0. TrackingVH is templated like AssertingVH on the tracked Value subclass, it is an error to RAUW a tracked value to an incompatible type. For implementation reasons the latter error is only diagnosed on accesses to a mis-RAUWed TrackingVH, because we don't want a virtual interface in a templated class. The former error is also only diagnosed on access, so that clients are allowed to delete a tracked value, as long as they don't use it. This makes it easier for the client to reason about destruction. llvm-svn: 82506
* Strip trailing whitespace.Daniel Dunbar2009-09-201-41/+41
| | | | llvm-svn: 82359
* Initialize HasMetadata to zero.Benjamin Kramer2009-09-171-2/+2
| | | | llvm-svn: 82145
* Add llvm::Metadata to manage metadata used in a context. Devang Patel2009-09-161-0/+5
| | | | | | This interface will be used to attach metadata with an instruction. llvm-svn: 82060
* Teach getUnderlyingObject and skipPointerCasts about GlobalAliases.Dan Gohman2009-08-271-0/+8
| | | | llvm-svn: 80265
* Add a fast path for setName("") on an unnamed value.Daniel Dunbar2009-08-191-0/+4
| | | | llvm-svn: 79492
* Make a SmallVector size more reasonable.Daniel Dunbar2009-08-191-1/+1
| | | | llvm-svn: 79403
* Privatize the ValueHandle global map. Because this is used so heavily ↵Owen Anderson2009-08-181-21/+15
| | | | | | | | throughout the code base, locking all accesses to it is not practical performance-wise. llvm-svn: 79355
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-3/+6
| | | | llvm-svn: 78948
* Fix a typo in an assertion string.Dan Gohman2009-08-111-1/+1
| | | | llvm-svn: 78671
* revert r78048, it isn't worth using assertingvh here.Chris Lattner2009-08-041-8/+8
| | | | llvm-svn: 78119
* switch ValueMap to using AssertingVH. This is an old patch I had layingChris Lattner2009-08-041-8/+8
| | | | | | around in a tree I forgot about. llvm-svn: 78048
* Keep track of named mdnodes in a Module using an ilist.Devang Patel2009-07-291-0/+4
| | | | llvm-svn: 77476
* 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
* Make sure getName().data() is always null terminated.Daniel Dunbar2009-07-261-1/+4
| | | | llvm-svn: 77149
* Rewrite getName{Start,End,Len} in terms of getName(), instead of vice-versa.Daniel Dunbar2009-07-261-13/+3
| | | | llvm-svn: 77105
* Simplify.Daniel Dunbar2009-07-261-12/+5
| | | | llvm-svn: 77102
* Remove Value::setName(const char*, unsigned).Daniel Dunbar2009-07-261-7/+7
| | | | llvm-svn: 77100
* Remove Value::setName(const char*).Daniel Dunbar2009-07-261-7/+1
| | | | | | | | - Split into a separate patch because there is a slight functionality change, it is no longer valid to call setName(0), which was equivalent to setName(""). I'm hoping no one depends on this... llvm-svn: 77099
* Remove Value::{isName, getNameRef}.Daniel Dunbar2009-07-251-12/+0
| | | | | | Also, change MDString to use a StringRef. llvm-svn: 77098
* Initial update to VMCore to use Twines for string arguments.Daniel Dunbar2009-07-251-2/+5
| | | | | | | - The only meat here is in Value.{h,cpp} the rest is essential 'const std::string &' -> 'const Twine &'. llvm-svn: 77048
* Move more to raw_ostream.Daniel Dunbar2009-07-241-4/+4
| | | | llvm-svn: 76964
* Add llvm::Value::getNameRef, for help in API migration.Daniel Dunbar2009-07-231-1/+6
| | | | llvm-svn: 76893
* Introduce MetadataBase, a base class for MDString and MDNode.Devang Patel2009-07-221-1/+4
| | | | | | | Derive MDString directly from MetadataBase. Introduce new bitcode block to hold metadata. llvm-svn: 76759
OpenPOWER on IntegriCloud