aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-08-16Add two options for playing with modules.Sebastian Redl1-0/+8
llvm-svn: 111166
2010-08-15Extend the code-completion caching infrastructure to include globalDouglas Gregor1-0/+4
declarations (in addition to macros). Each kind of declaration maps to a certain set of completion contexts, and the ASTUnit completion logic introduces the completion strings for those declarations if the actual code-completion occurs in one of the contexts where it matters. There are a few new code-completion-context kinds. Without these, certain completions (e.g., after "using namespace") would need to suppress all global completions, which would be unfortunate. Note that we don't get the priorities right for global completions, because we don't have enough type information. We'll need a way to compare types in an ASTContext-agnostic way before this can be implemented. llvm-svn: 111093
2010-08-13Add a new cc1 option -fix-what-you-can which when combined with the fix-it modeNick Lewycky1-0/+3
will apply all fixes even when there were other errors in the file. llvm-svn: 111020
2010-08-12Just disable the hidden-visibility optimization for now by hiding it behindJohn McCall1-0/+1
a -cc1 option. The Darwin linker complains about mixed visibility when linking gcc-built objects with clang-built objects, and the optimization isn't really that valuable. Platforms with less ornery linkers can feel free to enable this. llvm-svn: 110979
2010-08-11Frontend: Add -target-linker-version, for specifying the version string of theDaniel Dunbar1-1/+6
linker in use. llvm-svn: 110871
2010-08-07Make -funroll-loops turn on loop unrolling in the optimizer insteadEric Christopher1-3/+7
of just ignoring it. llvm-svn: 110525
2010-08-06Removed IdempotentOperationChecker from default analysis and returned back ↵Tom Care1-0/+3
to a flag (-analyzer-check-idempotent-operations) - Added IdempotentOperationChecker to experimental analyses for testing purposes - Updated test cases to explictly call the checker llvm-svn: 110482
2010-08-03Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static ↵Ted Kremenek1-0/+1
analysis) that doesn't prune CFG edges. llvm-svn: 110087
2010-07-27Implement -fno-validate-pch at the -cc1 level, which suppresses mostDouglas Gregor1-1/+2
of the usual consistency checks used to determine when a precompiled header is incompatible with the translation unit it's being loaded into. Enable this option when loading a precompiled preamble, because the preamble loader will be performing all of this checking itself. Enable the preamble-based test now that it's working. This option is also useful for debugging Clang's PCH (<rdar://problem/7532213>). llvm-svn: 109475
2010-07-26Introduce basic support for loading a precompiled preamble whileDouglas Gregor1-0/+17
reparsing an ASTUnit. When saving a preamble, create a buffer larger than the actual file we're working with but fill everything from the end of the preamble to the end of the file with spaces (so the lexer will quickly skip them). When we load the file, create a buffer of the same size, filling it with the file and then spaces. Then, instruct the lexer to start lexing after the preamble, therefore continuing the parse from the spot where the preamble left off. It's now possible to perform a simple preamble build + parse (+ reparse) with ASTUnit. However, one has to disable a bunch of checking in the PCH reader to do so. That part isn't committed; it will likely be handled with some other kind of flag (e.g., -fno-validate-pch). As part of this, fix some issues with null termination of the memory buffers created for the preamble; we were trying to explicitly NULL-terminate them, even though they were also getting implicitly NULL terminated, leading to excess warnings about NULL characters in source files. llvm-svn: 109445
2010-07-26Eliminate the "minimal" and printing parser actions, which only everDouglas Gregor1-6/+0
worked for C anyway. Also kills the -cc1 options -parse-noop and -parse-print-callbacks. llvm-svn: 109392
2010-07-20Introduce a new lexer function to compute the "preamble" of a file,Douglas Gregor1-0/+3
which is the part of the file that contains all of the initial comments, includes, and preprocessor directives that occur before any of the actual code. Added a new -print-preamble cc1 action that is only used for testing. llvm-svn: 108913
2010-07-16Improved false positive rate for the idempotent operations checker and moved ↵Tom Care1-4/+0
it into the default path-sensitive analysis options. - Added checks for static local variables, self assigned parameters, and truncating/extending self assignments - Removed command line option (now default with --analyze) - Updated test cases to pass with idempotent operation warnings llvm-svn: 108550
2010-07-09Introduce -f{no-}spell-checking options to enable/disableDouglas Gregor1-0/+1
spell-checking. By default, spell-checking is enabled for Clang (obviously) but disabled in CIndex for performance reasons. llvm-svn: 107992
2010-07-09Add a frontend option -chained-pch and don't pass an active PCH reader to ↵Sebastian Redl1-0/+3
the PCH writer if it is not set, preventing creation of chained PCH files. Since the reader is so far unused, effectively no functionality change. llvm-svn: 107936
2010-07-06Added a path-sensitive idempotent operation checker ↵Tom Care1-0/+4
(-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect. Example: { int a = 1; int b = 5; int c = b / a; // a is 1 on all paths } - New IdempotentOperationChecker class - Moved recursive Stmt functions in r107675 to IdempotentOperationChecker - Minor refactoring of SVal to allow checking for any integer - Added command line option for check - Added basic test cases llvm-svn: 107706
2010-07-01Driver/IRgen: Add support for -momit-leaf-frame-pointer.Daniel Dunbar1-0/+3
llvm-svn: 107367
2010-06-26Implement support for -fwrapv, rdar://7221421Chris Lattner1-4/+10
As part of this, pull together trapv handling into the same enum. This also add support for NSW multiplies. This also makes PCH disagreement on overflow behavior silent, since it really doesn't matter except for warnings and codegen (no macros get defined etc). llvm-svn: 106956
2010-06-22implement support for -finstrument-functions, patch by NelsonChris Lattner1-0/+2
Elhage! llvm-svn: 106507
2010-06-16Frontend: Allow passing -cc1 level arguments to plugins. Patch by Troy ↵Daniel Dunbar1-1/+13
Straszheim! llvm-svn: 106113
2010-06-15Implement -fvisibility-inlines-hidden. <rdar://problem/7819834>Douglas Gregor1-0/+6
llvm-svn: 106003
2010-06-11Driver: Fix arg_iterator typing to reflect that it is really an iterator ↵Daniel Dunbar1-19/+22
over Arg*s. llvm-svn: 105838
2010-06-11Add an option -fshow-overloads=best|all to limit the number of overloadJeffrey Yasskin1-1/+12
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-11Add an option to specify the target C++ ABI to the frontend. Use it toCharles Davis1-0/+7
select either the default Itanium ABI or the new, experimental Microsoft ABI. llvm-svn: 105804
2010-06-09Frontend: Fix crashes on error paths.Daniel Dunbar1-3/+3
llvm-svn: 105759
2010-06-07Frontend: Add FrontendAction support for handling LLVM IR inputs.Daniel Dunbar1-1/+4
- 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-07Frontend: Lift InputKind enumeration to top level.Daniel Dunbar1-60/+58
llvm-svn: 105577
2010-06-07Frontend: Add CodeGenOptions::SimplifyLibCalls, and eliminate LangOptions ↵Daniel Dunbar1-0/+2
argument to BackendConsumer. llvm-svn: 105574
2010-05-27Driver: Add clang -cc1 -mrelax-all option, which sets relaxes all ↵Daniel Dunbar1-0/+3
instructions when using -integrated-as. llvm-svn: 104807
2010-05-25Only enable code patterns (e.g., try { statements } catch (...) {Douglas Gregor1-0/+4
statements }) in the code-completion results if explicitly requested. llvm-svn: 104637
2010-05-25Driver/Frontend: Add -emit-codegen-only, for running irgen + codegen but not theDaniel Dunbar1-0/+3
.s printer or .o writer. llvm-svn: 104623
2010-05-20Driver: Move some argument lookup utilities into driver::ArgList.Daniel Dunbar1-72/+43
llvm-svn: 104237
2010-05-18Add option '-analyzer-max-loop', which specifies the maximum Zhongxing Xu1-0/+1
number of times the analyzer will go through a loop. llvm-svn: 104007
2010-05-07Add a stub frontend action for BoostCon, for next week's workshop.Douglas Gregor1-0/+3
llvm-svn: 103258
2010-05-06Make -analyzer-inline-call not a separate analysis. Instead it's a boolean Zhongxing Xu1-0/+1
flag now, and can be used with other analyses. Only turned it on for C++ methods for now. llvm-svn: 103160
2010-05-04add a new -fdiagnostics-show-category=none/id/name option, giving controlChris Lattner1-0/+18
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-04Introduce a limit on the depth of the macro instantiation backtraceDouglas Gregor1-2/+13
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-01Bump default template instantiation depth to 1024, as required by C++0xDouglas Gregor1-1/+1
llvm-svn: 102847
2010-04-29Frontend: Tie backend verification passes to CodeGenOptions::VerifyModule,Daniel Dunbar1-1/+0
instead of NDEBUG. llvm-svn: 102622
2010-04-24NeXT: Clean up dispatch method policy selection.Daniel Dunbar1-3/+23
- 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-24Teach clang -fixit to modify files in-place, or -fixit=suffix to create newNick Lewycky1-20/+3
files with the additional suffix in the middle. llvm-svn: 102230
2010-04-22Support for -fno-constant-cfstrings option - wip.Fariborz Jahanian1-0/+4
llvm-svn: 102112
2010-04-20Introduce a limit on the depth of the template instantiation backtraceDouglas Gregor1-0/+7
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-17Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are notChandler Carruth1-0/+12
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-17Vtable -> VTable renames across the board.Anders Carlsson1-2/+2
llvm-svn: 101666
2010-04-15clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.Daniel Dunbar1-0/+9
llvm-svn: 101370
2010-04-15Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM ↵Daniel Dunbar1-0/+5
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-14implement altivec.h and a bunch of support code, patch by Anton Yartsev!Chris Lattner1-0/+4
llvm-svn: 101215
2010-04-13Add a cc1 option to specify the max number of nodes the analyzer can explore.Zhongxing Xu1-0/+1
llvm-svn: 101120
2010-04-13add frontend support for -fdata-sections and -ffunction-sections,Chris Lattner1-0/+7
patch by Sylvere Teissier! llvm-svn: 101108