summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename AnalyzerOptions 'EagerlyAssume' to 'eagerlyAssumeBinOpBifurcation'.Ted Kremenek2012-08-301-2/+2
| | | | llvm-svn: 162930
* Store const& to AnalyzerOptions in AnalysisManager instead of copyingTed Kremenek2012-08-301-1/+1
| | | | | | individual flags. llvm-svn: 162929
* Move Analyses.def to include/clang/StaticAnalyzer.Ted Kremenek2012-08-301-12/+12
| | | | llvm-svn: 162927
* Change -analyzer-config to use '=' as the key-value separator, and onlyTed Kremenek2012-08-301-3/+3
| | | | | | support the '-analyzer-config key=val' variant. llvm-svn: 162891
* Add new -cc1 driver option -analyzer-config, which allows one to specifyTed Kremenek2012-08-291-0/+30
| | | | | | | | | a comma separated collection of key:value pairs (which are strings). This allows a general way to provide analyzer configuration data from the command line. No clients yet. llvm-svn: 162827
* [ms-inline asm] Change the -fenable-experimental-ms-inline-asm option from a Chad Rosier2012-08-241-1/+2
| | | | | | | | | CodeGen option to a LangOpt option. In turn, hoist the guard into the parser so that we avoid the new (and fairly unstable) Sema/AST/CodeGen logic. This should restore the behavior of clang to that prior to r158325. <rdar://problem/12163681> llvm-svn: 162602
* [analyzer] Set the default IPA mode to 'basic-inlining', which excludes C++.Jordan Rose2012-08-211-1/+1
| | | | | | | | | | | | | | | | | | | Under -analyzer-ipa=basic-inlining, only C functions, blocks, and C++ static member functions are inlined -- essentially, the calls that behave like simple C function calls. This is essentially the behavior in Xcode 4.4. C++ support still has some rough edges, and we don't want users to be worried about them if they download and run their own checker. (In particular, the massive number of false positives for analyzing LLVM comes from inlining defensively-written code in contexts where more aggressive assumptions are implicitly made. This problem is not unique to C++, but it is exacerbated by the higher proportion of code that lives in header files in C++.) The eventual goal is to be comfortable enough with C++ support (and simple Objective-C support) to advance to -analyzer-ipa=inlining as the default behavior. See the IPA design notes for more details. llvm-svn: 162318
* [driver] Add support for the --param ssp-buffer-size= driver option.Chad Rosier2012-08-211-0/+2
| | | | | | PR9673 llvm-svn: 162285
* Screw around with ObjCRuntime some more, changing theJohn McCall2012-08-211-7/+9
| | | | | | | | diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. llvm-svn: 162252
* Preprocessor: fix __OPTIMIZE_SIZE__ and -OzDylan Noblesmith2012-08-081-2/+3
| | | | | | | | | | | | Add some tests for __OPTIMIZE_SIZE__ and __NO_INLINE__, removing the superfluous copies in the target-specific tests, since it's target-independent. This uncovered a bug in the handling of -Oz: it would attempt to store the value 2 in the 1-bit bitfield OptimizeSize, leaving a value of 0 and never defining __OPTIMIZE_SIZE__. llvm-svn: 161495
* [analyzer] Turn -cfg-add-initializers on by default, and remove the flag.Jordan Rose2012-07-311-1/+0
| | | | llvm-svn: 161060
* Added -ast-list option to dump filterable AST decl node names.Alexander Kornienko2012-07-311-0/+3
| | | | llvm-svn: 161040
* Added -ast-dump-filter option to clang -cc1.Alexander Kornienko2012-07-261-0/+3
| | | | llvm-svn: 160784
* Rename -fms-inline-asm to -fenable-experimental-ms-inline-asm.Chad Rosier2012-07-201-1/+1
| | | | llvm-svn: 160590
* Add the mechanics for -fms-inline-asm. No easy way to test at this time.Chad Rosier2012-07-201-0/+1
| | | | llvm-svn: 160580
* Define __FINITE_MATH_ONLY__ based on -ffast-math and -ffinite-math-only.Bob Wilson2012-07-191-0/+1
| | | | | | | This macro was being unconditionally set to zero, preceded by a FIXME comment. This fixes <rdar://problem/11845441>. Patch by Michael Gottesman! llvm-svn: 160491
* Add OpenCL metadata for kernel arg names. This output is controlled via a ↵Tanya Lattner2012-07-111-0/+3
| | | | | | | | flag as noted in the OpenCL Spec. Includes a test case. llvm-svn: 160092
* Add -ffp-contract = { fast | on | off } command line option support.Lang Hames2012-07-061-0/+17
| | | | | | | | | | | | | | | | | This flag sets the 'fp-contract' mode, which controls the formation of fused floating point operations. Available modes are: - Fast: Form fused operations anywhere. - On: Form fused operations where allowed by FP_CONTRACT. This is the default mode. - Off: Don't form fused operations (in future this may be relaxed to forming fused operations where it can be proved that the result won't be affected). Currently clang doesn't support the FP_CONTRACT pragma, so the 'On' and 'Off' modes are equivalent. llvm-svn: 159794
* Reduce default template instantiation depth to 512; we're blowing outDouglas Gregor2012-07-021-1/+1
| | | | | | the stack too often with 1024. Fixes <rdar://problem/11678534>. llvm-svn: 159573
* Add a new libclang completion API to get brief documentation comment that isDmitri Gribenko2012-07-021-11/+23
| | | | | | | | | | | | | | | | attached to a declaration in the completion string. Since extracting comments isn't free, a new code completion option is introduced. A new code completion option that enables including brief comments into CodeCompletionString should be a, err, code completion option. But because ASTUnit caches global declarations during parsing before even completion consumer is created, the option is duplicated as a translation unit option (in both libclang and ASTUnit, like the option to cache code completion results). llvm-svn: 159539
* Add -ftls-model command-line flag.Hans Wennborg2012-06-281-1/+31
| | | | | | This allows for setting the default TLS model. (PR9788) llvm-svn: 159336
* Add template type diffing to Clang. This feature will provide a betterRichard Trieu2012-06-261-0/+2
| | | | | | | | | | | | comparison between two templated types when they both appear in a diagnostic. Type elision will remove indentical template arguments, which can be disabled with -fno-elide-type. Cyan highlighting is applied to the differing types. For more formatting, -fdiagnostic-show-template-tree will output the template type as an indented text tree, with differences appearing inline. Template tree works with or without type elision. llvm-svn: 159216
* Restructure how the driver communicates information about theJohn McCall2012-06-201-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. llvm-svn: 158793
* Extend the support for cl-std to include 1.2.Tanya Lattner2012-06-191-3/+14
| | | | | | | Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature. Added test case for 1.2 static storage class feature. llvm-svn: 158759
* Add a -fuse-init-array option to cc1 and map to the UseInitArray targetRafael Espindola2012-06-191-0/+1
| | | | | | | | | option. On the driver, check if we are using libraries from gcc 4.7 or newer and if so pass -fuse-init-array to the frontend. The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in .ctors, so we have to use .init_array. llvm-svn: 158694
* Add language std for OpenCL 1.1 and 1.2.Tanya Lattner2012-06-181-1/+14
| | | | llvm-svn: 158686
* Support -frewrite-includes as an option while preprocessing.David Blaikie2012-06-141-3/+1
| | | | llvm-svn: 158460
* Rename -rewrite-includes to -frewrite-includes.David Blaikie2012-06-141-2/+2
| | | | llvm-svn: 158458
* Add -isystem-prefix and -ino-system-prefix arguments, which can be used toRichard Smith2012-06-131-0/+18
| | | | | | | | | | override whether headers are system headers by checking for prefixes of the header name specified in the #include directive. This allows warnings to be disabled for third-party code which is found in specific subdirectories of include paths. llvm-svn: 158418
* Const'ify CompilerInvocation::toArgs().Argyrios Kyrtzidis2012-06-111-1/+1
| | | | llvm-svn: 158298
* Add a -rewrite-includes option, which is similar to -rewrite-macros, but ↵David Blaikie2012-06-061-0/+3
| | | | | | | | | only expands #include directives. Patch contributed by Lubos Lunak (l.lunax@suse.cz). Review by Matt Beaumont-Gay (matthewbg@google.com). llvm-svn: 158093
* wire -fbounds-checking to the new LLVM bounds checking passNuno Lopes2012-05-221-7/+5
| | | | llvm-svn: 157262
* add -fbounds-checking option.Nuno Lopes2012-05-081-1/+7
| | | | | | | | When enabled, clang generates bounds checks for array and pointers dereferences. Work to follow in LLVM's backend. OK'ed by Chad; thanks for the review. llvm-svn: 156431
* This patch adds a new Clang compiler flag "-gline-tables-only".Alexey Samsonov2012-05-041-1/+6
| | | | | | | | | | | | | | It reduces the amount of emitted debug information: 1) DIEs in .debug_info have types DW_TAG_compile_unit, DW_TAG_subprogram, DW_TAG_inlined_subroutine (for opt builds) and DW_TAG_lexical_block only. 2) .debug_str contains only function names. 3) No debug data for types/namespaces/variables is emitted. 4) The data in .debug_line is enough to produce valid stack traces with function names and line numbers. Reviewed by Eric Christopher. llvm-svn: 156160
* Unify Options.td and CC1Options.td, in a first step towards unifying the ↵James Molloy2012-05-011-31/+82
| | | | | | | | serialization logic in Frontend and Driver. Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/ llvm-svn: 155916
* Use enum to set debug info size generated by ClangAlexey Samsonov2012-04-271-6/+20
| | | | llvm-svn: 155697
* Remove the -cc1-level option "-pubnames-dump". Such things should stayDouglas Gregor2012-04-131-3/+0
| | | | | | out of the tree and use the tooling infrastructure. llvm-svn: 154668
* Revert r154321, pending more discussion.David Chisnall2012-04-091-3/+0
| | | | llvm-svn: 154327
* Add -fobjc-trace to emit a call before and after each Objective-C message sendDavid Chisnall2012-04-091-0/+3
| | | | | | for hooking in code flow visualisation applications. llvm-svn: 154321
* Teach Clang about PIE compilations. This is the first step of PR12380.Chandler Carruth2012-04-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, this patch cleans up the parsing of the PIC and PIE family of options in the driver. The existing logic failed to claim arguments all over the place resulting in kludges that marked the options as unused. Instead actually walk all of the arguments and claim them properly. We now treat -f{,no-}{pic,PIC,pie,PIE} as a single set, accepting the last one on the commandline. Previously there were lots of ordering bugs that could creep in due to the nature of the parsing. Let me know if folks would like weird things such as "-fPIE -fno-pic" to turn on PIE, but disable full PIC. This doesn't make any sense to me, but we could in theory support it. Options that seem to have intentional "trump" status (-static, -mkernel, etc) continue to do so and are commented as such. Next, a -pie-level flag is threaded into the frontend, rigged to a language option, and handled preprocessor, setting up the appropriate defines. We'll now have the correct defines when compiling with -fpie. The one place outside of the preprocessor that was inspecting the PIC level (as opposed to the relocation model, which is set and handled separately, yay!) is in the GNU ObjC runtime. I changed it to exactly preserve existing behavior. If folks want to change its behavior in the face of PIE, they can do that in a separate patch. Essentially the only functionality changed here is the preprocessor defines and bug-fixes to the argument management. Tests have been updated and extended to test all of this a bit more thoroughly. llvm-svn: 154291
* [analyzer] Enable retry exhausted without inlining by default.Anna Zaks2012-03-281-3/+3
| | | | llvm-svn: 153591
* Move the emission of strict enum range metadata behind a flag (the sameChandler Carruth2012-03-271-0/+3
| | | | | | | | | | | | | | | | | | | | | flag as GCC uses: -fstrict-enums). There is a *lot* of code making unwarranted assumptions about the underlying type of enums, and it doesn't seem entirely reasonable to eagerly break all of it. Much more importantly, the current state of affairs is *very* good at optimizing based upon this information, which causes failures that are very distant from the actual enum. Before we push for enabling this by default, I think we need to implement -fcatch-undefined-behavior support for instrumenting and trapping whenever we store or load a value outside of the range. That way we can track down the misbehaving code very quickly. I discussed this with Rafael, and currently the only important cases he is aware of are the bool range-based optimizations which are staying hard enabled. We've not seen any issue with those either, and they are much more important for performance. llvm-svn: 153550
* [analyzer] Add an option to re-analyze a dead-end path without inlining.Anna Zaks2012-03-271-0/+3
| | | | | | | | | | | | | | | | | | | | | The analyzer gives up path exploration under certain conditions. For example, when the same basic block has been visited more than 4 times. With inlining turned on, this could lead to decrease in code coverage. Specifically, if we give up inside the inlined function, the rest of parent's basic blocks will not get analyzed. This commit introduces an option to enable re-run along the failed path, in which we do not inline the last inlined call site. This is done by enqueueing the node before the processing of the inlined call site with a special policy encoded in the state. The policy tells us not to inline the call site along the path. This lead to ~10% increase in the number of paths analyzed. Even though we expected a much greater coverage improvement. The option is turned off by default for now. llvm-svn: 153534
* Introduce a -cc1-level option -pubnames-dump, which simply dumps theDouglas Gregor2012-03-271-0/+3
| | | | | | | | list of identifiers that that 'public' names at the end of the translation unit, e.g., defined macros or identifiers with top-level names, in sorted order. Meant to support <rdar://problem/10921596>. llvm-svn: 153522
* Driver: Factor string vector push_back into a helper class and optimize it.Benjamin Kramer2012-03-261-264/+174
| | | | | | | | | | Due to lack of move semantics we would create a temporary std::string from the string literal, copy it into the vector and discard the temporary. This leads to massive code bloat, optimizing it saves 50k on i386-linux-Release+Asserts. While there add a two-element overload for push_back, simplifying code a bit. llvm-svn: 153441
* [frontend] Fix how the frontend handles -fno-inline. AFAIK clang now matchesChad Rosier2012-03-151-6/+4
| | | | | | | the behavior of gcc with respect to the -fno-inline and -fno-inline-functions flags. llvm-svn: 152861
* [frontend] Add support for disabling the "inline" keyword using Chad Rosier2012-03-141-2/+3
| | | | | | | | | | | -fno-inline-functions. This behaves much like -fno-inline in gcc, but based on a discussion with Daniel it was decided that -fno-inline-functions should subsume -fno-inline. Please speak up if you object. The -fno-inline flag remains ignored. Final part of rdar://10972766 llvm-svn: 152754
* [driver] Parse diagnostic args in the driver.Chad Rosier2012-03-131-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | 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
* [analyzer] Add support for NoRedundancy inlining mode.Anna Zaks2012-03-091-1/+1
| | | | | | | | | | | We do not reanalyze a function, which has already been analyzed as an inlined callee. As per PRELIMINARY testing, this gives over 50% run time reduction on some benchmarks without decreasing of the number of bugs found. Turning the mode on by default. llvm-svn: 152440
* [Basic] Rename LangOptions::NoInline to NoInlineDefine, to make things a bitDaniel Dunbar2012-03-091-1/+1
| | | | | | more obvious. llvm-svn: 152408
OpenPOWER on IntegriCloud