summaryrefslogtreecommitdiff
path: root/include/llvm/Constant.h
Commit message (Collapse)AuthorAge
* eliminate a bunch of pointless LLVMContext arguments.Chris Lattner2010-02-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95001 91177308-0d34-0410-b5e6-96231b3b80d8
* the verifier shouldn't modify the IR.Chris Lattner2009-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85722 91177308-0d34-0410-b5e6-96231b3b80d8
* Previously, all operands to Constant were themselves constant.Chris Lattner2009-10-28
| | | | | | | | | | In the new world order, BlockAddress can have a BasicBlock operand. This doesn't permute much, because if you have a ConstantExpr (or anything more specific than Constant) we still know the operand has to be a Constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85375 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
* 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
* Add a new Constant::getIntegerValue helper function, and convert aDan Gohman2009-08-03
| | | | | | | | few places in InstCombine to use it, to fix problems handling pointer types. This fixes the recent llvm-gcc bootstrap error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78005 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-31
| | | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
* make Constant::getRelocationInfo return an enum, as suggested by Duncan.Chris Lattner2009-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76938 91177308-0d34-0410-b5e6-96231b3b80d8
* reimplement Constant::ContainsRelocations as Chris Lattner2009-07-22
| | | | | | | | | | | Constant::getRelocationInfo(), which has a much simpler to use API. It still should not be part of libvmcore, but is better than it was. Also teach it to be smart about hidden visibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76700 91177308-0d34-0410-b5e6-96231b3b80d8
* Privatize the MDString uniquing table.Owen Anderson2009-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76113 91177308-0d34-0410-b5e6-96231b3b80d8
* These don't really need contexts either.Owen Anderson2009-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75528 91177308-0d34-0410-b5e6-96231b3b80d8
* Move more functionality over to LLVMContext.Owen Anderson2009-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75497 91177308-0d34-0410-b5e6-96231b3b80d8
* Begin the painful process of tearing apart the rat'ss nest that is ↵Owen Anderson2009-07-13
| | | | | | | | | | Constants.cpp and ConstantFold.cpp. This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's the only way I could figure out to make this process vaguely incremental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75445 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r73790, and replace it with a significantly less ugly solution. ↵Owen Anderson2009-06-20
| | | | | | | | | | Rather than trying to make the global reader-writer lock work, create separate recursive mutexes for each value map. The recursive-ness fixes the double-acquiring issue, which having one per ValueMap lets us continue to maintain some concurrency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73801 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a serious bug that would cause deadlock during abstract type refinement. ↵Owen Anderson2009-06-19
| | | | | | | | | | | The constant creation gets involved, and we end up trying to recursively acquire a writer lock. The fix for this is slightly horrible, and involves passing a boolean "locked" parameter around in Constants.cpp, but it's better than having locked and unlocked versions of most of the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73790 91177308-0d34-0410-b5e6-96231b3b80d8
* Clearify local/global relocations wordingAnton Korobeynikov2009-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68037 91177308-0d34-0410-b5e6-96231b3b80d8
* Honour relocation behaviour stuff for ro objectsAnton Korobeynikov2009-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68005 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the relocation tracker handler, so we can filter on different 'kinds' ↵Anton Korobeynikov2009-03-29
| | | | | | of relocations required. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68004 91177308-0d34-0410-b5e6-96231b3b80d8
* fix typo'sGabor Greif2008-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57435 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | use raw_ostream instead of std::ostream. Among other goodness, this speeds up llvm-dis of kc++ with a release build from 0.85s to 0.49s (88% faster). Other interesting changes: 1) This makes Value::print be non-virtual. 2) AP[S]Int and ConstantRange can no longer print to ostream directly, use raw_ostream instead. 3) This fixes a bug in raw_os_ostream where it didn't flush itself when destroyed. 4) This adds a new SDNode::print method, instead of only allowing "dump". A lot of APIs have both std::ostream and raw_ostream versions, it would be useful to go through and systematically anihilate the std::ostream versions. This passes dejagnu, but there may be minor fallout, plz let me know if so and I'll fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55263 91177308-0d34-0410-b5e6-96231b3b80d8
* comment updateChris Lattner2008-08-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54576 91177308-0d34-0410-b5e6-96231b3b80d8
* add a helper method for code that wants to handle vectorChris Lattner2008-07-10
| | | | | | | constants by element without caring how they are formed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53382 91177308-0d34-0410-b5e6-96231b3b80d8
* - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an ↵Evan Cheng2008-06-30
| | | | | | | | | empty string for ConstantAggregateZero case which surprises selectiondag. - Correctly handle memcpy from constant string which is zero-initialized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert (52748 and friends):Anton Korobeynikov2008-06-29
| | | | | | | | | | | | Move GetConstantStringInfo to lib/Analysis. Remove string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. This unbreaks llvm-gcc bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
* Move GetConstantStringInfo to lib/Analysis. RemoveEric Christopher2008-06-26
| | | | | | | | | | string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52748 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove warnings about unused parameters and shadowed variables.Bill Wendling2008-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51266 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-29
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting dtor devirtualization patch.Gordon Henriksen2007-12-10
| | | | | | | _sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed _sabre_: the vtable lives to fight another day git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44760 91177308-0d34-0410-b5e6-96231b3b80d8
* Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!Gordon Henriksen2007-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44747 91177308-0d34-0410-b5e6-96231b3b80d8
* add a Constant::getAllOnesValue helper function, which works on integersChris Lattner2007-06-15
| | | | | | | AND vectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37586 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Value::getValueType to getValueID, to avoid confusion withDan Gohman2007-04-13
| | | | | | | other things named getValueType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35964 91177308-0d34-0410-b5e6-96231b3b80d8
* Added ContainsRelocations() to check if a constant might only be resolvable ↵Evan Cheng2007-03-08
| | | | | | at load time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35014 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch ValueSymbolTable to use StringMap<Value*> instead of ↵Chris Lattner2007-02-12
| | | | | | | | | | std::map<std::string, Value*> as its main datastructure. There are many improvements yet to be made, but this speeds up opt --std-compile-opts on 447.dealII by 7.3%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34193 91177308-0d34-0410-b5e6-96231b3b80d8
* Added an automatic cast to "std::ostream*" etc. from OStream. We then canBill Wendling2006-12-17
| | | | | | | | rework the hacks that had us passing OStream in. We pass in std::ostream* instead, check for null, and then dispatch to the correct print() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32636 91177308-0d34-0410-b5e6-96231b3b80d8
* add a method to determine whether evaluation of a constant can trap.Chris Lattner2006-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31059 91177308-0d34-0410-b5e6-96231b3b80d8
* remove dead methodChris Lattner2006-09-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30640 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR778:Reid Spencer2006-06-05
| | | | | | | | Move file-scoped documentation to class-scoped so it is more readily accessible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28689 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a parameter to control whether Constant::getStringValue() would chopEvan Cheng2006-03-10
| | | | | | | off the result string at the first null terminator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26704 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the multiple copies of getStringValue. Now a Constant:: method.Jim Laskey2006-03-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26616 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix VC++ level 4 warnings. Because a base class has declared these private, ↵Jeff Cohen2005-12-17
| | | | | | VC++ complains it cannot automatically generate this methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24751 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some dead argument names which irritates GCC at certain warning levels.Chris Lattner2005-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23979 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the signature of replaceUsesOfWithOnConstant to take a Use* and notChris Lattner2005-10-04
| | | | | | | take the bool. The bool is always true dynamically. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23625 91177308-0d34-0410-b5e6-96231b3b80d8
* Split SimpleConstantVal up into its components, so each Constant subclass getsChris Lattner2005-09-27
| | | | | | | | | | | | a different enum value. This allows 'classof' for these to be really simple, not needing to call getType() anymore. This speeds up isa/dyncast/etc for constants, and also makes them smaller. For example, the text section of a release build of InstCombine.cpp shrinks from 230037 bytes to 216363 bytes, a 6% reduction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23466 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21408 91177308-0d34-0410-b5e6-96231b3b80d8
* remove all of the various setName implementations, consolidating them intoChris Lattner2005-03-05
| | | | | | | Value::setName, which is no longer virtual. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20464 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the second argument to Value::setName, it is never needed.Chris Lattner2005-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20457 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust to user changes.Chris Lattner2005-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19886 91177308-0d34-0410-b5e6-96231b3b80d8
* Add static functions to clear singleton maps. Patch contributed byChris Lattner2004-11-19
| | | | | | | Morten Ofstad! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17994 91177308-0d34-0410-b5e6-96231b3b80d8
* UndefValue's are constantsChris Lattner2004-10-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17034 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that ConstantPointerRef is gone, it is the case that all operands of ↵Chris Lattner2004-08-04
| | | | | | | | | | constants are themselves constants. This should allow us to reduce a significant amount of casting in the sourcebase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15459 91177308-0d34-0410-b5e6-96231b3b80d8