summaryrefslogtreecommitdiff
path: root/include/llvm/Value.h
Commit message (Collapse)AuthorAge
* make the Value constructor protected.Chris Lattner2010-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106427 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo.Nick Lewycky2010-05-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105096 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch isa_impl from a function template to a class template with aDouglas Gregor2010-03-30
| | | | | | | | static inline member function doit(). This enables the use of partial specialization to override the last stage of the "isa" check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99898 91177308-0d34-0410-b5e6-96231b3b80d8
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99564 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a union type in LLVM IR. Patch by Talin!Chris Lattner2010-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Value::getUnderlyingObject to have the MaxLookup value specified as aBob Wilson2010-01-25
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94433 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove #include of metadata.h from intrinsicinst.h. The onlyChris Lattner2009-12-31
| | | | | | | | | method that needs it (DbgValueInst::getValue) has been moved out of line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92323 91177308-0d34-0410-b5e6-96231b3b80d8
* Final step in the metadata API restructuring: move the Chris Lattner2009-12-29
| | | | | | | | | | getMDKindID/getMDKindNames methods to LLVMContext (and add convenience methods to Module), eliminating MetadataContext. Move the state that it maintains out to LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8
* sink twine.h down out of Value.h. It is annoying that you needChris Lattner2009-12-29
| | | | | | | to #include Twine.h just to give a twine a default value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92247 91177308-0d34-0410-b5e6-96231b3b80d8
* add a layer of accessors around the Value::SubClassData member, and use Chris Lattner2009-12-29
| | | | | | | | | | | | | a convention (shadowing the setter with private forwarding function) to prevent subclasses from accidentally using it. This exposed some bogosity in ConstantExprs, which was propaging the opcode of the constant expr into the NUW/NSW/Exact field in the getWithOperands/getWithOperandReplaced methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92239 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a major cleanup of the instruction metadata interfaces thatChris Lattner2009-12-28
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92235 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the FixedStackPseudoSourceValueVal enum value before InstructionValDan Gohman2009-11-13
| | | | | | | | | so that isa<Instructon> doesn't return true for FixedStackPseudoSourceValue values. This fixes a variety of problems, including crashes with -debug and -print-machineinstrs. Also, add a comment to warn about this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88711 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove my Value.h build fix.Daniel Dunbar2009-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87029 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a build error by providing a missing enum value.David Greene2009-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87028 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to unbreak LLVM build, David G. please check.Daniel Dunbar2009-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87025 91177308-0d34-0410-b5e6-96231b3b80d8
* IR support for the new BlockAddress constant kind. This isChris Lattner2009-10-28
| | | | | | | | untested and there is no way to use it, next up: doing battle with asmparser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85349 91177308-0d34-0410-b5e6-96231b3b80d8
* Hide MetadataContext implementation details.Devang Patel2009-10-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84886 91177308-0d34-0410-b5e6-96231b3b80d8
* s/class Metadata/class MetadataContext/gDevang Patel2009-09-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83019 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not leave behind metadata while cloning an instruction.Devang Patel2009-09-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82638 91177308-0d34-0410-b5e6-96231b3b80d8
* Give MachineMemOperand an operator<<, factoring out code fromDan Gohman2009-09-23
| | | | | | | | | | | | | two different places for printing MachineMemOperands. Drop the virtual from Value::dump and instead give Value a protected virtual hook that can be overridden by subclasses to implement custom printing. This lets printing be more consistent, and simplifies printing of PseudoSourceValue values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82599 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm::Metadata to manage metadata used in a context. Devang Patel2009-09-16
| | | | | | | | This interface will be used to attach metadata with an instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82060 91177308-0d34-0410-b5e6-96231b3b80d8
* When a constant's type is refined, update the constant in placeDan Gohman2009-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | instead of cloning and RAUWing it. - Make AbstractTypeUser a friend of Value so that it can offer its subclasses a way to update a Value's type in place. This is better than a universally visible setType method on Value, and it's sufficient for the immediate need. - Eliminate the constant "convert" functions. This eliminates a lot of logic duplication, and fixes a complicated bug where a constant can't actually be cloned during the type refinement process because some of the types that its folder needs are half-destroyed, being in the middle of refinement themselves. - Move the getValType functions from being static overloaded functions in Constants.cpp to be members of class template specializations in ConstantsContext.h. This means that the code ends up getting instantiated twice, however it also makes it possible to eliminate all "convert" functions, so it's not a big net code size increase. And if desired, the duplicate instantiations could be eliminated with some reorganization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81861 91177308-0d34-0410-b5e6-96231b3b80d8
* Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.Dan Gohman2009-09-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81172 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", thisDaniel Dunbar2009-09-06
| | | | | | breaks MiniSAT on x86_64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81098 91177308-0d34-0410-b5e6-96231b3b80d8
* Include optional subclass flags, such as inbounds, nsw, etc., in theDan Gohman2009-09-04
| | | | | | | | | | | | | | | | | | Constant uniquing tables. This allows distinct ConstantExpr objects with the same operation and different flags. Even though a ConstantExpr "a + b" is either always overflowing or never overflowing (due to being a ConstantExpr), it's still necessary to be able to represent it both with and without overflow flags at the same time within the IR, because the safety of the flag may depend on the context of the use. If the constant really does overflow, it wouldn't ever be safe to use with the flag set, however the use may be in code that is never actually executed. This also makes it possible to merge all the flags tests into a single test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80998 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,Dan Gohman2009-08-25
| | | | | | | | | | | | | | | | | and introduce a new Instruction::isIdenticalTo which tests for full identity, including the SubclassOptionalData flags. Also, fix the Instruction::clone implementations to preserve the SubclassOptionalData flags. Finally, teach several optimizations how to handle SubclassOptionalData correctly, given these changes. This fixes the counterintuitive behavior of isIdenticalTo not comparing the full value, and clone not returning an identical clone, as well as some subtle bugs that could be caused by these. Thanks to Nick Lewycky for reporting this, and for an initial patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80038 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-23
| | | | | | | This required converting a bunch of stuff off DOUT and other cleanups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79819 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVMContext and LLVMContextImpl classes instead of structs.Benjamin Kramer2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78690 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r78048, it isn't worth using assertingvh here.Chris Lattner2009-08-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78119 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor some of the constants+context related code out into a separate ↵Owen Anderson2009-08-04
| | | | | | | | | header, to make LLVMContextImpl.h not hideous. Also, fix some MSVC compile errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78115 91177308-0d34-0410-b5e6-96231b3b80d8
* switch ValueMap to using AssertingVH. This is an old patch I had layingChris Lattner2009-08-04
| | | | | | | around in a tree I forgot about. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78048 91177308-0d34-0410-b5e6-96231b3b80d8
* Add NamedMDNode.Devang Patel2009-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77409 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify getName() comment.Devang Patel2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77383 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment on Value explaining the current getName() behavior.Daniel Dunbar2009-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77269 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77152 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Value::getNameLenDaniel Dunbar2009-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77148 91177308-0d34-0410-b5e6-96231b3b80d8
* Some clients rely on getName{Start,End} not returning 0, even if the length isDaniel Dunbar2009-07-26
| | | | | | | | 0. - I could have swore the prev change went through a make check cycle... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77106 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite getName{Start,End,Len} in terms of getName(), instead of vice-versa.Daniel Dunbar2009-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77105 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Value::setName(const char*, unsigned).Daniel Dunbar2009-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77100 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Value::setName(const char*).Daniel Dunbar2009-07-26
| | | | | | | | | - 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... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77099 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Value::{isName, getNameRef}.Daniel Dunbar2009-07-25
| | | | | | | Also, change MDString to use a StringRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77098 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial update to VMCore to use Twines for string arguments.Daniel Dunbar2009-07-25
| | | | | | | | - The only meat here is in Value.{h,cpp} the rest is essential 'const std::string &' -> 'const Twine &'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77048 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm::Value::getNameRef, for help in API migration.Daniel Dunbar2009-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76893 91177308-0d34-0410-b5e6-96231b3b80d8
* Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into ↵Devang Patel2009-07-23
| | | | | | METADATA_BLOCK in bitcode file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76834 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce MetadataBase, a base class for MDString and MDNode.Devang Patel2009-07-22
| | | | | | | | | | Derive MDString directly from MetadataBase. Introduce new bitcode block to hold metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76759 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the Pass+Context magic.Owen Anderson2009-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a method to clear optional optimization information from a Value.Dan Gohman2009-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76215 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a SubclassOptionalData field to Value. See the doxygen comment forDan Gohman2009-07-17
| | | | | | | details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76189 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for embedded metadata to LLVM. This introduces two new types ofNick Lewycky2009-04-04
| | | | | | | | | Constant, MDString and MDNode which can only be used by globals with a name that starts with "llvm." or as arguments to a function with the same naming restriction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68420 91177308-0d34-0410-b5e6-96231b3b80d8
* correct patchChris Lattner2009-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68353 91177308-0d34-0410-b5e6-96231b3b80d8