Commit Graph

106 Commits

Author SHA1 Message Date
Mikhail Glushenkov
e4ac23a0ff Validate the generated C++ code in llvmc tests.
Checks that the code generated by 'tblgen --emit-llvmc' can be actually
compiled. Also fixes two bugs found in this way:

- forward_transformed_value didn't work with non-list arguments
- cl::ZeroOrOne is now called cl::Optional

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:04:52 +00:00
Mikhail Glushenkov
abf2d986c9 Allow $CALL(Hook, '$INFILE') for non-join tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:04:02 +00:00
Mikhail Glushenkov
bc39a795f4 Simplify a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:16:13 +00:00
Mikhail Glushenkov
06d266170b Throw 'const char*' instead of 'std::string'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:15:57 +00:00
Mikhail Glushenkov
5b9b3ba2ba Deprecate 'unpack_values'.
Use 'forward_values' + 'comma_separated' instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:25:54 +00:00
Mikhail Glushenkov
8245a1dd53 Implement 'forward_value' and 'forward_transformed_value'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 17:03:05 +00:00
Mikhail Glushenkov
632eb20c34 Refactoring, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 10:51:55 +00:00
Mikhail Glushenkov
97955005b3 Forward -save-temps to llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90214 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 06:51:30 +00:00
Chris Lattner
ec8e1b709e mark some constant global const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 18:30:31 +00:00
Mikhail Glushenkov
d5a72d9642 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 09:02:49 +00:00
Mikhail Glushenkov
b6c3483905 Make 'unset_option' work on list options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 04:15:07 +00:00
Mikhail Glushenkov
4858a1d51e Implement any_[not_]empty and list versions of switch_on and [not_]empty.
Useful for OptionPreprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 02:13:13 +00:00
Mikhail Glushenkov
ccef6dec0c More refactoring...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:24:28 +00:00
Mikhail Glushenkov
4d21ae7cf4 Refactoring, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 22:51:30 +00:00
Mikhail Glushenkov
0a22fb6664 First draft of the OptionPreprocessor.
More to follow...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:09:29 +00:00
Mikhail Glushenkov
2cea7bdef9 Disallow multiple instances of PluginPriority.
Several instances of PluginPriority in a single file most probably signifies a
programming error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:08:30 +00:00
Mikhail Glushenkov
0b599391f8 Omit the 'out_file_index != -1' check when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 05:45:21 +00:00
Mikhail Glushenkov
39482dde66 Input files should go before all other options.
Important, for example, when calling 'gcc a.o b.o c.o -lD -lE -lF'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 04:40:08 +00:00
Mikhail Glushenkov
ad981bfbcc Add a way to query the number of input files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 01:16:42 +00:00
Mikhail Glushenkov
9d7a2dc284 A bit prettier formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 01:15:44 +00:00
Mikhail Glushenkov
f8349ac8b8 Use raw_ostream::indent instead of passing strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82456 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 15:53:44 +00:00
Mikhail Glushenkov
2d04ec5fe6 Distinguish between 'empty' and empty DAG marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 16:22:02 +00:00
Mikhail Glushenkov
684a8b0f10 Add a logical 'not' operator to llvmc's TableGen dialect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 16:21:38 +00:00
Chris Lattner
74382b7c69 Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.

This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
   for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
   clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
   instead.
4. Weans llvm-db off <iostream>

sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 22:45:37 +00:00
Mikhail Glushenkov
8fe4447a0f Add an 'init' option property.
Makes possible to provide default values for options defined in plugins (same as
cl::init).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74905 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 16:08:41 +00:00
Mikhail Glushenkov
cbc360d567 Refactoring.
Make isList(), isSwitch() and isParameter() member functions of
OptionDescription.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 16:08:11 +00:00
Mikhail Glushenkov
b797000820 Comment fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 16:07:36 +00:00
Daniel Dunbar
1a55180238 Replace std::iostreams with raw_ostream in TableGen.
- Sorry, I can't help myself.

 - No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-03 00:10:29 +00:00
Mikhail Glushenkov
7bba2333fb Better error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-25 18:21:34 +00:00
Mikhail Glushenkov
d80d8690af Make llvmc work again.
Chris recently broke llvmc with his Makefile changes (r75379). That patch made
the global change .o -> .a, which caused built-in llvmc plugins to stop working
since plugin initialization in llvmc is based on static variables not referenced
from the main executable. This patch implements auto-generated forced references
to the plugin libraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-23 20:46:48 +00:00
Mikhail Glushenkov
0cbb59089b A little bit nicer formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-23 20:45:31 +00:00
Mikhail Glushenkov
7c8deb3818 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-23 20:45:07 +00:00
Mikhail Glushenkov
e031e4bcb9 A better error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 04:54:23 +00:00
Mikhail Glushenkov
e89331b93d The 'forward_as' property did not use its second argument.
See PR4159 for details. Patch by Martin Nowack!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 01:41:19 +00:00
Mikhail Glushenkov
f868156820 Fix incorrect code generation with ENV.
See PR4157 for details. Patch by Martin Nowack!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70973 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 12:34:34 +00:00
Mikhail Glushenkov
0941b0f655 Add some assertions.
Fixes segfaults in some corner cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 00:22:35 +00:00
Mikhail Glushenkov
c52551dfa2 'append_cmd' should split its argument.
Makes '(append_cmd "-foo a b c")' work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65623 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-27 06:46:55 +00:00
Mikhail Glushenkov
57cd67f693 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 03:47:58 +00:00
Mikhail Glushenkov
19d3e82905 Add three new option properties.
Adds new option properties 'multi_val', 'one_or_more' and 'zero_or_one'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 03:47:20 +00:00
Mikhail Glushenkov
b6b514124d Change the hook API back to prevent memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 13:04:33 +00:00
Mikhail Glushenkov
a298bb7525 Allow hooks with arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 13:04:00 +00:00
Mikhail Glushenkov
65ee1e6ff4 Fix typo in error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61191 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 04:06:58 +00:00
Mikhail Glushenkov
5c2b6b26c9 Some enhancements for the 'case' expression.
Add (error) and (empty).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61117 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 02:47:01 +00:00
Mikhail Glushenkov
e1d44b59ee Put Edge* classes into anonymous namespace.
Prevents conflicts between plugins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60871 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 10:34:18 +00:00
Mikhail Glushenkov
b4ced5a3c4 Make 'extern' an option property.
Makes (forward) work better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 16:47:12 +00:00
Mikhail Glushenkov
ad889a7f88 Better error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60664 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 16:45:12 +00:00
Mikhail Glushenkov
15b71ba122 Re-apply Cedric's changes.
Use B instead of Beg (for consistency), but NodeA and NodeB instead of A
and B.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60663 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 16:44:47 +00:00
Mikhail Glushenkov
b59dbad710 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 16:42:47 +00:00
Mikhail Glushenkov
08509493e5 Add a (progn)-like construct for (actions). Implemented as a DAG list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60658 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 16:42:22 +00:00
Mikhail Glushenkov
f915253dfc Use (actions) instead of option properties, support external options.
Also includes a major refactoring. See documentation for more
information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60656 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 16:41:11 +00:00