aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Constants.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix unused variable warnings.Devang Patel2008-11-031-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58653 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix type-o in ExprMapKeyType::operator ==(). The "&&" was missing.Bill Wendling2008-10-261-1/+1
| | | | | | | Patch by Frits van Bommel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58175 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a "loses information" return value to APFloat::convertDale Johannesen2008-10-091-10/+16
| | | | | | | | | and APFloat::convertToInteger. Restore return value to IEEE754. Adjust all users accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57329 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ConstantExpr::getInsertElement.Gordon Henriksen2008-08-301-2/+1
| | | | | | | Breakage was exposed in the Ocaml bindings tests after Chris uncommented an assertion in r55084. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55566 91177308-0d34-0410-b5e6-96231b3b80d8
* the bug was apparently fixed long ago, reenable the assertionChris Lattner2008-08-231-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55224 91177308-0d34-0410-b5e6-96231b3b80d8
* Accept NOT of a constant vector of int.Dale Johannesen2008-08-211-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55140 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new ConstantExpr::getWithOperands that takes any array of operands Chris Lattner2008-08-201-4/+4
| | | | | | | | | instead of requiring an std::vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55084 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix several const-correctness issues, resolving some -Wcast-qual warnings.Dan Gohman2008-08-051-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54349 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary implicit argumentNate Begeman2008-07-251-6/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54031 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix minor issues with VICmp/VFCmp constant expressionsNate Begeman2008-07-251-13/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54030 91177308-0d34-0410-b5e6-96231b3b80d8
* InsertValue and ExtractValue constant expressions are alwaysDan Gohman2008-07-211-40/+6
| | | | | | | | folded. Remove code that handled the case where they aren't folded, and remove bitcode reader/writer support for them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53887 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of bugs handling vector compare constant expressions, fixingChris Lattner2008-07-141-34/+54
| | | | | | | PR2317. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53544 91177308-0d34-0410-b5e6-96231b3b80d8
* Document and fix Constant::getVectorElements to return an empty vectorChris Lattner2008-07-141-12/+23
| | | | | | | | | | | when presented with a constant expr. If ConstantExpr::getV[IF]Cmp to work when ConstantFoldCompareInstruction returns an undef or constant expr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53541 91177308-0d34-0410-b5e6-96231b3b80d8
* Use find instead of lower_bound.Dan Gohman2008-07-111-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
* SImplify ConstantVector::get a bit and make it turn a vectorChris Lattner2008-07-101-8/+18
| | | | | | | of all undefs into a single undef value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53384 91177308-0d34-0410-b5e6-96231b3b80d8
* add a helper method for code that wants to handle vectorChris Lattner2008-07-101-0/+25
| | | | | | | constants by element without caring how they are formed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53381 91177308-0d34-0410-b5e6-96231b3b80d8
* Add newline at the end of Constants.cpp.Matthijs Kooijman2008-07-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53092 91177308-0d34-0410-b5e6-96231b3b80d8
* - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an ↵Evan Cheng2008-06-301-41/+1
| | | | | | | | | 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-291-1/+41
| | | | | | | | | | | | 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-261-41/+1
| | | | | | | | | | 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
* Use push_back rather than operator[], which is incorrect in this cases. ↵Owen Anderson2008-06-251-1/+1
| | | | | | | | | Unfortunately, this slow the testcase down a little bit, but only marginally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52700 91177308-0d34-0410-b5e6-96231b3b80d8
* In ConstantArray::getAsString(), we know the size of the resultant string in ↵Owen Anderson2008-06-241-1/+2
| | | | | | | | | advance so we can pre-allocate it and just fill in the entries. This improves the time for the AsmPrinter on InstructionCombining.cpp from 0.4248s to 0.3370s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52690 91177308-0d34-0410-b5e6-96231b3b80d8
* More changes from Chris' review: simplify getIndices and avoidDan Gohman2008-06-231-8/+6
| | | | | | | copying its return value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52627 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant folding for insertvalue and extractvalue.Dan Gohman2008-06-031-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51889 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some bugs with the handling of indices in insertvalue/extractvalue.Dan Gohman2008-05-311-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51820 91177308-0d34-0410-b5e6-96231b3b80d8
* IR, bitcode reader, bitcode writer, and asmparser changes toDan Gohman2008-05-311-119/+97
| | | | | | | | | | | | insertvalue and extractvalue to use constant indices instead of Value* indices. And begin updating LangRef.html. There's definately more to come here, but I'm checking this basic support in now to make it available to people who are interested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51806 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate calls to deprecated Use::init() interfaceGabor Greif2008-05-261-25/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51570 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more IR support for the new extractvalue and insertvalueDan Gohman2008-05-231-12/+11
| | | | | | | instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51461 91177308-0d34-0410-b5e6-96231b3b80d8
* IR support for extractvalue and insertvalue instructions. Also, beginDan Gohman2008-05-151-6/+219
| | | | | | | moving toward making structs and arrays first-class types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51157 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-4/+7
| | | | | | makefile targets to find these better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51143 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-0/+4
| | | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build breakageNate Begeman2008-05-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50986 91177308-0d34-0410-b5e6-96231b3b80d8
* Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRefNate Begeman2008-05-121-6/+88
| | | | | | | for details. CodeGen support coming in a follow up patch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50985 91177308-0d34-0410-b5e6-96231b3b80d8
* merge of use-diet branch to trunkGabor Greif2008-05-101-56/+126
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50943 91177308-0d34-0410-b5e6-96231b3b80d8
* add a simplified accessor for creating an fp constant of a Chris Lattner2008-04-091-13/+25
| | | | | | | particular value but variable type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49416 91177308-0d34-0410-b5e6-96231b3b80d8
* add a version of ConstantFP::get that doesn't take a redundant Type* value,Chris Lattner2008-04-091-21/+22
| | | | | | | start migrating code over to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49413 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a warningGabor Greif2008-04-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49282 91177308-0d34-0410-b5e6-96231b3b80d8
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-3/+44
| | | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment typo.Duncan Sands2008-03-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48967 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in a comment.Dan Gohman2008-02-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46836 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-1/+1
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement address space attribute for LLVM pointer types. Address spaces are Christopher Lamb2007-12-111-1/+2
| | | | | | | | | | | | | | | | | | regions of memory that have a target specific relationship, as described in the Embedded C Technical Report. This also implements the 2007-12-11-AddressSpaces test, which demonstrates how address space attributes can be used in LLVM IR. In addition, this patch changes the bitcode signature for stores (in a backwards compatible manner), such that the pointer type, rather than the pointee type, is encoded. This permits type information in the pointer (e.g. address space) to be preserved for stores. LangRef updates are forthcoming. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44858 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting dtor devirtualization patch.Gordon Henriksen2007-12-101-59/+114
| | | | | | | _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-091-114/+59
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44747 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for vectors to int <-> float casts.Nate Begeman2007-11-171-7/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44204 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix InstCombine/2007-10-31-StringCrash.ll by removing an obviousChris Lattner2007-11-011-12/+8
| | | | | | | (in hindsight) infinite recursion. Simplify the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43597 91177308-0d34-0410-b5e6-96231b3b80d8
* this doesn't need dynamic_cast.Chris Lattner2007-10-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43133 91177308-0d34-0410-b5e6-96231b3b80d8
* Define a helper function ConstantVector::getSplatValue for testing forDan Gohman2007-10-171-0/+11
| | | | | | | and working with broadcasted constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43076 91177308-0d34-0410-b5e6-96231b3b80d8
* Next PPC long double bits. First cut at constants.Dale Johannesen2007-10-111-0/+9
| | | | | | | | | | | No compile-time support for constant operations yet, just format transformations. Make readers and writers work. Split constants into 2 doubles in Legalize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42865 91177308-0d34-0410-b5e6-96231b3b80d8