summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* When the header file search resolves a quoted include to a file in theDouglas Gregor2012-08-131-5/+13
| | | | | | | | | | | current directory, propagate the framework and in-index-header-map from the including header's information down to the included header's information. Fixes <rdar://problem/11261291>. As with everything header-map related, we can't really test this in isolation within Clang, so it's tested elsewhere. llvm-svn: 161759
* Added some preprocessor memory usage stats to -cc1 -print-statsAlexander Kornienko2012-08-131-0/+14
| | | | llvm-svn: 161752
* Add missing cctype includes.Joerg Sonnenberger2012-08-101-0/+1
| | | | llvm-svn: 161660
* Lexer: remove dead stores. Found by Clang static analyzer!Dmitri Gribenko2012-07-301-5/+2
| | | | llvm-svn: 160973
* clang/lib: [CMake] Update tblgen'd dependencies.NAKAMURA Takumi2012-07-271-0/+1
| | | | llvm-svn: 160851
* clang/lib: [CMake] Reformat, alphabetize lists.NAKAMURA Takumi2012-07-271-1/+1
| | | | llvm-svn: 160850
* Add __has_feature(attribute_availability_with_message).Jordan Rose2012-07-241-0/+1
| | | | | | | | | | | | | | | | | This tests for the ability to include a "message" field in availability attributes, like so: extern void ATSFontGetName(const char *oName) __attribute__((availability(macosx,introduced=8.0,deprecated=9.0, message="use CTFontCopyFullName"))); This was actually supported in Clang 3.1, but we got a request for a __has_feature so that header files can use this more safely. It's unfortunate that the 3.1 release doesn't include this, however. <rdar://problem/11886458> llvm-svn: 160699
* Fix a typo (the the => the)Sylvestre Ledru2012-07-233-3/+3
| | | | llvm-svn: 160622
* Adding a fixit for includes that cannot be found with angle brackets, but ↵Aaron Ballman2012-07-171-3/+22
| | | | | | can be found with quoted strings instead. Implements PR13201. llvm-svn: 160406
* Share ConvertUTF8toWide() between Lex and CodeGen.Nico Weber2012-07-031-36/+1
| | | | llvm-svn: 159634
* Use -frewrite-includes for crash reports.David Blaikie2012-06-291-0/+4
| | | | | | | | | | | In future changes we should: * use __builtin_trap rather than derefing 'random' volatile pointers. * avoid dumping temporary files into /tmp when running tests, instead preferring a location that is properly cleaned up by lit. Review by Chandler Carruth. llvm-svn: 159469
* Patch for handling C99 veriadic macros when using precompiled headers,Douglas Gregor2012-06-291-0/+10
| | | | | | from Filipe Cabecinhas! llvm-svn: 159446
* Add warning flag -Winvalid-pp-token for preprocessing-tokens which haveRichard Smith2012-06-281-3/+3
| | | | | | | | undefined behaviour, and move the diagnostic for '' from an Error into an ExtWarn in this group. This is important for some users of the preprocessor, and is necessary for gcc compatibility. llvm-svn: 159335
* Introduce __has_feature(attribute_unused_on_fields) to determine whetherDaniel Jasper2012-06-271-0/+1
| | | | | | | the current version of clang understands __attribute__((unused)) on fields. llvm-svn: 159252
* preprocessing: gcc supports #line 0. So, treat thisFariborz Jahanian2012-06-261-8/+4
| | | | | | | | as a gcc supported extension with usual treatment with -pedantic (warn) and -pedantic-errors (error). // rdar://11550996 llvm-svn: 159226
* Add testing for CommentHandler, and fix a bug where trailing comments in #elseRichard Smith2012-06-241-0/+8
| | | | | | | and #endif in non-skipped blocks were not passed to the CommentHandler. Patch by Andy Gibbs! llvm-svn: 159119
* Minor improvements to some C99 variadic-macro-related diagnostics.Richard Smith2012-06-222-6/+8
| | | | llvm-svn: 159054
* Documentation cleanup:James Dennett2012-06-221-49/+56
| | | | | | | | | * Add \brief summaries; * Escape # characters in Doxygen comments; * Add \code...\endcode markup for code examples; * Add \verbatim...\endverbatim markup for grammar productions. llvm-svn: 158976
* Documentation cleanup:James Dennett2012-06-221-2/+2
| | | | | | | * Use \p param for a parameter reference, not the (erroneous) form \arg param; * Escape # characters in Doxygen comments as needed. llvm-svn: 158971
* Documentation cleanup: escape # characters in Doxygen comments as needed.James Dennett2012-06-221-1/+1
| | | | llvm-svn: 158970
* Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth2012-06-211-3/+8
| | | | | | | | | 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
* Do not complain about junk on the end of a #endif in a skipped block. Such junkRichard Smith2012-06-211-1/+3
| | | | | | is permitted by all relevant language standards. Patch by Andy Gibbs! llvm-svn: 158883
* Introduce ObjCRuntime::hasWeakClassImport() and use it in the appropriateJohn McCall2012-06-201-1/+1
| | | | | | | | | places. I've turned this off for the GNU runtimes --- I don't know if they support weak class import, but it's easy enough for them to opt in. Also tweak a comment per review by Jordan. llvm-svn: 158860
* Restructure how the driver communicates information about theJohn McCall2012-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Documentation cleanup:James Dennett2012-06-201-8/+4
| | | | | | | | * Escaped # and < characters in Doxygen comments as needed; * Removed a Doxygen comment in HeaderSearch.cpp that was redundant with the corresponding comment in the header file. llvm-svn: 158776
* Structured comment parsing, first step.Dmitri Gribenko2012-06-201-2/+2
| | | | | | | | | * Retain comments in the AST * Serialize/deserialize comments * Find comments attached to a certain Decl * Expose raw comment text and SourceRange via libclang llvm-svn: 158771
* Reapply r158700 and fixup patches, minus one hunk that slipped through andAlexis Hunt2012-06-191-0/+1
| | | | | | | caused a crash in an obscure case. On the plus side, it caused me to catch another bug by inspection. llvm-svn: 158767
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-1/+0
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Documentation cleanup: add \verbatim markup for grammar productionsJames Dennett2012-06-191-1/+2
| | | | llvm-svn: 158740
* Revert predefined decl tracking.Meador Inge2012-06-191-1/+1
| | | | | | | | | | r158085 added some logic to track predefined declarations. The main reason we had predefined declarations in the input was because the __builtin_va_list declarations were injected into the preprocessor input. As of r158592 we explicitly build the __builtin_va_list declarations. Therefore the predefined decl tracking is no longer needed. llvm-svn: 158732
* Improve the specification of spellings in Attr.td.Alexis Hunt2012-06-191-0/+1
| | | | | | | | | | | | | | | | | Note that this is mostly a structural patch that handles the change from the old spelling style to the new one. One consequence of this is that all AT_foo_bar enum values have changed to not be based off of the first spelling, but rather off of the class name, so they are now AT_FooBar and the like (a straw poll on IRC showed support for this). Apologies for code churn. Most attributes have GNU spellings as a temporary solution until everything else is sorted out (such as a Keyword spelling, which I intend to add if someone else doesn't beat me to it). This is definitely a WIP. I've also killed BaseCheckAttr since it was unused, and I had to go through every attribute anyway. llvm-svn: 158700
* Documentation cleanup: Use \brief for summaries, and escape # characters.James Dennett2012-06-171-1/+1
| | | | llvm-svn: 158619
* Documentation cleanup:James Dennett2012-06-171-11/+7
| | | | | | | | | | * Removed docs for Lexer::makeFileCharRange from Lexer.cpp, as they're in the header file; * Reworked the documentation for SkipBlockComment so that it doesn't confuse Doxygen's comment parsing; * Added another summary with \brief markup. llvm-svn: 158618
* Documentation cleanup: added \verbatim...\verbatim markup to fix theJames Dennett2012-06-171-0/+2
| | | | | | formatting of Doxygen's output for StringLiteralParser::StringLiteralParser. llvm-svn: 158616
* Documentation cleanup:James Dennett2012-06-171-29/+42
| | | | | | | * Escaped #pragma (as \#pragma) in Doxygen comments; * Added \code...\endcode annotations around code examples in doc comments. llvm-svn: 158615
* [-E] Emit a rewritten _Pragma on its own line.Jordan Rose2012-06-151-1/+1
| | | | | | | | | | | 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 backslashes in Doxygen comments.James Dennett2012-06-151-4/+5
| | | | llvm-svn: 158552
* PR12717: Clang supports hexadecimal floating-point literals in all languageRichard Smith2012-06-151-2/+14
| | | | | | | | | | | | | modes. For languages other than C99/C11, this isn't quite a conforming extension, and for C++11, it breaks some reasonable code containing user-defined literals. In languages which don't officially have hexfloats, pare back this extension to only apply in cases where the token starts 0x and does not contain an underscore. The extension is still not quite conforming, but it's a lot closer now. llvm-svn: 158487
* Fix PR13065.David Blaikie2012-06-151-1/+1
| | | | | | This condition (added in r158093) was overly conservative. llvm-svn: 158483
* Rename a loop variable to silence a gcc warning.Richard Trieu2012-06-131-3/+3
| | | | llvm-svn: 158420
* Add -isystem-prefix and -ino-system-prefix arguments, which can be used toRichard Smith2012-06-131-0/+10
| | | | | | | | | | 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
* Fix issue where a token paste which forms a /* or // would discard the rest ofRichard Smith2012-06-131-2/+2
| | | | | | | | the input: token-pasting was producing a tok::eof. Patch by Andy Gibbs! llvm-svn: 158412
* Fix off-by-one error in UTF-16 encoding: don't try to use a surrogate pair ↵Richard Smith2012-06-131-1/+1
| | | | | | for U+FFFF. llvm-svn: 158391
* PR13099: Teach -Wformat about raw string literals, UTF-8 strings and Unicode ↵Richard Smith2012-06-131-9/+71
| | | | | | escape sequences. llvm-svn: 158390
* Correct method name in comment: from LexRawToken to LexFromRawLexer, accordingDmitri Gribenko2012-06-081-2/+2
| | | | | | to a change done long ago in r57393. llvm-svn: 158243
* Disable _Pragma during HTML macro rewriting to keep from crashing.Jordan Rose2012-06-082-1/+5
| | | | | | | | | | | | | | | | | | | The preprocessor's handling of diagnostic push/pops is stateful, so encountering pragmas during a re-parse causes problems. HTMLRewrite already filters out normal # directives including #pragma, so it's clear it's not expected to be interpreting pragmas in this mode. This fix adds a flag to Preprocessor to explicitly disable pragmas. The "right" fix might be to separate pragma lexing from pragma parsing so that we can throw away pragmas like we do preprocessor directives, but right now it's important to get the fix in. Note that this has nothing to do with the "hack" of re-using the input preprocessor in HTMLRewrite. Even if we someday copy the preprocessor instead of re-using it, the copy would (and should) include the diagnostic level tables and have the same problems. llvm-svn: 158214
* Insert a space if necessary when suggesting CFBridgingRetain/Release.Jordan Rose2012-06-071-0/+5
| | | | | | | | | | | | This was a problem for people who write 'return(result);' Also fix ARCMT's corresponding code, though there's no test case for this because implicit casts like this are rejected by the migrator for being ambiguous, and explicit casts have no problem. <rdar://problem/11577346> llvm-svn: 158130
* Add a -rewrite-includes option, which is similar to -rewrite-macros, but ↵David Blaikie2012-06-063-2/+23
| | | | | | | | | only expands #include directives. Patch contributed by Lubos Lunak (l.lunax@suse.cz). Review by Matt Beaumont-Gay (matthewbg@google.com). llvm-svn: 158093
* Escape \n and \r in doxycomment.David Blaikie2012-06-061-2/+2
| | | | llvm-svn: 158091
* Add pedantic warning -Wempty-translation-unit (C11 6.9p1).Jordan Rose2012-06-061-1/+1
| | | | | | | | | | | | | | | | | | | In standard C since C89, a 'translation-unit' is syntactically defined to have at least one "external-declaration", which is either a decl or a function definition. In Clang the latter gives us a declaration as well. The tricky bit about this warning is that our predefines can contain external declarations (__builtin_va_list and the 128-bit integer types). Therefore our AST parser now makes sure we have at least one declaration that doesn't come from the predefines buffer. Also, remove bogus warning about empty source files. This doesn't catch source files that only contain comments, and never fired anyway because of our predefines. PR12665 and <rdar://problem/9165548> llvm-svn: 158085
OpenPOWER on IntegriCloud