Daniel Dunbar
a442fd5da6
Driver: Fix arg_iterator typing to reflect that it is really an iterator over Arg*s.
...
llvm-svn: 105838
2010-06-11 22:00:13 +00:00
Jeffrey Yasskin
2b99c6fc4f
Add an option -fshow-overloads=best|all to limit the number of overload
...
candidates printed. We default to 'all'. At the moment, 'best' prints only
the first 4 overloads, but we'll improve that over time.
llvm-svn: 105815
2010-06-11 05:57:47 +00:00
Charles Davis
95a546ee4d
Add an option to specify the target C++ ABI to the frontend. Use it to
...
select either the default Itanium ABI or the new, experimental Microsoft ABI.
llvm-svn: 105804
2010-06-11 01:06:47 +00:00
Daniel Dunbar
0bcb62dc30
Frontend: Fix crashes on error paths.
...
llvm-svn: 105759
2010-06-09 22:30:54 +00:00
Daniel Dunbar
9507f9cc05
Frontend: Add FrontendAction support for handling LLVM IR inputs.
...
- These inputs follow an abbreviated execution path, but are still worth handling by FrontendAction so they reuse all the other clang -cc1 features.
llvm-svn: 105582
2010-06-07 23:26:47 +00:00
Daniel Dunbar
9b491e79fc
Frontend: Lift InputKind enumeration to top level.
...
llvm-svn: 105577
2010-06-07 23:22:09 +00:00
Daniel Dunbar
6d5824f5bf
Frontend: Add CodeGenOptions::SimplifyLibCalls, and eliminate LangOptions argument to BackendConsumer.
...
llvm-svn: 105574
2010-06-07 23:19:17 +00:00
Daniel Dunbar
c43b6b20d5
Driver: Add clang -cc1 -mrelax-all option, which sets relaxes all instructions when using -integrated-as.
...
llvm-svn: 104807
2010-05-27 05:39:39 +00:00
Douglas Gregor
f64acca2f5
Only enable code patterns (e.g., try { statements } catch (...) {
...
statements }) in the code-completion results if explicitly requested.
llvm-svn: 104637
2010-05-25 21:41:55 +00:00
Daniel Dunbar
4c77a64391
Driver/Frontend: Add -emit-codegen-only, for running irgen + codegen but not the
...
.s printer or .o writer.
llvm-svn: 104623
2010-05-25 18:41:01 +00:00
Daniel Dunbar
3730048129
Driver: Move some argument lookup utilities into driver::ArgList.
...
llvm-svn: 104237
2010-05-20 16:54:55 +00:00
Zhongxing Xu
b013b0bc04
Add option '-analyzer-max-loop', which specifies the maximum
...
number of times the analyzer will go through a loop.
llvm-svn: 104007
2010-05-18 00:28:37 +00:00
Douglas Gregor
542ad31597
Add a stub frontend action for BoostCon, for next week's workshop.
...
llvm-svn: 103258
2010-05-07 15:41:56 +00:00
Zhongxing Xu
9174b2c2f9
Make -analyzer-inline-call not a separate analysis. Instead it's a boolean
...
flag now, and can be used with other analyses. Only turned it on for C++
methods for now.
llvm-svn: 103160
2010-05-06 02:59:29 +00:00
Chris Lattner
bf6fac8415
add a new -fdiagnostics-show-category=none/id/name option, giving control
...
over choice of:
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,Format String]
dox to come.
llvm-svn: 103056
2010-05-04 21:55:25 +00:00
Douglas Gregor
cd121fb013
Introduce a limit on the depth of the macro instantiation backtrace
...
printed in a diagnostic, similar to the limit we already have on the
depth of the template instantiation backtrace. The macro instantiation
backtrace is limited to 10 "instantiated from:" diagnostics; when it's
longer than that, we'll show the first half, then say how many were
suppressed, then show the second half. The limit can be changed with
-fmacro-instantiation-limit=N, and turned off with N=0.
This eliminates a lot of note spew with libraries making use of the
Boost.Preprocess library.
llvm-svn: 103014
2010-05-04 17:13:42 +00:00
Douglas Gregor
1af7cc2830
Bump default template instantiation depth to 1024, as required by C++0x
...
llvm-svn: 102847
2010-05-01 16:59:21 +00:00
Daniel Dunbar
117c19fa4d
Frontend: Tie backend verification passes to CodeGenOptions::VerifyModule,
...
instead of NDEBUG.
llvm-svn: 102622
2010-04-29 16:29:06 +00:00
Daniel Dunbar
fca18c1b41
NeXT: Clean up dispatch method policy selection.
...
- Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}.
- Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp.
- No intended functionality change.
llvm-svn: 102255
2010-04-24 17:56:46 +00:00
Nick Lewycky
784fad7a41
Teach clang -fixit to modify files in-place, or -fixit=suffix to create new
...
files with the additional suffix in the middle.
llvm-svn: 102230
2010-04-24 01:30:46 +00:00
Fariborz Jahanian
63408e848b
Support for -fno-constant-cfstrings option - wip.
...
llvm-svn: 102112
2010-04-22 20:26:39 +00:00
Douglas Gregor
ffed1cb339
Introduce a limit on the depth of the template instantiation backtrace
...
we will print with each error that occurs during template
instantiation. When the backtrace is longer than that, we will print
N/2 of the innermost backtrace entries and N/2 of the outermost
backtrace entries, then skip the middle entries with a note such as:
note: suppressed 2 template instantiation contexts; use
-ftemplate-backtrace-limit=N to change the number of template
instantiation entries shown
This should eliminate some excessively long backtraces that aren't
providing any value.
llvm-svn: 101882
2010-04-20 07:18:24 +00:00
Chandler Carruth
e03aa55bfd
Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are not
...
implemented precisely the same as GCC, but the distinction GCC makes isn't
useful to represent. This allows parsing code which uses GCC-specific keywords
('asm', etc.) without parsing in a fully GNU mode.
llvm-svn: 101667
2010-04-17 20:17:31 +00:00
Anders Carlsson
11e5140db9
Vtable -> VTable renames across the board.
...
llvm-svn: 101666
2010-04-17 20:15:18 +00:00
Daniel Dunbar
9302f60606
clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.
...
llvm-svn: 101370
2010-04-15 15:06:22 +00:00
Daniel Dunbar
76fa840d09
Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
...
- Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.
llvm-svn: 101354
2010-04-15 06:09:03 +00:00
Chris Lattner
dad4062b4d
implement altivec.h and a bunch of support code, patch by Anton Yartsev!
...
llvm-svn: 101215
2010-04-14 03:54:58 +00:00
Zhongxing Xu
7d4bc9a106
Add a cc1 option to specify the max number of nodes the analyzer can explore.
...
llvm-svn: 101120
2010-04-13 06:44:31 +00:00
Chris Lattner
dc6040b357
add frontend support for -fdata-sections and -ffunction-sections,
...
patch by Sylvere Teissier!
llvm-svn: 101108
2010-04-13 00:38:24 +00:00
Anders Carlsson
6a75ebb137
Rename -dump-record-layouts to -fdump-record-layouts now that the option behaves like aa flag.
...
llvm-svn: 100943
2010-04-10 19:09:13 +00:00
John McCall
3155f573f5
Turn access control on by default in -cc1.
...
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.
llvm-svn: 100880
2010-04-09 19:03:51 +00:00
Daniel Dunbar
8ee6760971
Fronted: Kill overly specialized RecordLayoutDumper, just make -dump-record-layouts a bit that Sema honors.
...
llvm-svn: 100747
2010-04-08 02:59:56 +00:00
Chris Lattner
4b73cfabac
rename llvm::llvm_report_error -> llvm::report_fatal_error
...
llvm-svn: 100708
2010-04-07 22:58:06 +00:00
Chris Lattner
dec49e77e5
add clang -cc1 level support for "-ferror-limit 42"
...
llvm-svn: 100687
2010-04-07 20:37:06 +00:00
Douglas Gregor
64b046fce4
Implement support for -nostdc++. Fixes PR6446.
...
llvm-svn: 99417
2010-03-24 20:13:48 +00:00
Daniel Dunbar
fe06df4bf3
C++: Add support for -fno-use-cxa-atexit.
...
- So much typing, so little gain...
Also, rename the __cxx_global_initialization function just to match llvm-gcc.
llvm-svn: 99039
2010-03-20 04:15:41 +00:00
Daniel Dunbar
1c201fbf73
clang -cc1: Kill off -empty-input only, and replace with -init-only which is an
...
actual action.
- This is easier to use, and more reliable for timing the thing this was
actually meant to be useful for.
llvm-svn: 98978
2010-03-19 19:44:04 +00:00
Douglas Gregor
7f6d60dcc2
Optionally store a PreprocessingRecord in the preprocessor itself, and
...
tie its creation to a CC1 flag -detailed-preprocessing-record.
llvm-svn: 98963
2010-03-19 16:15:56 +00:00
John McCall
c33dec3664
Add support for -Wwrite-strings. Patch by Mike M! Fixes PR 4804.
...
llvm-svn: 98541
2010-03-15 10:54:44 +00:00
John McCall
d4324148d7
Re-introduce the ctor/dtor alias optimization, this time hidden behind a
...
command-line option which defaults off.
llvm-svn: 96649
2010-02-19 01:32:20 +00:00
John McCall
bb79b5f6f3
Raise the responsibility for passing -disable-llvm-verifier in NDEBUG builds
...
to the driver, and support it in CodeGenOptsToArgs(). Note that this changes
the default behavior of clang -cc1 to always run the verifier.
llvm-svn: 96077
2010-02-13 03:50:24 +00:00
John McCall
cfcb775b56
Add an option to disable the LLVM verifier pass (which is still always
...
disabled in NDEBUG builds). The option applies only to -cc1 invocations and is:
-disable_llvm_verifier
llvm-svn: 96046
2010-02-12 23:47:27 +00:00
Anders Carlsson
5d40c6f658
Check in the beginnings of my new vtable layout builder idea.
...
Right now, it's off by default but can be tested by passing -fdump-vtable-layouts to clang -cc1. This option will cause all vtables that will normally be emitted as part of codegen to also be dumped using the new layout code.
I've also added a very simple new vtable layout test case.
llvm-svn: 95865
2010-02-11 08:02:13 +00:00
Daniel Dunbar
925152c2d0
clang -cc1: Add -fsjlj-exceptions, which requires far too much button pushing.
...
llvm-svn: 95785
2010-02-10 18:48:44 +00:00
Fariborz Jahanian
4587803919
Implement synthesizing properties by default.
...
This is a non-fragile-abi feature only. Since it
breaks existing code, it is currently placed under
-fobjc-nonfragile-abi2 option for test purposes only
until further notice. WIP.
llvm-svn: 95685
2010-02-09 19:31:38 +00:00
Douglas Gregor
62d311fdf4
Introduce a testbed for merging multiple ASTs into a single AST
...
context with the AST importer. WIP, still useless but at least it has
a test.
llvm-svn: 95683
2010-02-09 19:21:46 +00:00
Anders Carlsson
fcd764a168
Add support for threadsafe statics, and make them the default (matching gcc).
...
Daniel, I'd appreciate a review of the driver/cc1 parts.
llvm-svn: 95508
2010-02-06 23:23:06 +00:00
Daniel Dunbar
92db0fbe5a
clang -cc1: Wire up -emit-obj, for emitting object files.
...
llvm-svn: 95182
2010-02-03 01:18:43 +00:00
Daniel Dunbar
2e3f2c805e
Driver/Frontend: Add support for -fobjc-legacy-dispatch, not yet used.
...
llvm-svn: 95004
2010-02-01 21:07:25 +00:00
Douglas Gregor
ac0605e927
Introduce serialization and deserialization of diagnostic information
...
so that CIndex can report diagnostics through the normal mechanisms
even when executing Clang in a separate process. This applies both
when performing code completion and when using ASTs as an intermediary
for clang_createTranslationUnitFromSourceFile().
The serialized format is not perfect at the moment, because it does
not encapsulate macro-instantiation information. Instead, it maps all
source locations back to the instantiation location. However, it does
maintain source-range and fix-it information. To get perfect fidelity
from the serialized format would require serializing a large chunk of
the source manager; at present, it isn't clear if this code will live
long enough for that to matter.
llvm-svn: 94740
2010-01-28 06:00:51 +00:00
Chris Lattner
3d756f1a9e
diagnose invalid values of -ftabstop, patch by Christian Adaker!
...
llvm-svn: 93288
2010-01-13 03:06:50 +00:00
Chris Lattner
e23003d1f1
implement -ftabstop=width, patch by Christian Adåker
...
llvm-svn: 93078
2010-01-09 21:54:33 +00:00
Dan Gohman
d1e76b957b
Use -fno-math-errno by default, and remove the IsMathErrnoDefault
...
targethook, which is no longer being used. This fixes PR5971.
llvm-svn: 92987
2010-01-08 02:20:44 +00:00
Kovarththanan Rajaratnam
55e74a1a6a
Remove RewriteBlocks. It has been superseded by RewriteObjC
...
llvm-svn: 92014
2009-12-23 18:03:34 +00:00
Daniel Dunbar
a7d0231b66
clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.
...
llvm-svn: 91671
2009-12-18 06:30:12 +00:00
Daniel Dunbar
24c7f5efc5
Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used
...
to compile a translation unit into the debug info for that file.
- Used by parts of Darwin build process to check compiler flags, etc.
- <rdar://problem/7256886> clang does not emit AT_APPLE_flags
llvm-svn: 91661
2009-12-18 02:43:17 +00:00
Daniel Dunbar
15cef0ed42
Fix -fdollars-in-identifiers Clang translation.
...
llvm-svn: 91562
2009-12-16 20:10:18 +00:00
Nuno Lopes
13c88c7269
implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.
...
feel free to chage the name to this lengthy argument
llvm-svn: 91543
2009-12-16 16:59:22 +00:00
Daniel Dunbar
a5a166d01a
Add -resource-dir to clang -cc1, this allows the base directory for compiler
...
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of
computed.
llvm-svn: 91370
2009-12-15 00:06:45 +00:00
Daniel Dunbar
d613677ec9
CompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::CreateFromArgs.
...
llvm-svn: 91237
2009-12-13 03:45:58 +00:00
Jeffrey Yasskin
1615d45daa
Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
...
no extra safety anyway.
llvm-svn: 91207
2009-12-12 05:05:38 +00:00
Mike Stump
d954638f02
Implement runtime checks for undefined behavior. WIP.
...
This implements a new flag -fcatch-undefined-behavior. The flag turns
on additional runtime checks for:
T a[I];
a[i] abort when i < 0 or i >= I.
Future stuff includes shifts by >= bitwidth amounts.
llvm-svn: 91198
2009-12-12 01:27:46 +00:00
Ted Kremenek
6818991d71
Add clang-cc option '-analyzer-opt-analyze-nested-blocks' to treat block literals as an entry point for analyzer checks.
...
llvm-svn: 90810
2009-12-07 22:06:12 +00:00
Daniel Dunbar
3b95148ce1
Switch PCHReader::getOriginalSourceFile to use proper diagnostics.
...
llvm-svn: 90434
2009-12-03 09:13:06 +00:00
Daniel Dunbar
215ca5f199
clang-cc: Honor -help and -version when using new style option parsing.
...
llvm-svn: 90422
2009-12-03 07:01:58 +00:00
Daniel Dunbar
6048e7fdc0
Add clang -cc1 support for -remap-file.
...
llvm-svn: 90414
2009-12-03 05:11:16 +00:00
Daniel Dunbar
da7a52289f
Add clang -cc1 -load option.
...
llvm-svn: 90413
2009-12-03 05:11:05 +00:00
Mike Stump
c01c2b87e8
Change rtti/Rtti to RTTI, as it is an acronym.
...
llvm-svn: 90334
2009-12-02 18:57:08 +00:00
Daniel Dunbar
c70c39300f
clang -cc1: Move CompilerInvocation deserialization into CompilerInvocation.cpp,
...
where it belongs.
llvm-svn: 90198
2009-12-01 03:16:53 +00:00
Daniel Dunbar
a74f8ff15c
Add CodeGenOptions::{SoftFloat,FloatABI}, and update the all the (far too many) places to use this instead of using the backend -soft-float and -float-abi= options.
...
llvm-svn: 90127
2009-11-30 08:42:00 +00:00
Daniel Dunbar
a1b02a2380
Move LLVM backend options to explicit clang-cc / clang -cc1 options, which we then manually pass to the command line library; eventually the latter grossness should be fixed by a real API when creating the target machine.
...
llvm-svn: 90063
2009-11-29 07:18:39 +00:00
Daniel Dunbar
0317c4c5b7
Add clang -cc1 parsing for LangOptions.
...
- This is the last major parsing piece, main FIXMEs remain.
llvm-svn: 90059
2009-11-29 05:52:21 +00:00
Daniel Dunbar
75fa84ebc6
Change LangOptions::ObjCConstantStringClass to an std::string to avoid worrying about the lifetime.
...
llvm-svn: 90052
2009-11-29 02:38:47 +00:00
Daniel Dunbar
9eac065e67
Move MainFileName option variable into CodeGenOptions instead of LangOptions.
...
llvm-svn: 90051
2009-11-29 02:38:34 +00:00
Daniel Dunbar
81fe60b787
Add clang -cc1 parsing for preprocessor options.
...
llvm-svn: 89917
2009-11-26 02:14:07 +00:00
Daniel Dunbar
cbc693579c
Add clang -cc1 parsing for header search options.
...
llvm-svn: 89916
2009-11-26 02:13:54 +00:00
Daniel Dunbar
ad2278d74c
Add clang -cc1 parsing for frontend options.
...
llvm-svn: 89856
2009-11-25 10:14:52 +00:00
Daniel Dunbar
8a9fa3af69
Add clang -cc1 parsing of diagnostic options.
...
llvm-svn: 89716
2009-11-23 23:41:17 +00:00
Daniel Dunbar
f5835ea2e7
Add clang -cc1 parsing of analyzer options.
...
llvm-svn: 89629
2009-11-22 22:08:20 +00:00
Daniel Dunbar
69fd86dd44
Add clang -cc1 parsing of CodeGenOptions.
...
llvm-svn: 89464
2009-11-20 17:23:30 +00:00
Daniel Dunbar
84e8a249fa
Fix some default in the option classes, and some CompilerInvocation argification
...
errors.
llvm-svn: 89388
2009-11-19 20:54:59 +00:00
Daniel Dunbar
51cd8f085f
Sketch some 'clang -cc1' support, for testing parts of CompilerInvocation.
...
llvm-svn: 89333
2009-11-19 07:37:51 +00:00
Daniel Dunbar
da9e8e225d
clang-cc: Remove some more llvm: 🆑 :init arguments, by only setting values when
...
the argument is given.
Also, tweak Opt.Sysroot defaulting.
llvm-svn: 89318
2009-11-19 05:32:21 +00:00
Daniel Dunbar
d80277895d
Change -code-completion-debug-printer to -no-code-completion-debug-printer.
...
Also, tweak a few help strings and update CompilerInvocation serialization for prev change.
llvm-svn: 89317
2009-11-19 05:32:09 +00:00
Daniel Dunbar
aca02c2730
Simplify CompilerInvocation::toArgs, now that LangOptions handling is more predictable.
...
llvm-svn: 89074
2009-11-17 09:15:57 +00:00
Daniel Dunbar
4656c53e12
Move -fnext-runtime defaulting to driver (and change clang-cc default to
...
-fnext-runtime), instead of using getDefaultLangOptions.
llvm-svn: 89058
2009-11-17 07:07:28 +00:00
Daniel Dunbar
629f6bb95d
Add initial cut at CompilerInvocation::toArgs, which "serializes" the CompilerInvocation into a list of arguments which can be passed to clang-cc (eventually, clang -cc1).
...
- Unfortunately, this is currently a tedious and manual translation. Eventually it would be nice to automatically generate this code.
llvm-svn: 89049
2009-11-17 06:02:29 +00:00