Commit Graph

168 Commits

Author SHA1 Message Date
Daniel Dunbar aeea8ac3d8 Driver: Add -rewrite-objc, which is an interface to clang -cc1 -rewrite-objc.
llvm-svn: 95849
2010-02-11 03:16:21 +00:00
Daniel Dunbar 84f22f9da1 Driver: Fix infinite loop and wrong message on invalid -ccc-clang-arch argument.
llvm-svn: 95848
2010-02-11 03:16:07 +00:00
Daniel Dunbar c434394d18 Driver: Add -[no-]integrated-as for clang.
- Requires backend support, which only exists for i386--darwin currently.

No 'as' required:
--
ddunbar@ozzy:tmp$ cat t.c
int main() { return 42; }
ddunbar@ozzy:tmp$ clang -m32 -integrated-as t.c


ddunbar@ozzy:tmp$ ./a.out; echo $?
42
ddunbar@ozzy:tmp$
--

The random extra whitespace is how you know its working! :)

llvm-svn: 95194
2010-02-03 03:07:56 +00:00
Daniel Dunbar fcf2d428e4 ASTUnit: Don't check that input files exist when parsing ASTs from the command
line -- they may be remapped (fake) files. This is useful for testing parsing
entirely from memory.

llvm-svn: 94395
2010-01-25 00:44:02 +00:00
Ted Kremenek 4c0df3dc1d Rename getClangFullVendorVersion() to getClangFullVersion().
llvm-svn: 94273
2010-01-23 02:11:34 +00:00
Ted Kremenek 51b8bc93f8 Move version string generation (e.g., "clang 1.1 ...") to libBasic/Version.cpp, getClangFullVendorVersion().
llvm-svn: 94235
2010-01-22 22:29:50 +00:00
Ted Kremenek 18e066f6a9 (1) Rename getClangSubversionRevision() to getClangRevision(), and
have it return a StringRef instead of an integer (to be more VCS
    agnostic).

(2) Add getClangFullRepositoryVersion(), which contains an
    amalgamation of the repository name and the revision.

(3) Change PCH to only emit the string returned by
    getClangFullRepositoryVersion() instead of also emitting the value
    of getClangSubversionRevision() (which has been removed).  This is
    functionally equivalent.

More cleanup to version string generation pending...

llvm-svn: 94231
2010-01-22 22:12:47 +00:00
Ted Kremenek 2377a0e0ea Rename getClangSubversionPath() -> getClangRepositoryPath() and have it return a StringRef.
llvm-svn: 94213
2010-01-22 20:55:35 +00:00
Daniel Dunbar 3f3e2cd820 Driver: Lift clang resource directory computation to the Driver object.
llvm-svn: 93971
2010-01-20 02:35:16 +00:00
Ted Kremenek bb1110a7ae Fix possible memory leak by using an OwningPtr.
llvm-svn: 93834
2010-01-19 01:29:05 +00:00
Benjamin Kramer d20ef75b91 Remove some dead variables clang-analyzer found.
llvm-svn: 92162
2009-12-25 15:43:36 +00:00
Daniel Dunbar e0d2691b88 Driver: Fix '... -O4 -O0 ...', which was generating bitcode.
llvm-svn: 91962
2009-12-23 00:47:42 +00:00
Daniel Dunbar c7a67b7877 Driver: When linking, don't warn about unused arguments which are obviously only
used during compilation.
 - There is no easy way to define this group properly, unfortunately, and maybe
   this is a losing strategy. For now this is unambiguous more friendly, though.

llvm-svn: 91940
2009-12-22 23:19:32 +00:00
Jeffrey Yasskin 567ae47b4a Remove several .c_str() to be forward-compatible with StringRef.
llvm-svn: 90822
2009-12-08 01:46:24 +00:00
Rafael Espindola 59ae799efa Shorten the help test for -no-canonical-prefixes, put it behind HelpHidden and
claim it in Driver.cpp instead of Tools.cpp.

llvm-svn: 90777
2009-12-07 18:28:29 +00:00
Daniel Dunbar 1b52d8c4ec Unbreak -ccc-cxx and -ccc-clang-cxx defaulting.
llvm-svn: 90629
2009-12-05 00:13:59 +00:00
Daniel Dunbar acd6957b59 Driver: Switch -ccc-* options to using the standard options functionality.
- I still want to get rid of them, but manually handling them isn't adding value.

llvm-svn: 90602
2009-12-04 21:55:23 +00:00
Daniel Dunbar 65b9952c2e Add OptTable::PrintHelp.
llvm-svn: 90420
2009-12-03 07:01:38 +00:00
Daniel Dunbar 44b36ee78c What the FIXMEs want, the FIXMEs shall have.
llvm-svn: 89861
2009-11-25 11:53:23 +00:00
Daniel Dunbar 52ed5feee5 Factor out OptTable::ParseArgs, for parsing an entire argument vector.
llvm-svn: 89327
2009-11-19 06:35:06 +00:00
Daniel Dunbar da13faf982 Driver: ArgList doesn't depend on Options.h anymore.
llvm-svn: 89313
2009-11-19 04:25:22 +00:00
Daniel Dunbar fffd18167d Driver: Switch to using explicit {getLast,has}ArgNoClaim functions instead of taking a Claim argument.
- Most driver code always claims, and bool arguments don't play nice with the overloads.

llvm-svn: 89308
2009-11-19 04:00:53 +00:00
Daniel Dunbar 0bfb21e4b0 Use Option::matches instead of direct ID comparison.
llvm-svn: 89305
2009-11-19 03:26:40 +00:00
Daniel Dunbar aa767378ac Driver: Split OptTable out into OptTable.{h,cpp}
llvm-svn: 89283
2009-11-19 00:15:11 +00:00
Daniel Dunbar 26228a0d7a Driver: Rework OptTable to have no dependency on the options it manages.
llvm-svn: 89234
2009-11-18 20:19:36 +00:00
Mike Stump 727170d2d8 Allow customization for the version line.
llvm-svn: 83652
2009-10-09 17:31:54 +00:00
Douglas Gregor 1b7035da6f Provide a common set of routines in Version.h that return Subversion
branch/revision information. Use that information in the driver,
rather than one-off branch/revision computation. 

llvm-svn: 83321
2009-10-05 20:33:49 +00:00
Daniel Dunbar 5564ba743f Push "clang-is-production" logic up to tools/driver, and make it hittable by
defining the CLANG_IS_PRODUCTION Makefile variable.

llvm-svn: 82583
2009-09-22 22:31:13 +00:00
Daniel Dunbar 07806ca7ab Improve driver error message when only running the preprocessor and an input is
already preprocessed.

--
ddunbar@giles:tmp$ touch t.i
ddunbar@giles:tmp$ gcc -E t.i
ddunbar@giles:tmp$ clang -E t.i
clang: warning: t.i: previously preprocessed input unused when '-E' is present
ddunbar@giles:tmp$ 
--

<rdar://problem/6813375> [driver] driver prints confusing message when running -E on preprocessed file

llvm-svn: 82120
2009-09-17 04:13:26 +00:00
Daniel Dunbar 1ce81538f1 Change Get{File,Program}Path to return an std::string (instead of a sys::Path).
llvm-svn: 81389
2009-09-09 22:33:00 +00:00
Daniel Dunbar b5d86bbd76 Push bound architecture name into Compilation::getArgsForToolChain.
llvm-svn: 81365
2009-09-09 18:36:01 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Daniel Dunbar 9c3f7c4a4b Validate arguments to -arch.
llvm-svn: 81281
2009-09-08 23:37:30 +00:00
Daniel Dunbar 1ef3f2aa3a Rename HostInfo::getToolChain to HostInfo::CreateToolChain, and don't recreate
the default tool chain when binding the default architecture.

llvm-svn: 81279
2009-09-08 23:37:19 +00:00
Daniel Dunbar 7b57404dea Simplify.
llvm-svn: 81277
2009-09-08 23:37:02 +00:00
Daniel Dunbar 953b8d1f15 Fix ShouldUseClangCompiler to use llvm::Triple.
- -1 FIXME, and fixes 'clang -arch armv4t ...', for example.

llvm-svn: 81276
2009-09-08 23:36:55 +00:00
Daniel Dunbar f26a7ab377 Tweak & reflow comments, and delete trailing whitespace.
llvm-svn: 81275
2009-09-08 23:36:43 +00:00
Daniel Dunbar 5ed07fe794 Add -ccc-install-dir option for faking installation path.
llvm-svn: 81017
2009-09-04 18:35:03 +00:00
Mike Stump 850cc1c5a4 Update.
llvm-svn: 80864
2009-09-03 01:30:36 +00:00
Daniel Dunbar 6cdf83c192 Add driver support for -emit-ast and AST compilation steps.
- <rdar://problem/7185031> Add 'clang' option '-emit-ast'

llvm-svn: 80678
2009-09-01 16:57:46 +00:00
Daniel Dunbar 516bb9dd76 Remove arch normalization from Driver, this should be unnecessary now that
things have moved to llvm::Triple.

llvm-svn: 79902
2009-08-24 09:16:49 +00:00
Chris Lattner 3441b4f77e API changes to match llvm ToT.
llvm-svn: 79868
2009-08-23 22:45:33 +00:00
Daniel Dunbar ccc60da5c7 Reenable clang using clang-cc for C++ and all archs by default.
llvm-svn: 79861
2009-08-23 19:41:53 +00:00
Daniel Dunbar b5bcd6b94a Temporarily switch clang back to not using clang-cc by default for C++, and only
using clang-cc on i386 and x86_64.

llvm-svn: 79859
2009-08-23 18:42:54 +00:00
Edward O'Callaghan 856e4ff78d Second half of, clang, AuroraUX toolchain support.
llvm-svn: 79713
2009-08-22 01:06:46 +00:00
Daniel Dunbar 07b749230c Switch the driver back to always using clang-cc by default (for C++, and
regardless of the architecture).
 - This is a good default for development & testing; for example without this
   any tests using 'clang' in the test suite will fail on PowerPC, since the
   driver will avoid using clang.

 - We don't want to actually ship something built this way, but that should be
   handled via some sort of configuration file.

llvm-svn: 76886
2009-07-23 17:48:59 +00:00
Daniel Dunbar 08e41d65a2 driver: Print --version on stdout, to match gcc.
- Patch by Jean-Daniel Dupas

llvm-svn: 76632
2009-07-21 20:06:58 +00:00
Daniel Dunbar 38bfda6ab5 Driver: Move Compilation::Execute to Driver::ExecuteCompilation.
- The Compilation is just a helper class, it shouldn't have that amount of
   logic in it.

 - No functionality change.

llvm-svn: 74634
2009-07-01 20:03:04 +00:00
Daniel Dunbar 10de9e6602 OpenBSD support.
- Patch by Jonathan Gray!

llvm-svn: 74453
2009-06-29 20:52:51 +00:00
Daniel Dunbar 10978e414c Stub out printing of the thread model with -v.
- Turns out libstdcxx greps for this in configure.

llvm-svn: 73582
2009-06-16 23:32:58 +00:00