summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantsContext.h
Commit message (Collapse)AuthorAgeFilesLines
* When a constant's type is refined, update the constant in placeDan Gohman2009-09-151-165/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 81861
* Preserve the inbounds flag, so that the constant folder doesn'tDan Gohman2009-09-121-2/+5
| | | | | | recompute it. llvm-svn: 81634
* Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.Dan Gohman2009-09-071-18/+31
| | | | llvm-svn: 81172
* Public and private corrections, warned about by icc (#304).Duncan Sands2009-09-061-10/+10
| | | | | | Patch by Erick Tryzelaar. llvm-svn: 81107
* Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", thisDaniel Dunbar2009-09-061-31/+18
| | | | | | breaks MiniSAT on x86_64. llvm-svn: 81098
* Include optional subclass flags, such as inbounds, nsw, etc., in theDan Gohman2009-09-041-18/+31
| | | | | | | | | | | | | | | | | 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. llvm-svn: 80998
* Now Bitcode reader bug is fixed. Reapply 80839.Devang Patel2009-09-031-19/+12
| | | | | | | | Use CallbackVH, instead of WeakVH, to hold MDNode elements. Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. llvm-svn: 80868
* Revert 80839 for now. It causes test failures.Devang Patel2009-09-021-12/+19
| | | | llvm-svn: 80841
* Use CallbackVH, instead of WeakVH, to hold MDNode elements. Devang Patel2009-09-021-19/+12
| | | | | | | Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. llvm-svn: 80839
* Free the constants that have no uses in ~LLVMContext.Torok Edwin2009-08-311-0/+8
| | | | | | | | | | | This fixes leaks from LLVMContext in multithreaded apps. Since constants are only deleted if they have no uses, it is safe to not delete a Module on shutdown, as many single-threaded tools do. Multithreaded apps should however delete the Module before destroying the Context to ensure that there are no leaks (assuming they use a different context for each thread). llvm-svn: 80590
* remove some DOUTsChris Lattner2009-08-231-1/+2
| | | | llvm-svn: 79821
* Use standard LLVM-style headers.Owen Anderson2009-08-231-1/+1
| | | | llvm-svn: 79817
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-1/+1
| | | | llvm-svn: 78948
* Remove dead metadata.Devang Patel2009-08-111-0/+1
| | | | llvm-svn: 78651
* Rename ConvertType to ConvertConstant to avoid a name conflict on llvm-gcc.Daniel Dunbar2009-08-101-9/+9
| | | | llvm-svn: 78596
* g++ 4.0 doesn't have std::vector::data.Benjamin Kramer2009-08-101-1/+1
| | | | llvm-svn: 78579
* Change the MDNode uniquing to a ValueMap, at Devang's request.Owen Anderson2009-08-101-12/+19
| | | | llvm-svn: 78577
* It helps if I remember to actually add the file...Owen Anderson2009-08-041-0/+774
llvm-svn: 78116
OpenPOWER on IntegriCloud