Mikhail Glushenkov
c48ede23bd
Add some assertions.
...
Fixes segfaults in some corner cases.
llvm-svn: 69494
2009-04-19 00:22:35 +00:00
Mikhail Glushenkov
f6281fb47c
'append_cmd' should split its argument.
...
Makes '(append_cmd "-foo a b c")' work.
llvm-svn: 65623
2009-02-27 06:46:55 +00:00
Mikhail Glushenkov
02b47b5e7a
Typo.
...
llvm-svn: 63174
2009-01-28 03:47:58 +00:00
Mikhail Glushenkov
2115d09a10
Add three new option properties.
...
Adds new option properties 'multi_val', 'one_or_more' and 'zero_or_one'.
llvm-svn: 63172
2009-01-28 03:47:20 +00:00
Mikhail Glushenkov
fbc89cecad
Change the hook API back to prevent memory leaks.
...
llvm-svn: 62686
2009-01-21 13:04:33 +00:00
Mikhail Glushenkov
bf9716e15d
Allow hooks with arguments.
...
llvm-svn: 62685
2009-01-21 13:04:00 +00:00
Mikhail Glushenkov
cf029824e1
Fix typo in error message.
...
llvm-svn: 61191
2008-12-18 04:06:58 +00:00
Mikhail Glushenkov
5932d8c986
Some enhancements for the 'case' expression.
...
Add (error) and (empty).
llvm-svn: 61117
2008-12-17 02:47:01 +00:00
Mikhail Glushenkov
e30a2820f6
Put Edge* classes into anonymous namespace.
...
Prevents conflicts between plugins.
llvm-svn: 60871
2008-12-11 10:34:18 +00:00
Mikhail Glushenkov
7f1bef5a55
Make 'extern' an option property.
...
Makes (forward) work better.
llvm-svn: 60667
2008-12-07 16:47:12 +00:00
Mikhail Glushenkov
4cc945da6e
Better error message.
...
llvm-svn: 60664
2008-12-07 16:45:12 +00:00
Mikhail Glushenkov
395cb25ac7
Re-apply Cedric's changes.
...
Use B instead of Beg (for consistency), but NodeA and NodeB instead of A
and B.
llvm-svn: 60663
2008-12-07 16:44:47 +00:00
Mikhail Glushenkov
0d88271490
Try to guess when the auto-generated cl::Sink option should be marked 'extern'.
...
This would be much easier to do if the CommandLine library didn't use
global state. Global state is evil.
llvm-svn: 60659
2008-12-07 16:42:47 +00:00
Mikhail Glushenkov
35a46f808b
Add a (progn)-like construct for (actions). Implemented as a DAG list.
...
llvm-svn: 60658
2008-12-07 16:42:22 +00:00
Mikhail Glushenkov
85467c71d2
Use (actions) instead of option properties, support external options.
...
Also includes a major refactoring. See documentation for more
information.
llvm-svn: 60656
2008-12-07 16:41:11 +00:00
Cedric Venet
af333378c9
The use of the construct:
...
for(Type1 B = ...;;) { Type2 B ; ... }
is bad: code is hard to read and VS VS don't like it (it ignore the second declaration of B).
This patch fix the problem in tablegen. Please don't write code like this.
llvm-svn: 60590
2008-12-05 13:37:30 +00:00
Mikhail Glushenkov
cc2d0b2c4c
Support multiple compilation graph definitions. Not terribly useful, but makes the code more generic.
...
llvm-svn: 60199
2008-11-28 00:13:47 +00:00
Mikhail Glushenkov
3bb3da6f4c
Add 'hidden' and 'really_hidden' option properties.
...
llvm-svn: 60198
2008-11-28 00:13:25 +00:00
Mikhail Glushenkov
3ac10202c0
Small fix: the error message was incorrect in some cases.
...
llvm-svn: 60099
2008-11-26 10:55:45 +00:00
Mikhail Glushenkov
20313c954e
Support dependencies between plugins by priority-sorting.
...
llvm-svn: 59449
2008-11-17 17:30:25 +00:00
Mikhail Glushenkov
7549d568d5
Filter ToolPropertiesList to exclude all Tools not mentioned in the compilation graph.
...
llvm-svn: 59448
2008-11-17 17:29:42 +00:00
Mikhail Glushenkov
faae122e07
Add a layer of indirection to make plugins more flexible.
...
Use strings instead of TableGen defs in the compilation graph
definition. Makes it easier for the plugins to modify an existing graph.
llvm-svn: 59447
2008-11-17 17:29:18 +00:00
Mikhail Glushenkov
a2909684b6
Check the return value of std::getenv.
...
When constructing std::strings from C strings, we should check the input
value to be not NULL so that the std::string constructor does not
segfault.
Fixes #3047 .
llvm-svn: 59131
2008-11-12 12:41:18 +00:00
Mikhail Glushenkov
1cb041242f
Add a bit of lazy evaluation to PopulateCompilationGraph().
...
Only the tools that are mentioned in the compilation graph definition
are now inserted by PopulateCompilationGraph(). This should cut down
plugin loading time a little.
llvm-svn: 59097
2008-11-12 00:05:17 +00:00
Mikhail Glushenkov
c1e7dbb1f7
Some cosmetic changes.
...
llvm-svn: 59096
2008-11-12 00:04:46 +00:00
Mikhail Glushenkov
f5a294d08d
Allow $CALL and $ENV in command names. Fixes #3025 .
...
llvm-svn: 58922
2008-11-08 19:43:32 +00:00
Anton Korobeynikov
9278247502
Properly escape dashes in TableGen's LLVMC2 emitter.
...
Patch by Patrick Walton!
llvm-svn: 58901
2008-11-08 10:16:21 +00:00
Mikhail Glushenkov
53aa586844
Move llvmc2 header files under include/llvm/CompilerDriver
...
llvm-svn: 56466
2008-09-22 20:50:40 +00:00
Mikhail Glushenkov
47afe73081
Plugin support for llvmc2 (a-la opt).
...
llvm-svn: 56465
2008-09-22 20:49:34 +00:00
Mikhail Glushenkov
4825a0bb2f
Make comments a little bit more clear.
...
llvm-svn: 56463
2008-09-22 20:48:22 +00:00
Mikhail Glushenkov
8a2bdc74b2
Get rid of GlobalLanguageMap. Global state is evil.
...
llvm-svn: 56462
2008-09-22 20:47:46 +00:00
Mikhail Glushenkov
9c13f724fc
Add a (forward_as) option property
...
llvm-svn: 56459
2008-09-22 20:46:19 +00:00
Mikhail Glushenkov
b50080e6cb
Delete the file llvmc2/doc/LLVMC-Enhancements.rst + some minor language/spelling fixes.
...
llvm-svn: 56458
2008-09-22 20:45:17 +00:00
Chris Lattner
6449690da4
Add #includes required by GCC 4.3, thanks for Zhongxing Xu
...
for reporting this.
llvm-svn: 51926
2008-06-04 04:46:14 +00:00
Anton Korobeynikov
10d2f50826
Initialize members properly during construction
...
llvm-svn: 51841
2008-06-01 16:22:49 +00:00
Mikhail Glushenkov
f970edf9b7
Callback was not executed on OS X when it was a function.
...
llvm-svn: 51814
2008-05-31 13:43:21 +00:00
Mikhail Glushenkov
401f3d6eab
Add a check for side effect-free options (specified only in the OptionList).
...
llvm-svn: 51759
2008-05-30 06:28:37 +00:00
Mikhail Glushenkov
c03ce6071c
Refactoring: remove code duplication introduced in the previous patch.
...
llvm-svn: 51757
2008-05-30 06:27:29 +00:00
Mikhail Glushenkov
e8cee23f67
Refactoring: split CollectProperties into two separate function objects.
...
llvm-svn: 51756
2008-05-30 06:27:02 +00:00
Mikhail Glushenkov
b9b010eb09
New feature: OptionList.
...
It can be handy to have all information about options gathered in a single place
to provide an overview of all supported options. This patch allows the following:
def Options : OptionList<[
(switch_option "E", (help "Help string")),
(alias_option "quiet", "q")
...
]>;
Tool-specific option properties (like 'append_cmd') have (obviously) no meaning in
this context, so the only properties that are allowed are 'help' and 'required'.
See usage example in examples/Clang.td.
llvm-svn: 51754
2008-05-30 06:26:08 +00:00
Mikhail Glushenkov
c8bd3517d5
A small optimization: use static char* array instead of StrVector.
...
llvm-svn: 51752
2008-05-30 06:24:49 +00:00
Mikhail Glushenkov
bf14dd7dc3
Make it possible to test if the '-o' option is provided.
...
The following is now allowed:
(case (not_empty "o"), do_something, ...)
This didn't work previously because "-o" is built-in.
llvm-svn: 51751
2008-05-30 06:24:07 +00:00
Mikhail Glushenkov
f83f33e8d3
Fix: 'sink' handling was broken.
...
llvm-svn: 51750
2008-05-30 06:23:29 +00:00
Mikhail Glushenkov
b043663cf9
Add support for option aliases.
...
llvm-svn: 51749
2008-05-30 06:22:52 +00:00
Mikhail Glushenkov
bf1552d866
Allow nesting of case expressions.
...
The following is now legal:
(case (in_language "c"),
(case (switch_on "E"), "gcc -x c -E $INFILE", (default), "gcc -x c $INFILE"),
(default),
"gcc $INFILE $OUTFILE")
llvm-svn: 51748
2008-05-30 06:22:15 +00:00
Mikhail Glushenkov
d1a6a34cc5
Small error message improvement.
...
llvm-svn: 51747
2008-05-30 06:21:48 +00:00
Mikhail Glushenkov
763cc577b3
Remove RequireDefault parameter from EmitCaseConstructHandler.
...
There are now no situations when 'default' is required.
llvm-svn: 51746
2008-05-30 06:21:21 +00:00
Mikhail Glushenkov
5916ade717
Fix some headers.
...
llvm-svn: 51745
2008-05-30 06:20:54 +00:00
Mikhail Glushenkov
2f51489a62
New tests for the 'case' expression: not_empty, in_language.
...
llvm-svn: 51744
2008-05-30 06:19:52 +00:00
Mikhail Glushenkov
1f7a028929
Make it possible to have multiple input languages for a single tool.
...
llvm-svn: 51742
2008-05-30 06:18:16 +00:00