Commit Graph

66 Commits

Author SHA1 Message Date
Owen Anderson 6c18d1aac0 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
Dan Gohman 38d773376a Move ValueMapTest from ADT to VMCore so that ADT doesn't need
to link in "core".

llvm-svn: 114831
2010-09-27 15:50:08 +00:00
Owen Anderson a7aed18624 Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson bda59bd247 Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson 755aceb5d0 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
Oscar Fuentes 40b31ad3ee Prefix `next' iterator operation with `llvm::'.
Fixes potential ambiguity problems on VS 2010.

Patch by nobled!

llvm-svn: 110029
2010-08-02 06:00:15 +00:00
Dan Gohman 2637cc1a38 Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.

llvm-svn: 109061
2010-07-21 23:38:33 +00:00
Chris Lattner 3c93d12916 unit test to go along with r108610
llvm-svn: 108611
2010-07-17 06:14:03 +00:00
Chandler Carruth bc3e8a7c93 Switch from EXPECT_EQ({true,false, ...) to the more canonical
EXPECT_{TRUE,FALSE}(...) macros. This also prevents suprious warnings about
bool-to-pointer conversion that occurs withit EXPECT_EQ.

llvm-svn: 108248
2010-07-13 17:28:05 +00:00
Chris Lattner 4422d31b84 introduce a new CallGraphSCC class, and pass it around
to CallGraphSCCPass's instead of passing around a
std::vector<CallGraphNode*>.  No functionality change,
but now we have a much tidier interface.

llvm-svn: 101558
2010-04-16 22:42:17 +00:00
Gabor Greif a9d0ef1e45 another one
llvm-svn: 98850
2010-03-18 18:59:08 +00:00
Gabor Greif 6221720599 feedback from Nick
llvm-svn: 98761
2010-03-17 19:27:31 +00:00
Gabor Greif e52f398e3e more BranchInst tests
llvm-svn: 98634
2010-03-16 15:53:58 +00:00
Gabor Greif c377afce8e add BranchInst tests
llvm-svn: 98632
2010-03-16 15:26:09 +00:00
Gabor Greif 421dd12853 appease valgrind testers
llvm-svn: 98628
2010-03-16 12:32:03 +00:00
Gabor Greif 86ca5493f7 add single return tests
llvm-svn: 98625
2010-03-16 11:24:53 +00:00
Gabor Greif 35a9b8baeb fix PR6589
adjusted unittest

I have added some doxygen to OptionalOperandTraits,
so hopefully there will be no confusion in the future.

Incidentally OptionalOperandTraits is not used any more (IIUC),
but the obvious client would be BranchInstr, and I plan
to rearrange it that way.

llvm-svn: 98624
2010-03-16 10:59:48 +00:00
Gabor Greif 155803840b begin humbly with a repro of PR6589
llvm-svn: 98623
2010-03-16 09:55:46 +00:00
Jeffrey Yasskin 61e710c2fd Remove the last memory leak from the VMCore unit tests.
Tested: valgrind --leak-check=full unittests/VMCore/Debug/VMCoreTests
llvm-svn: 98414
2010-03-13 02:15:08 +00:00
Jeffrey Yasskin 3d73d1a73c Remove a memory leak from MetadataTest.
Tested: valgrind --leak-check=full unittests/VMCore/Debug/VMCoreTests
llvm-svn: 98412
2010-03-13 01:39:20 +00:00
Jeffrey Yasskin 5a952b1339 Remove a memory leak from VerifierTest.
Tested: valgrind --leak-check=full unittests/VMCore/Debug/VMCoreTests
llvm-svn: 98411
2010-03-13 01:34:56 +00:00
Jeffrey Yasskin bd8a759589 Stop leaking MDStrings.
llvm-svn: 97763
2010-03-04 23:24:19 +00:00
Nick Lewycky 1d9a8159df Teach the verifier to check the condition on a branch and ensure that it has
'i1' type.

llvm-svn: 96282
2010-02-15 22:09:09 +00:00
Jeffrey Yasskin c660b23075 Fix some of the memcheck errors found in the JIT unittests.
llvm-svn: 95856
2010-02-11 06:41:30 +00:00
Jeffrey Yasskin 6d7deae2df Roll r94484 (avoiding RTTI problems in tests) forward again in a way that isn't
broken by setting CXXFLAGS on the command line.

llvm-svn: 94619
2010-01-26 23:30:46 +00:00
Bob Wilson 9c71bb03f3 Revert 94484. Re-disable unittests that need RTTI.
llvm-svn: 94569
2010-01-26 19:04:37 +00:00
Jeffrey Yasskin 9f4d96ccc7 Re-enable unit tests disabled in r94164 by telling GTest about the
lack of RTTI.

llvm-svn: 94484
2010-01-26 01:26:46 +00:00
Chris Lattner 7ba0661f27 Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Devang Patel e307348325 NamedMDNode is a collection MDNodes.
llvm-svn: 92761
2010-01-05 20:41:31 +00:00
Chris Lattner 1e6e36785e don't unittest mdnode printing, we have disassembler tests for this.
llvm-svn: 92328
2009-12-31 02:12:13 +00:00
Chris Lattner 9b493028df rename "elements" of metadata to "operands". "Elements" are
things that occur in types.  "operands" are things that occur
in values.

llvm-svn: 92322
2009-12-31 01:22:29 +00:00
Jeffrey Yasskin 28f244863e 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 26a7ae4fba Type.h doesn't need to #include LLVMContext.h
llvm-svn: 85254
2009-10-27 17:08:31 +00:00
Daniel Dunbar 8feee907e4 Update unittests for MDNode uniquing disable.
llvm-svn: 81142
2009-09-07 04:19:02 +00:00
Devang Patel f7188325ef 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 c180029be4 Revert 80839 for now. It causes test failures.
llvm-svn: 80841
2009-09-02 21:49:26 +00:00
Devang Patel 36309cd391 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 34455c9c65 Disable uniqueness test for now.
llvm-svn: 80741
2009-09-02 00:16:33 +00:00
Chris Lattner b1c3df239d update unit test for previous change.
llvm-svn: 80528
2009-08-31 00:28:46 +00:00
Chris Lattner be354a66d3 upgrade for removed functions.
llvm-svn: 79822
2009-08-23 04:47:35 +00:00
Owen Anderson 55f1c09e31 Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Owen Anderson 2358732164 Fix unit tests.
llvm-svn: 77734
2009-07-31 21:38:10 +00:00
Owen Anderson b292b8ce70 Move more code back to 2.5 APIs.
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Benjamin Kramer 5656e4fcd3 fix a unitialized pointer in NamedMDNode (and reenable unittest)
llvm-svn: 77597
2009-07-30 15:35:55 +00:00
Daniel Dunbar 54914e2b3a Disable the NamedMDNodeTest, it is failing everywhere.
llvm-svn: 77569
2009-07-30 02:08:27 +00:00
Devang Patel 0924b33a1e Add NamedMDNode test.
llvm-svn: 77550
2009-07-30 00:03:41 +00:00
Benjamin Kramer 9a59b2a21d Update unittest for LLVM API change.
llvm-svn: 77496
2009-07-29 19:18:13 +00:00
Benjamin Kramer 28983a4cf6 fix unittest
llvm-svn: 77375
2009-07-28 22:03:24 +00:00
Daniel Dunbar d43b86d4a4 Finish migrating VMCore to StringRef/Twine based APIs.
llvm-svn: 77051
2009-07-25 06:02:13 +00:00
Owen Anderson edb4a70325 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
llvm-svn: 77011
2009-07-24 23:12:02 +00:00