Commit Graph

89 Commits

Author SHA1 Message Date
Mikhail Glushenkov
c82ce4a8a7 Plugin support for llvmc2 (a-la opt).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:49:34 +00:00
Mikhail Glushenkov
9ecd30c4a2 Add a 'Debugging' section to the documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:48:48 +00:00
Mikhail Glushenkov
0737651452 Make comments a little bit more clear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56463 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:48:22 +00:00
Mikhail Glushenkov
11a353a206 Get rid of GlobalLanguageMap. Global state is evil.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56462 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:47:46 +00:00
Mikhail Glushenkov
ac69f91e44 Rename our version of ccc to ccc2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:47:09 +00:00
Mikhail Glushenkov
d92f2e01fc Fix some comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:46:44 +00:00
Mikhail Glushenkov
fdee954623 Add a (forward_as) option property
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:46:19 +00:00
Mikhail Glushenkov
5ccf28f168 Delete the file llvmc2/doc/LLVMC-Enhancements.rst + some minor language/spelling fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:45:17 +00:00
Oscar Fuentes
3d01fc7de8 Initial support for the CMake build system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 01:08:49 +00:00
Mikhail Glushenkov
856e106d20 Make all help strings start in upper case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51788 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 21:14:10 +00:00
Mikhail Glushenkov
74a0c28fba Fix the -opt switch and add a test case for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 19:56:27 +00:00
Mikhail Glushenkov
18aac1c622 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 18:53:09 +00:00
Mikhail Glushenkov
7ef36069c8 Add a --dry-run option to llvmc2. Patch by Holger Schurig.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 18:48:52 +00:00
Mikhail Glushenkov
7329610dfa Add a --save-temps option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:29:17 +00:00
Mikhail Glushenkov
a7d0ae34fb Add a check for side effect-free options (specified only in the OptionList).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:28:37 +00:00
Mikhail Glushenkov
0ab8ac318f Documentation update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:28:00 +00:00
Mikhail Glushenkov
ed3ba406c7 Show argv[0] in error messages (like gcc).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51755 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:26:35 +00:00
Mikhail Glushenkov
e43228958c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:26:08 +00:00
Mikhail Glushenkov
270cae3bf8 Documentation update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51753 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:25:24 +00:00
Mikhail Glushenkov
5fe8475e3a A small optimization: use static char* array instead of StrVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51752 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:24:49 +00:00
Mikhail Glushenkov
92b8da75a1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51751 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:24:07 +00:00
Mikhail Glushenkov
6be4ffc7c3 Add support for option aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51749 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:22:52 +00:00
Mikhail Glushenkov
fb37f39111 Fix some headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:20:54 +00:00
Mikhail Glushenkov
2e73e851d8 New tests for the 'case' expression: not_empty, in_language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:19:52 +00:00
Mikhail Glushenkov
ef4160dff0 -E should print to stdout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51743 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:18:50 +00:00
Mikhail Glushenkov
ffcf3a1a69 Make it possible to have multiple input languages for a single tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51742 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:18:16 +00:00
Mikhail Glushenkov
aa3bb17fcc Rename StringVector to StrVector (to be consistent with LLVMCConfigurationEmitter.cpp).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51741 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:17:29 +00:00
Mikhail Glushenkov
35bca4116e Minor error message fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51740 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:16:59 +00:00
Mikhail Glushenkov
163dc1eaa8 Documentation and examples improvements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51739 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:16:32 +00:00
Mikhail Glushenkov
37f509a70c Do not generate empty 'if's for the output_suffix property.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51737 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:15:20 +00:00
Mikhail Glushenkov
cd0858e170 Update documentation, add examples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51736 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:14:42 +00:00
Mikhail Glushenkov
1e4bab2c02 Rename LLVMC-Tutorial.rst to LLVMC-Reference.rst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51735 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:14:01 +00:00
Mikhail Glushenkov
5c7578de08 Make it possible to change the output file suffix based on command-line options.
For instance, the following command:

    llvmc2 -E hello.c

now generates a file with the correct suffix (hello.i).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51733 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:13:02 +00:00
Mikhail Glushenkov
08bd2e74dc Add support for user-provided hooks and environment variable reads to the cmd_line tool property.
Used like this: (cmd_line "$CALL(MyHook) --option -o $ENV(VARIABLE) $CALL(AnotherHook)")
Also works with case expressions.

Hook declarations are auto-generated, the definitions should be provided by the user
(just drop a .cpp file in the tools/llvmc2 directory).

Hooks should live in the "hooks" namespace and have type std::string hooks::Hook(void).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51732 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:12:24 +00:00
Mikhail Glushenkov
4eaa389519 Enable the response file ('llvmc @file') support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51731 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:11:45 +00:00
Mikhail Glushenkov
706aecf98e Update the code to the fact that StringSet now lives in llvm/ADT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:11:18 +00:00
Mikhail Glushenkov
b5ccfbf0a9 Make it possible to use the generalised 'case' construct in the cmd_line property.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51728 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:10:19 +00:00
Mikhail Glushenkov
e5557f4da4 Add a generalised 'case' construct.
Besides assigning edge weights, it will also be used by the cmd_line tool property.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51727 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:08:50 +00:00
Anton Korobeynikov
43d1fd449f For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 17:41:17 +00:00
Mikhail Glushenkov
5c98d824f6 Filter option names to escape symbols not allowed as C++ identifiers.
Makes it possible to use options with names like "Wa,".
Also fixes the -Wall option handling as a side-effect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50973 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 16:33:06 +00:00
Mikhail Glushenkov
ecb977e64f Make it possible to choose between different compilation graph definitions at compile-time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50972 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 16:32:24 +00:00
Mikhail Glushenkov
a673037097 Fix some error messages; Make LLVMC pass through the exit code of a failed tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50971 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 16:31:42 +00:00
Mikhail Glushenkov
910fd57533 Rename Example.td to Graph.td.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 19:11:28 +00:00
Mikhail Glushenkov
8e7254cd44 Reapply 50867: A small refactoring (extract method) + some comment fixes.
Fixed the build breakage, sorry for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 08:27:26 +00:00
Tanya Lattner
0561f78a14 Revertin 50867 since it was breaking the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50871 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 21:54:20 +00:00
Mikhail Glushenkov
194a78f149 Add -E and -S options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 20:02:36 +00:00
Mikhail Glushenkov
21607fa63c A small refactoring (extract method) + some comment fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 20:02:03 +00:00
Mikhail Glushenkov
4561ab5d81 Use Doxygen-style comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50833 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 21:50:19 +00:00
Mikhail Glushenkov
e0ff9ae91e Change from llvm::SmallSet<std::string> to llvm::StringMap<char>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:18:58 +00:00
Mikhail Glushenkov
29063554d0 Add new edge property combinator: weight.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50765 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:18:20 +00:00