Commit Graph

310 Commits

Author SHA1 Message Date
Bob Wilson a1b4206a70 Fix up fallout from r187156.
The previous change caused the driver to translate -Wa,-L to the
-msave-temp-labels option for cc1as, but cc1as did not accept that option.
This patch follows the same approach used for similar options (-relax-all,
-noexecstack) in the previous patch.

llvm-svn: 191458
2013-09-26 21:00:51 +00:00
Joey Gouly 92dfcfa403 Fix the MCTargetAsmParser API change.
llvm-svn: 190601
2013-09-12 10:59:24 +00:00
Bill Wendling 5257538df9 Update to the new API interface which requires the MCRegisterInfo object. <rdar://problem/13623355>
llvm-svn: 190291
2013-09-09 02:37:56 +00:00
Reid Kleckner 1d1844a7c7 clang-cl: Use "clang cl.exe" when disambiguating the diagnostic prefix.
llvm-svn: 189909
2013-09-04 03:10:36 +00:00
Reid Kleckner dc74af1ab8 clang-cl: Avoid confusing diagnostics when clang-cl is called just cl.exe
llvm-svn: 189901
2013-09-04 01:37:22 +00:00
Hans Wennborg 3accde52db cmake: install a cl.exe binary in the tools/msbuild-bin dir
llvm-svn: 189435
2013-08-28 01:58:44 +00:00
Jordan Rose 5ae3a670c3 CMake: Fix standalone Clang build, take two.
This time, use a variable that's defined consistently in standalone and
non-standalone builds.

llvm-svn: 189406
2013-08-27 21:52:04 +00:00
Reid Kleckner 047c61510f Revert "CMake: Fix out-of-source build's symlinks."
This reverts commit r189371, it broke the in-source cmake build.

llvm-svn: 189390
2013-08-27 18:27:08 +00:00
Jordan Rose 2f59a669bf CMake: Fix out-of-source build's symlinks.
Symlinks to clang should go in Clang's build directory, not LLVM's.

llvm-svn: 189371
2013-08-27 16:59:30 +00:00
Eli Friedman a617d09422 Fix iterator invalidation. PR16935.
llvm-svn: 188835
2013-08-20 22:01:43 +00:00
Hans Wennborg bcbc89cf0b Look at lowercase version of argv[0] when determining driver mode
llvm-svn: 188833
2013-08-20 21:47:50 +00:00
Michael Gottesman 3f3404fd3a [autotools->cmake] Added support for building clang with an order file.
llvm-svn: 188763
2013-08-20 07:41:18 +00:00
Michael Gottesman 794315b65a [autotools->cmake] Added support for creating the clang driver plist for OS X.
llvm-svn: 188759
2013-08-20 07:09:51 +00:00
Hans Wennborg 3a9fa9ed0f Remove misleading comment about using cc1 option table.
There hasn't been a separate cc1 option table since r155916.

llvm-svn: 187993
2013-08-08 17:34:27 +00:00
David Blaikie 9260ed6c06 Don't forward all assembler arguments untouched to -cc1as
Use the same filtering for assembly arguments to -cc1as as we do for
-cc1, this allows a consistent (& more useful) diagnostic experience for
users (rather than getting an error from -cc1as (which a user shouldn't
really be thinking about) about --foo, they get an error from clang
about --foo in -Wa,)

I'm sort of surprised by the separation of -cc1as & the separate
argument handling, etc, but at least this removes a little bit of the
duplication.

llvm-svn: 187156
2013-07-25 21:19:01 +00:00
Rafael Espindola 03085c7184 Remove support for CCC_ADD_ARGS. QA_OVERRIDE_GCC3_OPTIONS supersedes it.
llvm-svn: 186983
2013-07-23 19:55:06 +00:00
Hans Wennborg e4b031ca03 Add a cl.exe compatible driver mode
The mode doesn't actually do anything yet, but this provides a
way to get into it.

llvm-svn: 186720
2013-07-19 20:33:20 +00:00
Hans Wennborg 70850d83dc Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,
and add a new option --driver-mode= to control it explicitly.

The CCCIsCXX and CCCIsCPP flags were non-overlapping, i.e. there
are currently really three modes that Clang can run in: gcc, g++
or cpp, so it makes sense to represent them as an enum.

Having a command line flag to control it helps testing.

llvm-svn: 186605
2013-07-18 20:29:38 +00:00
Reid Kleckner 61b23b7edc [Driver] Use LLVM's response file parser because it can read UTF-16
MSBuild writes response files as UTF-16 little endian with a byte order
mark.  With this change, clang will be able to read them, although we
still can't parse any of their flags.

Adds a UTF-16-LE response file with a BOM for testing.

Differential Revision: http://llvm-reviews.chandlerc.com/D1137

llvm-svn: 186603
2013-07-18 20:00:53 +00:00
Rafael Espindola 16125fb652 Update for llvm API change.
llvm-svn: 186448
2013-07-16 19:44:23 +00:00
Craig Topper 2870072a91 Revert 186302 to fix build bots.
llvm-svn: 186305
2013-07-15 05:44:18 +00:00
Craig Topper 93b402d924 Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
llvm-svn: 186302
2013-07-15 04:28:48 +00:00
Rafael Espindola ccc6ea6c0b Don't use PathV1.h in cc1as_main.cpp.
llvm-svn: 184938
2013-06-26 12:48:34 +00:00
Rafael Espindola c888979879 Remove unused header.
llvm-svn: 184937
2013-06-26 12:46:06 +00:00
Rafael Espindola 9678d27140 Use llvm::sys::fs::getMainExecutable.
llvm-svn: 184915
2013-06-26 05:03:40 +00:00
Bill Wendling da1e3e737a Update to pass in pointers intead of references.
llvm-svn: 184176
2013-06-18 07:22:05 +00:00
Rafael Espindola 1600a53bc0 Include PathV1.h only where it is used.
llvm-svn: 184090
2013-06-17 17:23:47 +00:00
Reid Kleckner 898229ab4b [Driver] Refactor clang driver to use LLVM's Option library
The big changes are:
- Deleting Driver/(Arg|Opt)*
- Rewriting includes to llvm/Option/ and re-sorting
- 'using namespace llvm::opt' in clang::driver
- Fixing the autoconf build by adding option everywhere

As discussed in the review, this change includes using directives in
header files.  I'll make follow up changes to remove those in favor of
name specifiers.

Reviewers: espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D975

llvm-svn: 183989
2013-06-14 17:17:23 +00:00
Rafael Espindola dcf73d2275 Don't depend on the transitive inclusion of PathV1.h.
llvm-svn: 183945
2013-06-13 21:09:29 +00:00
Rafael Espindola 18556de316 Use the sys::RemoveFileOnSignal that takes a StringRef.
llvm-svn: 183944
2013-06-13 21:02:40 +00:00
Rafael Espindola 0725a7d972 Update for llvm change.
llvm-svn: 183930
2013-06-13 19:25:45 +00:00
Rafael Espindola a3346d8765 Use the global functions instead of the Program methods.
llvm-svn: 183861
2013-06-12 20:44:26 +00:00
Roman Divacky 95ad7794a9 Turn CLANG_ENABLE_{ARCMT,REWRITER,STATIC_ANALYZER} into proper options so that
users can disable those. Just like in autoconf generated makefiles.

llvm-svn: 182881
2013-05-29 21:09:18 +00:00
Rafael Espindola 77056237d7 Update for LLVM interface change in r181680.
llvm-svn: 181681
2013-05-13 01:24:18 +00:00
Rafael Espindola 5515ff804f cmake: mark clang as needing exported symbol.
This is a nop right now, but committing this first avoids a temporary breakage
when the llvm files change to not default to exporting symbols.

llvm-svn: 178723
2013-04-04 00:58:40 +00:00
Chad Rosier 05c71aa745 Update the error handing static functions for r178161.
Part of rdar://13296693

llvm-svn: 178162
2013-03-27 18:28:23 +00:00
Chad Rosier ab003df656 Remove a FIXME that's not planned to be fixed. We only generated crash
diagnostics for the first failing command.

llvm-svn: 178086
2013-03-26 23:25:41 +00:00
Chandler Carruth 456ab006a4 Manually specify the link dependencies. Turns out that all the work on
LLVMBuild stuff didn't actually provide a single place for dependencies,
it just added a third place.

llvm-svn: 177989
2013-03-26 03:45:48 +00:00
Chandler Carruth b45836a231 The IRReader header is now part of its own library. Update the include
line and the library dependencies to reflect this.

llvm-svn: 177972
2013-03-26 02:25:54 +00:00
Benjamin Kramer b23fc91cdc Driver: do not strip file extensions when printing diagnostics.
Before: clang-3: error: no input files
After:  clang-3.3: error: no input files

This means that we'll also print clang.exe on windows, but I don't see a problem
with that.

llvm-svn: 176788
2013-03-10 13:16:18 +00:00
Chad Rosier 3e263e40e9 [driver] Handle the processing of the QA_OVERRIDE_GCC3_OPTIONS and CCC_ADD_ARGS
before the DiagnosticsEngine is instantiated.  Otherwise, warning options are
not handled correctly.
rdar://13254743

llvm-svn: 175779
2013-02-21 18:56:55 +00:00
Jordan Rose a7d03840e6 Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.
Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.

llvm-svn: 174768
2013-02-08 22:30:41 +00:00
Chad Rosier dd60e09021 [driver] Refactor the driver so that a failing commands doesn't prevent
subsequent commands from being executed.

The diagnostics generation isn't designed for this use case, so add a note to
fix this in the very near future.  For now, just generated the diagnostics for
the first failing command.
Part of rdar://12984531

llvm-svn: 173825
2013-01-29 20:15:05 +00:00
Sean Silva f1b49e237f Nuke SetUpBuildDumpLog.
Also, it was the only reason that `argc` and `argv` were being passed
into createDiagnostics, so remove those parameters and clean up callers.

llvm-svn: 172945
2013-01-20 01:58:28 +00:00
Kevin Enderby ae2ec4745f We want the dwarf AT_producer for assembly source files to match clang's
AT_producer.  Which includes clang's version information so we can tell
which version of the compiler was used.

This is second of the two steps to allow us to do this.  The first was a
change to llvm-mc with revision 172630 to provide a method to set the
AT_producer string.  This second step has the clang driver passing the value
of getClangFullVersion() via the new flag -dwarf-debug-producer when invoking
the integrated assembler on assembly source files.  Then using the new
setDwarfDebugProducer() method to set the AT_producer string.

rdar://12888242

llvm-svn: 172758
2013-01-17 21:38:06 +00:00
Chad Rosier 5f15a35114 [driver] Warnings for warning options are handled by the frontend. The driver needs to process the
warning options to setup diagnostic state, but should not be emitting warnings as these would be
rudndant with what the frontend emits.
rdar://13001556

llvm-svn: 172497
2013-01-15 01:21:53 +00:00
Chandler Carruth ffd5551bc7 Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

Re-sort the #include lines to reflect the new paths.

llvm-svn: 171369
2013-01-02 11:45:17 +00:00
Richard Smith 940a6d73ce Produce an actual error before attempting to attach notes to it when bailing out
due to FORCE_CLANG_DIAGNOSTICS_CRASH=1. Also add a test for that env var.

llvm-svn: 171074
2012-12-25 21:56:27 +00:00
Eric Christopher 45f2e71571 Add support for passing the main file name down to the assembler
for location information.

Part of PR14624

llvm-svn: 170391
2012-12-18 00:31:10 +00:00
Chandler Carruth 4d5e1a9b34 Fix PR14625 by teaching the driver to detect PWD for assembly files.
This also requires adding support to -cc1as for passing the detecting
PWD down through LLVM's debug info (which in turn required the LLVM
change in r170371).

The test case is weak (we only test the driver behavior) because there
is currently to infrastructure for running cc1as in the test suite. So
those four lines are untested (much like all other lines in that file),
but we have a test for the same pattern using llvm-mc in the LLVM
repository.

llvm-svn: 170373
2012-12-17 21:40:04 +00:00