summaryrefslogtreecommitdiff
path: root/lib/VMCore/ConstantsContext.h
Commit message (Collapse)AuthorAge
* remove unions from LLVM IR. They are severely buggy and notChris Lattner2010-08-28
| | | | | | | being actively maintained, improved, or extended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR7658, a problem where type refinement can triggerChris Lattner2010-07-17
| | | | | | | | | | constant replacement which was botching its handling of types. Use of getType() instead of getRawType() was causing the type map in constant folding to be updated wrong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108610 91177308-0d34-0410-b5e6-96231b3b80d8
* Free all Constants in ~LLVMConstantImpl. We avoid assertion failuresJeffrey Yasskin2010-03-22
| | | | | | | | | | | by dropping all references from all constants that can use other constants before trying to destroy any of them. I also had to free bugpoint's Module in ~BugDriver(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99160 91177308-0d34-0410-b5e6-96231b3b80d8
* Memoize InlineAsms into the LLVMContext and delete them on shutdown.Jeffrey Yasskin2010-03-21
| | | | | | | Fixes PR803. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99143 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
* Fix a build error and change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92669 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92659 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a bunch of locking from LLVMContextImpl. Since only one threadChris Lattner2009-11-01
| | | | | | | | can be banging on a context at a time, this isn't needed. Owen, please review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85728 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename lib/VMCore/ConstantsContext.h:ValueMap<> to ConstantUniqueMap<> to avoidJeffrey Yasskin2009-10-27
| | | | | | | colliding with llvm/ADT/ValueMap.h:ValueMap<>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85344 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
* Preserve the inbounds flag, so that the constant folder doesn'tDan Gohman2009-09-12
| | | | | | | recompute it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81634 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
* Public and private corrections, warned about by icc (#304).Duncan Sands2009-09-06
| | | | | | | Patch by Erick Tryzelaar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81107 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
* Now Bitcode reader bug is fixed. Reapply 80839.Devang Patel2009-09-03
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80868 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 80839 for now. It causes test failures.Devang Patel2009-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80841 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CallbackVH, instead of WeakVH, to hold MDNode elements. Devang Patel2009-09-02
| | | | | | | | | Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80839 91177308-0d34-0410-b5e6-96231b3b80d8
* Free the constants that have no uses in ~LLVMContext.Torok Edwin2009-08-31
| | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80590 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some DOUTsChris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79821 91177308-0d34-0410-b5e6-96231b3b80d8
* Use standard LLVM-style headers.Owen Anderson2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79817 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead metadata.Devang Patel2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78651 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ConvertType to ConvertConstant to avoid a name conflict on llvm-gcc.Daniel Dunbar2009-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78596 91177308-0d34-0410-b5e6-96231b3b80d8
* g++ 4.0 doesn't have std::vector::data.Benjamin Kramer2009-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78579 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the MDNode uniquing to a ValueMap, at Devang's request.Owen Anderson2009-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78577 91177308-0d34-0410-b5e6-96231b3b80d8
* It helps if I remember to actually add the file...Owen Anderson2009-08-04
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78116 91177308-0d34-0410-b5e6-96231b3b80d8