summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-023-36/+57
| | | | | | | | | | | | | | | | 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
* When applying a template diff highlighting to a diagnostic message, rememberRichard Trieu2012-06-281-10/+19
| | | | | | to reapply the bold formatting when needed. llvm-svn: 159386
* Fix template type diffing coloring (r159216) when forcing color output to a ↵David Blaikie2012-06-281-2/+5
| | | | | | | | file (not a terminal) Reviewed (over the shoulder) by Richard Trieu. llvm-svn: 159381
* 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-263-4/+32
| | | | | | | | | | | | 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
* Documentation cleanup: escape \ characters in Doxygen comments as needed.James Dennett2012-06-221-2/+2
| | | | llvm-svn: 158968
* Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth2012-06-211-13/+13
| | | | | | | | | express library-level dependencies within Clang. This is no more verbose really, and plays nicer with the rest of the CMake facilities. It should also have no change in functionality. llvm-svn: 158888
* Restructure how the driver communicates information about theJohn McCall2012-06-202-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Sink definition of IBOutlet, IBOutletCollection, and IBAction intoTed Kremenek2012-06-191-0/+5
| | | | | | | the compiler predefines buffer. These are essentially part of the Objective-C language. llvm-svn: 158690
* Add language std for OpenCL 1.1 and 1.2.Tanya Lattner2012-06-181-1/+14
| | | | llvm-svn: 158686
* Move a few static functions from DiagnosticRenderer.cpp into SourceManager.Matt Beaumont-Gay2012-06-181-71/+6
| | | | | | | | This simplifies the code a little bit, since these functions all took a SourceManager parameter and called a bunch of methods on it, and makes the functions available to other users. llvm-svn: 158676
* Explicitly build __builtin_va_list.Meador Inge2012-06-161-3/+0
| | | | | | | The target specific __builtin_va_list types are now explicitly built instead of injecting strings into the preprocessor input. llvm-svn: 158592
* [-E] Emit a rewritten _Pragma on its own line.Jordan Rose2012-06-151-29/+36
| | | | | | | | | | | 1. Teach Lexer that pragma lexers are like macro expansions at EOF. 2. Treat pragmas like #define/#undef when printing. 3. If we just printed a directive, add a newline before any more tokens. (4. Miscellaneous cleanup in PrintPreprocessedOutput.cpp) PR10594 and <rdar://problem/11562490> (two separate related problems) llvm-svn: 158571
* Documentation cleanup: escape # in a Doxygen comment.James Dennett2012-06-151-1/+1
| | | | llvm-svn: 158554
* 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
* More doxygen/documentation cleanups.James Dennett2012-06-131-3/+3
| | | | | | | | | | | | | | | | | | This reduces the number of warnings generated by Doxygen by about 100 (roughly 10%). Issues addressed: (1) Primarily, backslash-escaped "@foo" and "#bah" in Doxygen comments when they're not supposed to be Doxygen commands or links, and similarly for "<baz>" when it's not intended as as HTML tag; (2) Changed some \t commands (which don't exist) to \c ("to refer to a word of code", as the Doxygen manual says); (3) \precondition becomes \pre; (4) When touching comments, deleted a couple of spurious spaces in them; (5) Changed some \n and \r to \\n and \\r; (6) Fixed one tiny typo: #pragms -> #pragma. This patch touches documentation/comments only. llvm-svn: 158422
* Add -isystem-prefix and -ino-system-prefix arguments, which can be used toRichard Smith2012-06-132-0/+31
| | | | | | | | | | 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
* If fixits appear to overlap, move the second one over in the output.Jordan Rose2012-06-081-6/+14
| | | | | | | | This occurs when you have two insertions and the first one is so long that the second fixit's column is before the first fixit ends. The edits themselves don't actually overlap, but our command-line preview does. llvm-svn: 158229
* [libclang] Don't crash when saving a PCH from a prefix headerArgyrios Kyrtzidis2012-06-082-4/+13
| | | | | | | | that does not exist. rdar://11607033 llvm-svn: 158193
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-1/+1
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* 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
* Zap the /Za compiler switch from MSVC projects, the option is considered ↵Francois Pichet2012-06-061-7/+0
| | | | | | | | harmful even by Microsoft people and clang won't build using the MSVC 2012 RC if not removed. Only 1 minor code change was necessary: can't use cdecl as variable name anymore. llvm-svn: 158063
* Fix indenting.David Blaikie2012-05-291-25/+25
| | | | llvm-svn: 157628
* ensure value passed to is space is representable as unsigned charSeth Cantrell2012-05-251-8/+12
| | | | | | | if the value isn't an unsigned char or EOF behavior is undefined (and on Windows there's an assertion) llvm-svn: 157445
* fix Bug 12924Seth Cantrell2012-05-241-0/+16
| | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=12924 This issue was that the source location was pointing to a non-printable character and so CaretEnd was pointing one _column_ past the caret but not one _character_ past the caret. So the conversion between column and byte locations wasn't working (because the conversion is only valid from the first column or byte of a character). llvm-svn: 157372
* wire -fbounds-checking to the new LLVM bounds checking passNuno Lopes2012-05-221-7/+5
| | | | llvm-svn: 157262
* [driver] When creating the compiler invocation out of command-lineArgyrios Kyrtzidis2012-05-212-8/+6
| | | | | | | | arguments, force use of clang frontend for the driver. Fixes rdar://11356765. llvm-svn: 157205
* Pulls diagnostics for temp file handling into the common diagnostic kinds.Manuel Klimek2012-05-161-1/+1
| | | | llvm-svn: 156947
* Tweek r156937 a bit so that the suggestions are correct.Chad Rosier2012-05-161-1/+2
| | | | llvm-svn: 156938
* Warn about -Wno-foo where foo is an unknown warning option. This is helpful Chad Rosier2012-05-161-3/+4
| | | | | | | | | | | for subtle misspellings such as -Wno-unused-command-line-arguments instead of -Wno-unused-command-line-argument. Also fix the diagnostic messages to properly handle -Wno- options. Previously, the positive version was always emitted (i.e., -Wfoo was emitted for -Wno-foo). rdar://11461500 llvm-svn: 156937
* For final output files create them with mode 0664 to match otherEric Christopher2012-05-111-1/+2
| | | | | | | | compilers and expected defaults. Part of rdar://11325849 llvm-svn: 156592
* Fix an assertion hit when the serialized diagnostics writer receive a diagnosticArgyrios Kyrtzidis2012-05-104-61/+80
| | | | | | | | | | | | | | from the frontend when the location is invalid and the SourceManager null. Instead of keeping the SourceManager object in DiagnosticRenderer, propagate it to the calls accordingly (as reference when it is expected to not be null, or pointer when it may be null). This effectively makes DiagnosticRenderer not tied to a specific SourceManager, removing a hack from TextDiagnosticPrinter. rdar://11386874 llvm-svn: 156536
* 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
* Add a predefine __WINT_UNSIGNED__, similar to __WCHAR_UNSIGNED__, and test ↵James Molloy2012-05-041-0/+3
| | | | | | | | | | them both for ARM and X86. Use this to fully fix Sema/format-strings.c for non-x86 platforms. Reviewed by Chandler on IRC. llvm-svn: 156169
* 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
* Use the standard values for the __cplusplus macro, even when in GNU mode. GCCRichard Smith2012-05-031-14/+10
| | | | | | | dropped its prior behavior of always defining __cplusplus to 1 in GNU mode in version 4.7. llvm-svn: 156113
* Fix cmake. Remaining two ClangCC1Options deps.Andrew Trick2012-05-021-3/+2
| | | | llvm-svn: 155977
* Remove variables made dead by r155923David Blaikie2012-05-011-2/+0
| | | | | | This makes Clang's build warning free again. llvm-svn: 155928
* Remove dead code found by static analyzer.Ted Kremenek2012-05-011-5/+0
| | | | llvm-svn: 155923
* 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
* Make some helper functions static.Benjamin Kramer2012-05-011-8/+7
| | | | llvm-svn: 155914
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-1/+1
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Use enum to set debug info size generated by ClangAlexey Samsonov2012-04-271-6/+20
| | | | llvm-svn: 155697
* Revert r154981, because it caused PR12674.Nico Weber2012-04-261-8/+4
| | | | | | Add a test for PR12674. llvm-svn: 155666
* Suppress -Wunused-variable warning in -Asserts buildMatt Beaumont-Gay2012-04-181-1/+1
| | | | llvm-svn: 155011
OpenPOWER on IntegriCloud