Chris Lattner
b7a7cb37b6
give LLVMContext an inline asm diagnostic hook member.
...
llvm-svn: 100506
2010-04-06 00:44:45 +00:00
Chris Lattner
b19f7964ea
Add a new "NewDebugLoc" class which will eventually replace DebugLoc,
...
and will replace the 'DbgInfo' member in Instruction.
The benefit of NewDebugLoc is that it is compact (8 bytes vs 12/24
bytes for the DbgInfo member in Instruction on a 32/64 bit system),
it means that we will end up not having to allocate MDNodes to
represent the "DILocations" in common cases of -O0 -g, and it is
much more efficient to get things out of than the MDNode.
llvm-svn: 100072
2010-04-01 00:37:44 +00:00
Jeffrey Yasskin
f4aab98729
Re-add the Metadata.h include to LLVMContextImpl.h so that MDNode is complete
...
where FoldingSet<MDNode> is instantiated. Clang and MSVC complain; gcc
doesn't.
llvm-svn: 99147
2010-03-21 22:08:41 +00:00
Jeffrey Yasskin
98a4091e4a
Move the LLVMContextImpl implementation into a .cpp file.
...
llvm-svn: 99146
2010-03-21 21:17:34 +00:00
Jeffrey Yasskin
50a0593887
Memoize InlineAsms into the LLVMContext and delete them on shutdown.
...
Fixes PR803.
llvm-svn: 99143
2010-03-21 20:37:19 +00:00
Jeffrey Yasskin
819ce89d8f
Delete MDNodes when LLVMContext is destroyed. Previous attempts: r97918, r97788.
...
Tested: clang debug bootstrap, llvm-gcc bootstrap, `make check-lit`
after configuring with --with-llvmgccdir (and this did run the
FrontendC* tests this time)
llvm-svn: 98410
2010-03-13 01:26:15 +00:00
Jeffrey Yasskin
82f0356671
Roll back r97918 again. Just configuring against llvm-gcc wasn't enough to run
...
the FrontendC* tests. :(
llvm-svn: 97921
2010-03-07 19:26:40 +00:00
Jeffrey Yasskin
daae74ff0d
Reapply r97788 to free MDNodes when the LLVMContext is destroyed. It
...
bootstraps llvm-gcc this time.
llvm-svn: 97918
2010-03-07 18:46:57 +00:00
Jeffrey Yasskin
ec7d47ec83
Revert r97788 because it broke test/FrontendC/2010-02-16-DbgVarScope.c.
...
llvm-svn: 97792
2010-03-05 06:43:49 +00:00
Jeffrey Yasskin
a526081ebf
Free MDNodes when the LLVMContext is destroyed. Leak found by Valgrind.
...
llvm-svn: 97788
2010-03-05 05:47:09 +00:00
Jeffrey Yasskin
5bdd4796e4
Stop leaking MDStrings.
...
llvm-svn: 97763
2010-03-04 23:24:19 +00:00
Devang Patel
5c67cb332e
Destroy MDNodes gracefully while deleting llvm context.
...
llvm-svn: 96609
2010-02-18 20:53:16 +00:00
Chris Lattner
2265d6280b
Add support for a union type in LLVM IR. Patch by Talin!
...
llvm-svn: 96011
2010-02-12 20:49:41 +00:00
Devang Patel
c83d8c3ccf
revert 95903.
...
llvm-svn: 95918
2010-02-11 20:58:56 +00:00
Devang Patel
b41ff23af9
Destroy MDNodes while destructing llvm context.
...
llvm-svn: 95903
2010-02-11 19:35:10 +00:00
Jeffrey Yasskin
ad23983452
Fix some of the memcheck errors found in the JIT unittests.
...
llvm-svn: 95856
2010-02-11 06:41:30 +00:00
Chris Lattner
84e9de4a58
Final step in the metadata API restructuring: move the
...
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.
llvm-svn: 92259
2009-12-29 09:01:33 +00:00
Jeffrey Yasskin
9afe974318
This fixes a memory leak in OpaqueType found by Google's internal heapchecker.
...
llvm-svn: 91611
2009-12-17 19:55:06 +00:00
Chris Lattner
587962c667
Remove isPod() from DenseMapInfo, splitting it out to its own
...
isPodLike type trait. This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.
llvm-svn: 91421
2009-12-15 07:26:43 +00:00
Chris Lattner
ad2926bbb4
remove a bunch of locking from LLVMContextImpl. Since only one thread
...
can be banging on a context at a time, this isn't needed. Owen, please
review.
llvm-svn: 85728
2009-11-01 18:42:03 +00:00
Chris Lattner
28895dac5b
IR support for the new BlockAddress constant kind. This is
...
untested and there is no way to use it, next up: doing battle
with asmparser.
llvm-svn: 85349
2009-10-28 00:01:44 +00:00
Jeffrey Yasskin
173c58db88
Rename lib/VMCore/ConstantsContext.h:ValueMap<> to ConstantUniqueMap<> to avoid
...
colliding with llvm/ADT/ValueMap.h:ValueMap<>.
llvm-svn: 85344
2009-10-27 23:45:55 +00:00
Devang Patel
f9d56f4830
Derive metadata hierarchy from Value instead of User.
...
llvm-svn: 84801
2009-10-21 23:57:35 +00:00
Owen Anderson
fb4db70d0f
Banish ConstantsLock. It's serving no purpose other than slowing things down
...
at the moment.
llvm-svn: 84529
2009-10-19 20:11:52 +00:00
Devang Patel
1070b7a713
s/class Metadata/class MetadataContext/g
...
llvm-svn: 83019
2009-09-28 21:41:20 +00:00
Devang Patel
253aa4d192
Add llvm::Metadata to manage metadata used in a context.
...
This interface will be used to attach metadata with an instruction.
llvm-svn: 82060
2009-09-16 18:09:00 +00:00
Devang Patel
e55527b3f2
Fix whitespaces.
...
llvm-svn: 81468
2009-09-10 22:36:12 +00:00
Devang Patel
a12b2d35a0
Gracefully destroy MDNodes.
...
llvm-svn: 81353
2009-09-09 17:07:07 +00:00
Devang Patel
55eb4bffab
Remove dead code.
...
llvm-svn: 81235
2009-09-08 18:14:36 +00:00
Devang Patel
27616c3c80
Now Bitcode reader bug is fixed. Reapply 80839.
...
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
2009-09-03 01:39:20 +00:00
Devang Patel
317ab82083
Revert 80839 for now. It causes test failures.
...
llvm-svn: 80841
2009-09-02 21:49:26 +00:00
Devang Patel
c4be6559c4
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: 80839
2009-09-02 21:22:09 +00:00
Devang Patel
2d78fddeb4
For now disable MDNode uniquing. This fixes llvm-gcc bootstrap failure on certain Mac OS X 10.5. I am working on a proper fix.
...
llvm-svn: 80738
2009-09-01 23:56:42 +00:00
Torok Edwin
097a206969
Free the constants that have no uses in ~LLVMContext.
...
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
2009-08-31 16:14:59 +00:00
Dan Gohman
4af3f9b57d
Allocate the basic types inside the LLVMContextImpl instance,
...
rather than separately with new. Move the members above the
TypeMap members to avoid destruction order issues. This fixes
a leak of these objects, and eliminates an extra level of
indirection in Type::getInt32Ty and friends.
llvm-svn: 79997
2009-08-25 16:00:35 +00:00
Owen Anderson
95bdea8255
Use standard LLVM-style headers.
...
llvm-svn: 79817
2009-08-23 04:24:24 +00:00
Owen Anderson
9e0bb1bd44
Reapply my less-lock-contention-in-leak-detector patch, now with new files
...
actually added.
llvm-svn: 79429
2009-08-19 17:07:46 +00:00
Owen Anderson
bd652bf082
Revert my last patch temporarily.
...
llvm-svn: 79388
2009-08-19 00:52:13 +00:00
Owen Anderson
69a97af0b7
Privatize part of the leak detector mechanism, which turned out to be heavily contended
...
when trying to run opt in parallel. This lets parallel opt crunch 403.gcc in about a third
of the time.
llvm-svn: 79387
2009-08-19 00:37:02 +00:00
Owen Anderson
73825c1f37
Privatize the ValueHandle global map. Because this is used so heavily throughout the code base, locking all accesses to
...
it is not practical performance-wise.
llvm-svn: 79355
2009-08-18 18:28:58 +00:00
Owen Anderson
c7e733e4fe
Privatize the last bits of static type state.
...
llvm-svn: 79258
2009-08-17 17:59:35 +00:00
Owen Anderson
5d27af4989
Move the TypeMap lock to a member on LLVMContextImpl.
...
llvm-svn: 79256
2009-08-17 17:34:27 +00:00
Owen Anderson
dc11fe967d
Actually privatize a IntegerTypes, and fix a few bugs exposed by this.
...
llvm-svn: 78955
2009-08-13 23:27:32 +00:00
Benjamin Kramer
9a590500ea
Make LLVMContext and LLVMContextImpl classes instead of structs.
...
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Devang Patel
4609ecd4bd
Remove dead metadata.
...
llvm-svn: 78651
2009-08-11 06:31:57 +00:00
Devang Patel
d59b85298b
Remove MDNode from ValueMap when MDNode is destroyed.
...
llvm-svn: 78612
2009-08-10 22:59:46 +00:00
Devang Patel
7c51e1fb95
Rename MDNodeSet as MDNodes.
...
llvm-svn: 78607
2009-08-10 22:31:31 +00:00
Owen Anderson
4cd02c843b
Change the MDNode uniquing to a ValueMap, at Devang's request.
...
llvm-svn: 78577
2009-08-10 18:16:08 +00:00
Owen Anderson
3d0e1b855d
Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
...
llvm-svn: 78258
2009-08-05 23:16:16 +00:00
Owen Anderson
bfcf39cec6
Privatize the FunctionType table.
...
llvm-svn: 78221
2009-08-05 18:13:27 +00:00