Michael J. Spencer
d5ec932c3a
Merge System into Support.
...
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Owen Anderson
9e9ae1b048
Attempt to fix valgrind complaining about (benign) leaks in pass registration by having PassRegistry
...
delete PassInfo objects that were created using new-style initialization.
llvm-svn: 116959
2010-10-20 22:22:30 +00:00
Owen Anderson
933c8cc6ed
Remove extraneous slash.
...
llvm-svn: 116851
2010-10-19 19:54:48 +00:00
Owen Anderson
65610b8589
Factor out the call-once implementation into its own macro.
...
llvm-svn: 116832
2010-10-19 18:02:06 +00:00
Owen Anderson
46990c17f7
Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
...
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.
Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.
I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.
llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Owen Anderson
467d56737b
Try again at implementing thread-safe lazy pass initialization, without depending on static local initialization
...
being threadsafe AND ensuring that initialization is complete by the time the initializeFooPass method returns.
llvm-svn: 116492
2010-10-14 17:59:03 +00:00
Owen Anderson
5114ec184e
Revert r116489. It included some changes I didn't intend to commit, and broke the buildbots.
...
llvm-svn: 116491
2010-10-14 17:36:50 +00:00
Owen Anderson
2928dbea72
Apparently MSVC doesn't support thread-safe static local initialization. Roll our own solution instead.
...
llvm-svn: 116489
2010-10-14 17:26:06 +00:00
Owen Anderson
2ea9b016d8
Conversely, Analysis-implementations do NOT need to initialize the AnalysisGroup. It will only matter when
...
someone tries to require that AG, in which case it is the requester's responsibility to initialize it.
llvm-svn: 116442
2010-10-13 21:55:07 +00:00
Owen Anderson
c65395a991
Analysis groups need to initialize their default implementations.
...
llvm-svn: 116441
2010-10-13 21:49:58 +00:00
Owen Anderson
63b480c711
Take advantage of C++'s thread-safe static local initialization to simplify thread-safe pass initialization.
...
llvm-svn: 116426
2010-10-13 20:24:34 +00:00
Owen Anderson
63f757463c
Begin adding static dependence information to passes, which will allow us to
...
perform initialization without static constructors AND without explicit initialization
by the client. For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve. I hope to be able to relax
the latter requirement in the future.
llvm-svn: 116334
2010-10-12 19:48:12 +00:00
Owen Anderson
69cbf2e8b7
Now with fewer extraneous semicolons!
...
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Owen Anderson
a8a7bf484f
Move the pass initialization helper functions into the llvm namespace, and add
...
a header declaring them all. This is also where we will declare per-library pass-set
initializer functions down the road.
llvm-svn: 115900
2010-10-07 04:13:08 +00:00
Owen Anderson
2a670815f6
Hide analysis group registration behind a macro, just like pass registration.
...
llvm-svn: 115835
2010-10-06 21:02:27 +00:00
Owen Anderson
123f4e5c19
Pass initialization functions should take a PassRegistry as a parameter
...
rather than being fixed to the global registry.
llvm-svn: 115824
2010-10-06 20:07:03 +00:00
Owen Anderson
38e84dd7ea
Another step towards getting rid of static ctors for pass registration: have INITIALIZE_PASS AND INITIALIZE_AG_PASS
...
expand to an initializeMyPass() function (in additional to the extant static ctors). Eventually, these will be called
from a big InitializeAllPasses() function, and the PassInfo's they create (which would be leaked if this code were used
at the moment) will be handed off to a PassRegistry for ownership.
llvm-svn: 115703
2010-10-05 22:58:16 +00:00
Owen Anderson
e15120e561
Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
...
and exposing internal details.
llvm-svn: 113252
2010-09-07 19:16:25 +00:00
Dan Gohman
1d48a4b1d7
Tidy some #includes and forward-declarations, and move the C binding code
...
out of PassManager.cpp and into Core.cpp with the rest of the C binding code.
llvm-svn: 110494
2010-08-07 00:43:20 +00:00
Rafael Espindola
2145c31de3
Some cleanup. Use a class (OptionInfo) instead of a pair of a pair and remove
...
some default values that are not used.
llvm-svn: 110485
2010-08-06 23:03:52 +00:00
Owen Anderson
f2fea95f2f
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca
Revert r110396 to fix buildbots.
...
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
...
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Owen Anderson
b36d01c1b6
Add INSTANTIATE_AG_PASS, which combines RegisterPass<> with RegisterAnalysisGroup<> for pass registration.
...
llvm-svn: 109058
2010-07-21 23:07:00 +00:00
Owen Anderson
e8e8b5a744
Add the INITIALIZE_PASS macro.
...
llvm-svn: 109034
2010-07-21 20:46:41 +00:00
Owen Anderson
6265d52037
Move the handling of PassRegistrationListener's to PassRegistry.
...
llvm-svn: 108966
2010-07-20 23:41:56 +00:00
Owen Anderson
e5f3371961
Pull out r108755. After offline discussion with Chris, we're going to go a different direction with this.
...
llvm-svn: 108856
2010-07-20 16:55:05 +00:00
Owen Anderson
5f218b8612
Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch
...
would cause them to fail the way they are, but none of the other intervening patches seem likely either.
llvm-svn: 108818
2010-07-20 08:26:15 +00:00
Owen Anderson
cf625d0179
Reapply r108794, a fix for the failing test from last time.
...
llvm-svn: 108813
2010-07-20 06:52:42 +00:00
Daniel Dunbar
3280e3aebf
Revert r108794, "Separate PassInfo into two classes: a constructor-free
...
superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is
breaking teh everything.
llvm-svn: 108805
2010-07-20 03:06:07 +00:00
Owen Anderson
3502f9a91b
Separate PassInfo into two classes: a constructor-free superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).
...
llvm-svn: 108794
2010-07-20 01:19:58 +00:00
Owen Anderson
522ef60c01
Change the implemented interfaces list on PassInfo from a std::vector to a manually implemented
...
linked list. This is a little slower and involves more malloc'ing, but these lists are
typically short, and it allows PassInfo to be entirely constant initializable.
llvm-svn: 108755
2010-07-19 21:44:48 +00:00
Dan Gohman
745765d0b8
Move several non-performance-critical member functinos out of line.
...
llvm-svn: 106444
2010-06-21 18:46:45 +00:00
Chris Lattner
86ab039320
add a helper method.
...
llvm-svn: 94012
2010-01-20 19:25:45 +00:00
Daniel Dunbar
65c6507ca8
Add required #includes for freestanding .h files.
...
llvm-svn: 84302
2009-10-17 03:28:07 +00:00
Dan Gohman
e5f1c4a5c2
Remove some unused fields.
...
llvm-svn: 80450
2009-08-29 23:34:14 +00:00
Gabor Greif
267542aaa5
remove a deprecated interface that was pretty useless
...
llvm-svn: 65842
2009-03-02 12:42:07 +00:00
Gabor Greif
f30dc30eea
fix typo
...
llvm-svn: 65839
2009-03-02 12:10:56 +00:00
Dan Gohman
12c7695dcf
Correct a comment.
...
llvm-svn: 52683
2008-06-24 17:46:48 +00:00
Bill Wendling
1866fa680f
Remove warnings about unused parameters and shadowed variables.
...
llvm-svn: 51266
2008-05-19 20:15:12 +00:00
Dan Gohman
75c583173c
Make PassInfo noncopyable.
...
llvm-svn: 51085
2008-05-14 00:39:39 +00:00
Dan Gohman
138a53b303
Change class' public PassInfo variables to by initialized with the
...
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.
Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.
llvm-svn: 51022
2008-05-13 02:05:11 +00:00
Dan Gohman
a84b75df17
Remove uses of llvm/System/IncludeFile.h that are no longer needed.
...
llvm-svn: 50695
2008-05-06 01:32:53 +00:00
Devang Patel
5e8cbbea65
PassInfo keep tracks whether a pass is an analysis pass or not.
...
llvm-svn: 48554
2008-03-19 21:56:59 +00:00
Dan Gohman
522401f26e
Add explicit keywords.
...
llvm-svn: 46506
2008-01-29 11:36:12 +00:00
Chris Lattner
e0b1ee937a
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change. Boy are my fingers tired. ;-)
llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Chris Lattner
e047abe2b4
update comment.
...
llvm-svn: 43128
2007-10-18 16:10:17 +00:00
Reid Spencer
8c5c7c8453
Change casts from old style to new style. This helps document the details
...
better, gives the compiler a chance to validate the cast and reduces warnings
if the user turns on -Wold-style-cast option.
llvm-svn: 41033
2007-08-12 08:12:35 +00:00
Devang Patel
32786f1037
Re-install patch to enable use of PassID.
...
I am preparing another patch to address the failure that prompted
Chris to revert this patch earlier.
llvm-svn: 36649
2007-05-02 20:38:25 +00:00
Chris Lattner
055c13234b
revert enough of devang's recent patches to get the tree basically working again
...
llvm-svn: 36638
2007-05-02 04:25:31 +00:00