Commit Graph

129 Commits

Author SHA1 Message Date
Daniel Dunbar ad0d48d372 Fix test case (for -### printing version)
llvm-svn: 63223
2009-01-28 19:30:43 +00:00
Daniel Dunbar 36ccb30a35 ccc: Support -v; invent a version number for ccc for now, will be
shared with clang eventually.

llvm-svn: 63220
2009-01-28 19:26:20 +00:00
Daniel Dunbar f4a0cba545 ccc/Darwin/clang: Fix a mistranslation for the llvm-backend; llvm-gcc
doesn't set the relocation model when -mdynamic-no-pic is present.

llvm-svn: 63129
2009-01-27 20:42:58 +00:00
Daniel Dunbar 2ad3ff0bd6 ccc: Normalize machine name to i386 for platforms which report the
machine as x86_64.

llvm-svn: 63122
2009-01-27 19:29:51 +00:00
Daniel Dunbar a7ff032643 ccc: -o should not be automatically forwarded to generic gcc tools.
llvm-svn: 63015
2009-01-26 18:00:14 +00:00
Daniel Dunbar f3a06113c7 ccc: Recognize -emit-llvm [-S].
- Unlike llvm-gcc, this doesn't yet treat -emit-llvm output as a
   linker input.

llvm-svn: 63014
2009-01-26 17:09:15 +00:00
Daniel Dunbar 3d5d14ea15 ccc: Finish definition of long argument translations.
- However, these last ones do not actually work; the issue is that
   they translate to batches of options and need to be reparsed. For
   now we just give an unsupported error on them.

llvm-svn: 62872
2009-01-23 20:08:16 +00:00
Daniel Dunbar 505f751451 ccc: Another batch of long argument translations.
- Again turned up a few which don't do anything sensible.

llvm-svn: 62870
2009-01-23 19:40:54 +00:00
Daniel Dunbar 8fb96605f8 ccc: Implement long options which take joined & separate forms.
llvm-svn: 62841
2009-01-23 08:16:41 +00:00
Daniel Dunbar 8fa972a55b ccc: Support long ('--...') flag arguments.
- Curiously, a number of the current translations gcc does appear to
   be useless?

llvm-svn: 62831
2009-01-23 02:00:46 +00:00
Daniel Dunbar e2c430b317 ccc: Organize long options together.
llvm-svn: 62829
2009-01-23 01:31:44 +00:00
Daniel Dunbar eff67fa33b ccc: Add support for several more aliases (--ansi, --assemble,
--assert, --classpath).
 - Requires providing some option parameters to over-ride rendering in
   order to match gcc. There may be a cleaner way to do this (probably
   by introducing a new option type for long JoinedOrSeparate forms).

llvm-svn: 62825
2009-01-23 00:54:03 +00:00
Daniel Dunbar 58645d0285 ccc: Darwin/x86/link: Fix a few incompatibilities with gcc (missed
forwarding -s to linker, and was only taking last arg in some cases
when should have been taking all).

llvm-svn: 62824
2009-01-23 00:39:52 +00:00
Daniel Dunbar 4bb6a2fcd3 ccc: Add support for "alias" options.
- Unlike groups (which gather distinct but related options), aliases
   are for options like '--all-warnings' which are effectively treated
   like some other option ('-Wall') both in the driver logic and when
   passing to tools.

llvm-svn: 62820
2009-01-23 00:14:46 +00:00
Daniel Dunbar ccabd0f01a ccc: Fix typo; isn't dynamic typing fun!
llvm-svn: 62817
2009-01-23 00:04:43 +00:00
Daniel Dunbar 2e1cfd0267 ccc: Bug fix, driver logic was allowing child jobs to pipe output when
parent wasn't expecting it.

llvm-svn: 62811
2009-01-22 23:19:32 +00:00
Daniel Dunbar d89187696f ccc/clang: Mimic llvm-gcc initialization of LLVM backend based on gcc
options (for example, to set relocation model or enable unwind table generation).

llvm-svn: 62740
2009-01-22 01:55:46 +00:00
Daniel Dunbar d00bca3572 ccc: Handle a few long argument form (--) translations using option
groups, and fix misdeclaration of some -W options.

llvm-svn: 62702
2009-01-21 18:49:34 +00:00
Daniel Dunbar f2e3d81cb4 ccc: Add appropriate file search prefixes when on x86_64 Darwin, and
look for crt3.o appropriately.

llvm-svn: 62694
2009-01-21 17:18:19 +00:00
Daniel Dunbar a184754570 ccc: Implement file & path searching.
- Toolchain is responsible for providing list of prefixes to search.

 - Implement -print-file-name=xxx and -print-prog-name=xxx driver options.

llvm-svn: 62659
2009-01-21 02:03:52 +00:00
Daniel Dunbar 309052a84c ccc: Add --analyze test case.
llvm-svn: 62654
2009-01-21 01:22:37 +00:00
Daniel Dunbar 989ab477d2 ccc: Add --analyze driver mode (for running static analyzer).
- For now forces generation of plist files, need to think about the
   right interface.

 - Changed -fsyntax-only mode to be its own phase (more consistent).

 - Add -WA, for passing options verbatim to analyzer.

llvm-svn: 62649
2009-01-21 01:07:49 +00:00
Daniel Dunbar 47d16e53fe ccc: Unbreak -pipe handling broken in previous refactoring.
llvm-svn: 62637
2009-01-21 00:05:15 +00:00
Mike Stump c1b44ce610 Fix ccclib building when building in a separate build tree.
llvm-svn: 62621
2009-01-20 21:54:36 +00:00
Daniel Dunbar de46097847 ccc: Allow downstream tools to be aware of final output name.
- This is a hack to allow the Darwin linker to get -final_output when
   doing universal builds; the mechanism should be generalized.

 - Handle multiple redundant -arch arguments correctly.

 - Forward -arch_multiple and -final_output to gcc when necessary.

 - Simplified implementation of derived gcc tools.

llvm-svn: 62618
2009-01-20 21:29:14 +00:00
Daniel Dunbar 7966091399 ccc: Darwin/x86: Teach compile tool how to build .pch files. xcc is
now fully independent of the gcc driver when targetting Darwin/x86.

llvm-svn: 62570
2009-01-20 05:51:52 +00:00
Daniel Dunbar 8bc09f4085 ccc: PCH generation doesn't strip the path when generating a derived
filename from the input path.

llvm-svn: 62569
2009-01-20 05:49:32 +00:00
Daniel Dunbar 313e301574 ccc: Recognize that -M and -MM only run preprocessor.
- Clean up some placement of output args to match gcc more precisely
   (for testing).

llvm-svn: 62566
2009-01-20 01:53:54 +00:00
Daniel Dunbar 0c8d6c9d27 ccc: Darwin/x86: Add direct cpp support.
- Add Darwin_X86_CC1Tool which is shared by Darwin/x86/Compile and
   Darwin/x86/Preprocess tools.

 - Minor bug fixes (CmpDriver exit code, -x cpp-output handling, some
   linker argument translation).

llvm-svn: 62551
2009-01-20 00:47:24 +00:00
Daniel Dunbar 19e953acd9 Makefile isn't executable.
llvm-svn: 62523
2009-01-19 19:59:59 +00:00
Daniel Dunbar ababe7d47d ccc: Add missing file.
llvm-svn: 62520
2009-01-19 19:20:01 +00:00
Daniel Dunbar f6135630a8 ccc: Add installation of ccc; based on patch from Mike Stump.
- This doesn't follow normal installation procedure of python
   code, but no sense trying too hard since ccc will be moved to
   C++.

 - Entry point is now tools/ccc.

llvm-svn: 62517
2009-01-19 18:50:49 +00:00
Daniel Dunbar 6e2c6844c1 ccc: Bug fix, pch generation should not try to output on pipe and -E
should. This needs cleanup.

llvm-svn: 62473
2009-01-18 21:35:24 +00:00
Anders Carlsson c57acbc3af Fix a tyop
llvm-svn: 62453
2009-01-18 02:54:30 +00:00
Anders Carlsson d0e93db5ce Make CCC_ECHO output to stderr
llvm-svn: 62452
2009-01-18 02:54:17 +00:00
Anders Carlsson 178b767b9b Fix a runtime error I saw
llvm-svn: 62448
2009-01-18 02:19:54 +00:00
Daniel Dunbar 5f40dec258 ccc: Support running piped jobs (-pipe now works).
llvm-svn: 62396
2009-01-17 02:02:35 +00:00
Daniel Dunbar ee5a4a8cce ccc: Don't be pedantically compatible with -Z options, these are the
result of an internal implementation detail of gcc.

llvm-svn: 62389
2009-01-17 00:53:19 +00:00
Daniel Dunbar b3a633fc0c ccc: Clean up (user level) error handling.
- ccc now checks for existence of input files (more annoying to test,
   but matches gcc).
 - Fix some test cases.

llvm-svn: 62378
2009-01-16 23:12:12 +00:00
Daniel Dunbar c1a2043c5b ccc: Fix thinko, add gross but effective test of translation for Darwin/X86/cc1.
llvm-svn: 62360
2009-01-16 21:20:42 +00:00
Daniel Dunbar 245df5f4ac ccc: Darwin/X86: gcc compatibility, only add
'-feliminate-unused-debug-symbols' in reponse to '-g' (not '-g*').

llvm-svn: 62357
2009-01-16 21:07:21 +00:00
Daniel Dunbar 1e3677c907 ccc: Darwin/X86: Implement remainder of (non -Z...) generic argument
translation.
 - As is my general strategy, this is initially pedantically
   compatible with gcc and can be cleaned up later. So, for example,
   we still pass -static to collect2 4 times if you say '-mkernel
   -fapple-kext'. ;)

llvm-svn: 62353
2009-01-16 20:25:36 +00:00
Daniel Dunbar 87cb84e9f0 ccc: Implement support clang PTH using gcc PCH style interface.
This requires some hackery, as gcc's PCH mechanism changes behavior,
whereas while PTH is simply a cache. Notably:

 - Automatically cause clang to load a .pth file if we find one that
   matches a command line -include argument (similar to how gcc
   looks for .gch files).

 - When generating precompiled headers, translate the suffix from .gch
   to .pth (so we do not conflict with actual gcc PCH files).

 - When generating precompiled headers, copy the input header to the
   same location as the output PTH file. This is necessary because gcc
   supports -include xxx.h even if xxx.h doesn't exist, but for clang
   we need to actually have the contents of this file available.

llvm-svn: 62246
2009-01-14 23:26:40 +00:00
Daniel Dunbar fec2f2950a ccc: Finish main clang compiler argument translation.
- Still missing some odds and ends like -M.

 - Also, we still need to do some translation and forwarding of
   codegen options.

llvm-svn: 62241
2009-01-14 19:42:31 +00:00
Daniel Dunbar 3b8678fd60 ccc: Darwin/Compiler: Improve gcc compat in use of -auxbase-strip.
llvm-svn: 62213
2009-01-14 03:31:16 +00:00
Daniel Dunbar a06af2ba07 ccc: Implement argument translation for clang.
- This is what ccc (old) currently handles.

 - Clang accepts some more things that aren't getting forwarded...

llvm-svn: 62210
2009-01-14 01:50:15 +00:00
Daniel Dunbar 5cc2ba3617 ccc: Add hello.{cpp,m} tests.
- hello.cpp is XFAIL pending g++ emulation.

llvm-svn: 62208
2009-01-14 01:34:13 +00:00
Daniel Dunbar d80c653fe2 ccc: Add -ccc-echo special option, and support pulling CCC_CLANG,
CCC_ECHO, and CCC_FALLBACK from environment as ccc (old) did.

llvm-svn: 62207
2009-01-14 01:32:05 +00:00
Daniel Dunbar 65928570c0 ccc: Use Clang/Compile for Objective-C files as well.
llvm-svn: 62206
2009-01-14 01:30:55 +00:00
Daniel Dunbar a63b7f396a ccc: Add dummy Clang/Compile tool and use on Darwin/X86 for C files.
llvm-svn: 62204
2009-01-14 01:03:36 +00:00