Commit Graph

39 Commits

Author SHA1 Message Date
Sanjiv Gupta
0b8f418488 Add a -t="dir" option to the driver. This can be used to specify the directory to be used as TempDir if somebody doesn't want to use the standard /tmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 08:23:38 +00:00
Mikhail Glushenkov
6620ec1928 s/llvmc2/llvmc/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 16:09:05 +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
583cf31973 Move the driver entry point out of Main.inc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 00:15:24 +00:00
Mikhail Glushenkov
95c1f5ba64 Make dynamic LLVMC plugins work on Windows (finally!).
Implemented by making lib/CompilerDriver a shared library that holds all the
global static data (CommandLine options, plugin registry) that we unfortunately
have to live with.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74417 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-29 03:09:15 +00:00
Mikhail Glushenkov
7defa2d3d5 Make -save-temps behave like in GCC 4.5.
The -save-temps option now behaves like described in GCC 4.5 release notes
(you can specify output directory for temporary files with -save-temps=obj
-o $DIRNAME). I do not have GCC 4.5 installed, so if there are any
inconsistencies between llvmc and GCC in the implementation of this
feature, please let me know.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-25 18:20:10 +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
06509db630 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-23 20:46:00 +00:00
Mikhail Glushenkov
d50d32b940 -write-graph now can be used with -o.
Makes it possible to set the output file name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67835 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-27 12:57:14 +00:00
Mikhail Glushenkov
0acf6b00f3 Remove some duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 20:18:46 +00:00
Mikhail Glushenkov
95e2aa8967 Move code from Main.cpp to the include dir.
User drivers based on llvmc must all share the initialization code.
Putting main() into libCompilerDriver is not a very good idea IMO (and ld gave
me some strange EH-related error anyway).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 09:03:02 +00:00
Mikhail Glushenkov
bd21c83d64 Cosmetic fixes: include guards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 09:02:28 +00:00
Mikhail Glushenkov
41f36f456b Plugin::Priority() doesn't need to be pure virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 09:02:01 +00:00
Mikhail Glushenkov
f5178ce144 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 09:01:39 +00:00
Mikhail Glushenkov
f188178a2f Reorganize llvmc code.
Move the code from 'llvmc/driver' into a new CompilerDriver library, and change
the build system accordingly. Makes it easier for projects using LLVM to build
their own llvmc-based drivers.

Tested with objdir != srcdir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 09:01:14 +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
f8c430b3da Add a --check-graph option to llvmc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61989 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 16:16:27 +00:00
Dan Gohman
d68a07650c Tidy up #includes, deleting a bunch of unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:59:02 +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
de1e521648 Merge Base.td and Tools.td.
This stuff is not used outside Base.td, and with the conversion of the
compilation graph to string-based format became much less (if at all)
useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 10:38:06 +00:00
Mikhail Glushenkov
74bcb057c0 Support -emit-llvm properly (with -S and -c).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60764 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 14:40: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
940cdfe697 Plugin updates: support more options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60666 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 16:46:23 +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
Mikhail Glushenkov
739c720e66 Add 'hidden' and 'really_hidden' option properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60198 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 00:13:25 +00:00
Mikhail Glushenkov
7e6d70a425 Disallow multiple edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 22:59:45 +00:00
Mikhail Glushenkov
1f1fab8c91 Fix the -I option (llvmc -I dir1 -I dir2 didn't work).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 10:57:31 +00:00
Mikhail Glushenkov
8b4c5f5d26 Refactor Tools.td to remove repetition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 10:56:56 +00:00
Mikhail Glushenkov
d91487785f Make -fsyntax-only, -include and -emit-llvm work for C++ and Objective-C/C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60047 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 21:35:20 +00:00
Daniel Dunbar
911cfdb7d7 LLVMC2: -emit-llvm stops compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 04:15:56 +00:00
Daniel Dunbar
ff6477b720 LLVMC2: Teach llvm_gcc_c tool about -include and -fsyntax-only.
- Only focusing on llvm_gcc_c for now, eventually this needs to be
   refactored so it can be shared via all the gcc-like tools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 02:59:00 +00:00
Mikhail Glushenkov
35fde15059 Support dependencies between plugins by priority-sorting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 17:30:25 +00:00
Mikhail Glushenkov
010887765a 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59447 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 17:29:18 +00:00
Daniel Dunbar
77e0c85dcc Add LLVMC2 tool definitions for Objective-C and Objective-C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 03:25:47 +00:00
Mikhail Glushenkov
e4a5ea3130 Build system tweaks to make it more convenient for the plugin authors.
Plugins can be now compiled in with a slight Makefile change.
For example, to compile the new Clang driver, use:

cd $LLVMC2_DIR
make TOOLNAME=ccc2 BUILTIN_PLUGINS=Clang

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 21:15:05 +00:00
Dale Johannesen
869aed7d83 Remove silly semicolon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56481 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 23:28:18 +00:00
Dale Johannesen
2165e1288e Remove a compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56478 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 22:33:34 +00:00
Mikhail Glushenkov
14ef05937f Convert llvmc2 plugins to use llvm/Support/Registry.h machinery.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56467 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:51:19 +00:00
Mikhail Glushenkov
4a1a77c1c9 Move llvmc2 header files under include/llvm/CompilerDriver
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 20:50:40 +00:00