David Chisnall
d81825aed7
Select the correct, or, failing that, compatible, dialect when invoked as cc,
...
c89, c99, and so on. No change to the default dialect when invoked as clang /
clang++.
llvm-svn: 163605
2012-09-11 09:58:54 +00:00
NAKAMURA Takumi
ed5bbe9020
[Win32] Rework crash-report since r145389.
...
- lib/Driver/Driver.cpp, tools/driver/driver.cpp: Exit status should not be propagated, although clang driver should catch exceptions.
- test/Driver/crash-report.c: Add REQUIRES:shell for now.
FIXME: setenv should work also on Lit.InternalShellRunner.
- test/Driver/crash-report.c: Remove XFAIL.
Thanks to Chad, To point out the issue.
llvm-svn: 160343
2012-07-17 05:09:29 +00:00
James Molloy
a3c85b8629
Unify Options.td and CC1Options.td, in a first step towards unifying the serialization logic in Frontend and Driver.
...
Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/
llvm-svn: 155916
2012-05-01 14:57:16 +00:00
Chad Rosier
681e4b8d96
Add a little hack to emulate a clang crash, so the diagnostics generator can be
...
tested.
llvm-svn: 155205
2012-04-20 17:08:59 +00:00
Chad Rosier
d6f716ab2a
[driver] Parse diagnostic args in the driver.
...
Previously, only diagnostics thrown by the cc1 process were
actually honoring the diagnostic options given on the command line,
like -Werror.
Reuse the existing code in Frontend currently used for cc1,
adjusting it to not interpret -Wl, linker flags as warnings.
Also fix a faulty test exposed by this change.
It wasn't actually testing anything, and was giving this warning:
clang-3: warning: argument unused during compilation: '-verify'
Which -Werror didn't turn into an error because it was output
by the driver, not the cc1 process, and diagnostic options
weren't parsed by the driver. And you couldn't see the warning
when running the test suite.
Fixes PR12181.
Patch by Dylan Noblesmith <nobled@dreamwidth.org>.
llvm-svn: 152660
2012-03-13 20:09:56 +00:00
Dylan Noblesmith
c95d81924d
Basic: import IntrusiveRefCntPtr<> into clang namespace
...
The class name is long enough without the llvm:: added.
Also bring in RefCountedBase and RefCountedBaseVPTR.
llvm-svn: 150958
2012-02-20 14:00:23 +00:00
Dylan Noblesmith
f1a13f29f2
drop more llvm:: prefixes on SmallString<>
...
More cleanup after r149799.
llvm-svn: 150380
2012-02-13 12:32:26 +00:00
Dylan Noblesmith
1cd1069b68
drop more llvm:: prefixes on OwningPtr<>
...
More cleanup after r149798.
llvm-svn: 150379
2012-02-13 12:32:21 +00:00
Sebastian Pop
422377cfd3
rename -ccc-host-triple into -target
...
llvm-svn: 148582
2012-01-20 22:01:23 +00:00
Eli Friedman
d749c6bf2e
Revert r148138; it's causing test failures.
...
llvm-svn: 148141
2012-01-13 21:33:06 +00:00
Sebastian Pop
9a8d528ddf
rename -ccc-host-triple into -target
...
llvm-svn: 148138
2012-01-13 20:37:02 +00:00
Dylan Noblesmith
1ced737ebf
remove unneeded config.h includes
...
llvm-svn: 147195
2011-12-22 22:49:47 +00:00
Sebastian Pop
8188c8a1f3
rename getHostTriple into getDefaultTargetTriple in clang
...
llvm-svn: 143503
2011-11-01 21:33:06 +00:00
Bob Wilson
05de0298d2
Rip out flags for controlling C++ "production mode" separately.
...
This is old leftover cruft from the days when C++ was not yet ready
for prime time.
llvm-svn: 141063
2011-10-04 05:34:14 +00:00
David Blaikie
9c902b5502
Rename Diagnostic to DiagnosticsEngine as per issue 5397
...
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
Evan Cheng
494eb062b5
Match LLVM change: TargetRegistry and TargetSelect have been moved to Support.
...
llvm-svn: 138451
2011-08-24 18:09:14 +00:00
Chad Rosier
be10f9853c
When the compiler crashes, the compiler driver now produces diagnostic
...
information including the fully preprocessed source file(s) and command line
arguments. The developer is asked to attach this diagnostic information to a
bug report.
rdar://9575623
llvm-svn: 136702
2011-08-02 17:58:04 +00:00
Chris Lattner
0e62c1cc0b
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
...
them into the clang namespace.
llvm-svn: 135852
2011-07-23 10:55:15 +00:00
Chad Rosier
1988642124
Temporarily revert r135614 while I fix the cmake build.
...
llvm-svn: 135621
2011-07-20 21:16:17 +00:00
Chad Rosier
e3805fc118
When the compiler crashes, the compiler driver now produces diagnostic information
...
including the fully preprocessed source file(s) and command line arguments. The
developer is asked to attach this diagnostic information to a bug report.
llvm-svn: 135614
2011-07-20 20:26:32 +00:00
Joerg Sonnenberger
39ec119132
Slightly improve the code to derive target from program name to not
...
fault if no arguments are given.
llvm-svn: 134618
2011-07-07 16:57:26 +00:00
Daniel Dunbar
529c03bc1e
Driver: Sketch driver support for a CC_LOG_DIAGNOSTICS options, similar to the
...
existing CC_PRINT_OPTIONS and CC_PRINT_HEADERS, which can be used to
transparently capture the compiler diagnostics from a build.
llvm-svn: 129082
2011-04-07 18:01:20 +00:00
Chris Lattner
ce6c42f65f
switch a few Driver APIs to use llvm::ArrayRef, cleaning up code.
...
llvm-svn: 128142
2011-03-23 04:04:01 +00:00
Joerg Sonnenberger
f6ce2fb1b3
Refactor program name logic. Extend it to infer the target triple from
...
the program name, if it includes it as proper prefix. This makes calling
clang with -ccc-host-triple x86_64-linux the same as calling it with the
name x86_64-linux-clang.
llvm-svn: 127753
2011-03-16 20:15:43 +00:00
Joerg Sonnenberger
b86f5f4106
If called as *cpp or *cpp-[^-]*, run only the preprocessor. If no
...
input is specified, use stdin implicitly. Based on a patch from
Roman Divacky.
llvm-svn: 127137
2011-03-06 23:31:01 +00:00
Daniel Dunbar
ac540b3859
clang: Add support for a CC_PRINT_HEADERS environment variable, which mirrors
...
CC_PRINT_OPTIONS and can be used to get some out-of-band information on header
usage from a build.
llvm-svn: 124751
2011-02-02 21:11:35 +00:00
Douglas Gregor
a09c6cca72
Add missing <cctype> include, from Joerg Sonnenberger
...
llvm-svn: 123668
2011-01-17 19:15:43 +00:00
Michael J. Spencer
740857fa10
Replace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.
...
llvm-svn: 122340
2010-12-21 16:45:57 +00:00
Michael J. Spencer
e47230f9b5
Replace all uses of PathV1::get{Basename,Dirname,Suffix} with their PathV2 equivalents.
...
llvm-svn: 122140
2010-12-18 04:13:32 +00:00
Michael J. Spencer
e169675474
Replace all uses of PathV1::getLast with PathV2::filename.
...
llvm-svn: 122117
2010-12-18 00:19:12 +00:00
Michael J. Spencer
d9da7a1f16
MemoryBuffer API update.
...
llvm-svn: 121956
2010-12-16 03:28:14 +00:00
Michael J. Spencer
f25faaaffb
Use error_code instead of std::string* for MemoryBuffer.
...
llvm-svn: 121378
2010-12-09 17:36:38 +00:00
Michael J. Spencer
8aaf49959c
Merge System into Support.
...
llvm-svn: 120297
2010-11-29 18:12:39 +00:00
Argyrios Kyrtzidis
d004064864
Refactoring of Diagnostic class.
...
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.
llvm-svn: 119730
2010-11-18 20:06:41 +00:00
Benjamin Kramer
4ab36ba726
Turns out that we may end up calling dladdr on GetExecutablePath, give it external linkage to make sure the lookup works on all platforms.
...
llvm-svn: 117813
2010-10-30 17:32:40 +00:00
Benjamin Kramer
c482735d89
This function doesn't need external linkage either.
...
llvm-svn: 117786
2010-10-30 14:28:41 +00:00
Rafael Espindola
b2d0d40c3d
Make "-ccc-cxx" option work on Linux.
...
Patch by nobled.
I also took the opportunity to make the field private since now it is only ready from the
outside.
llvm-svn: 113138
2010-09-06 02:36:23 +00:00
Douglas Gregor
2dd19f1d5f
Simplify the ownership model for DiagnosticClients, which was really
...
convoluted and a bit leaky. Now, the Diagnostic object owns its
DiagnosticClient.
llvm-svn: 111437
2010-08-18 22:29:43 +00:00
Daniel Dunbar
88979914d7
Driver: Keep track of a separate "install dir", which is the path where clang
...
was invoked from (which may not be where the executable itself is).
- This allows having e.g., /Developer/usr/bin/clang be a symlink to some other
location, while still making sure the Driver finds 'as', 'ld', etc. relative
to itself.
llvm-svn: 109989
2010-08-01 22:29:51 +00:00
Daniel Dunbar
5863fa5215
Simplify.
...
llvm-svn: 109988
2010-08-01 22:29:47 +00:00
Daniel Dunbar
9d8416b799
Driver: Switch to using a SmallVector instead of std::vector, and stop
...
accessing outside the range of the vector (which always asserts on Win32).
llvm-svn: 108802
2010-07-20 02:47:40 +00:00
Rafael Espindola
77a067a653
Implement support for reading arguments specified in a file with @file . If
...
there is no file named "file", keep the @file option unchanged.
llvm-svn: 108697
2010-07-19 15:20:12 +00:00
Daniel Dunbar
00c57967da
Revert r108672, "Implement support for reading arguments specified in a file
...
with @file.", it doesn't correctly handle cases where arguments starting with
'@' are passed to other command line arguments.
llvm-svn: 108686
2010-07-19 07:21:12 +00:00
Rafael Espindola
129e43d29b
Implement support for reading arguments specified in a file with @file .
...
llvm-svn: 108672
2010-07-19 03:08:01 +00:00
Daniel Dunbar
e38764c66c
Driver: Change the driver to take the path to the main executable, instead of
...
taking it in pieces.
- Fixes a problem where the Clang executable path was not initialized properly
on Win32, because sys::Path::getBasename() doesn't do what I always think it
does. Imagine that, a sys::Path interface that is confusing!
llvm-svn: 108667
2010-07-19 00:44:04 +00:00
Rafael Espindola
7661436220
Refactor the code a bit so that there is only one call to BuildCompilation. The
...
StringPointers vector will also be used in the normal case to handle @file
arguments.
llvm-svn: 108660
2010-07-18 22:03:55 +00:00
Daniel Dunbar
2fcaa549a8
Driver/MC: Add 'clang -cc1as' integrated assembler tool, currently accepts approximately the same interface as 'llvm-mc'.
...
llvm-svn: 104239
2010-05-20 17:49:16 +00:00
Daniel Dunbar
e43887bd2b
Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
...
Clang++ support, even in "Production" mode (for testing purposes).
llvm-svn: 100119
2010-04-01 18:21:41 +00:00
Chris Lattner
09f8cc8c70
make -ftime-report work even in -disable-free mode. Woo, finally.
...
rdar://7781603
llvm-svn: 99878
2010-03-30 05:39:52 +00:00
Daniel Dunbar
6a8efa8a79
Driver: Support CC_PRINT_OPTIONS, used for logging the compile commands (in -v style) to a file.
...
llvm-svn: 99054
2010-03-20 08:01:59 +00:00