summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove duplicate includes.Roman Divacky2012-12-211-1/+0
| | | | llvm-svn: 170903
* [libclang] Follow-up to r170824, provide the correct number of arguments forArgyrios Kyrtzidis2012-12-211-0/+11
| | | | | | a not-fully-formed macro invocation during code-completion. llvm-svn: 170833
* [libclang] Make sure we can code-complete inside a macro argument even thoughArgyrios Kyrtzidis2012-12-211-14/+26
| | | | | | | | the macro invocation is not fully formed. rdar://11290992 llvm-svn: 170824
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-6/+6
| | | | | | which is wrong here. llvm-svn: 170721
* Add __has_feature(memory_sanitizer).Evgeniy Stepanov2012-12-201-0/+1
| | | | llvm-svn: 170686
* [preprocessor] When "merging" macro argument tokens into one SLocEntry chunk,Argyrios Kyrtzidis2012-12-191-2/+6
| | | | | | | | make sure they came from the same kind of FileIDs. Thanks to Abramo Bagnara for providing the test case. llvm-svn: 170616
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-6/+6
| | | | | | single attribute in the future. llvm-svn: 170500
* tsan: add __has_feature(thread_sanitizer)Dmitry Vyukov2012-12-171-0/+1
| | | | llvm-svn: 170314
* [preprocessor] For errors at a function macro invocation, also includeArgyrios Kyrtzidis2012-12-141-0/+8
| | | | | | a note about where the macro is defined. llvm-svn: 170228
* Don't warn about disabled macro expansion if we see the name of a ↵Richard Smith2012-12-121-4/+3
| | | | | | function-like macro which isn't immediately followed by '('. FreeBSD's stdio.h #defines foo(x) to (foo)(x), apparently. llvm-svn: 169960
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-112-3/+3
| | | | | | latter is rather a mess to type. llvm-svn: 169919
* Extend stat query APIs to explicitly specify if the query is forArgyrios Kyrtzidis2012-12-111-2/+2
| | | | | | | | | | a file or directory, allowing just a stat call if a file descriptor is not needed. Doing just 'stat' is faster than 'open/fstat/close'. This has the effect of cutting down system time for validating the input files of a PCH. llvm-svn: 169831
* Return true from HeaderSearch::isFileMultipleIncludeGuarded if the fileArgyrios Kyrtzidis2012-12-101-1/+2
| | | | | | was #import'ed. llvm-svn: 169761
* [libclang] Resolve a cursor that points to a macro name inside a #ifdef/#ifndefArgyrios Kyrtzidis2012-12-081-2/+29
| | | | | | | | | | directive as a macro expansion. This is more of a "macro reference" than a macro expansion but it's close enough for libclang's purposes. If it causes issues we can revisit and introduce a new kind of cursor. llvm-svn: 169666
* [Preprocessor] Enhance Ifdef/Ifndef/Defined preprocessor callbacks to also passArgyrios Kyrtzidis2012-12-083-7/+15
| | | | | | a MacroInfo object if the identifier was a macro name. llvm-svn: 169665
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-0416-58/+57
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* clang/Lex: [CMake] Update CMakefiles since r169229.NAKAMURA Takumi2012-12-041-0/+1
| | | | llvm-svn: 169233
* Refactor recording the preprocessor conditional directive regions out ofArgyrios Kyrtzidis2012-12-043-102/+122
| | | | | | | | | PreprocessingRecord and into its own class, PPConditionalDirectiveRecord. Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord without needing a PreprocessingRecord. llvm-svn: 169229
* In the PreprocessingRecord, to identify the different conditional directive ↵Argyrios Kyrtzidis2012-12-041-16/+19
| | | | | | | | regions use the SourceLocation at the start of the respective region, instead of a unique integer. llvm-svn: 169228
* Try to make the source location information for token pastes a bit more ↵Eli Friedman2012-12-011-0/+6
| | | | | | | | | consistent. Fixes a crash printing diagnostics on the gcc testsuite, and also makes diagnostic range printing print nicer results for token pastes. llvm-svn: 169068
* Comments: no need to escape any characters in \code ... \endcode.Dmitri Gribenko2012-11-301-6/+6
| | | | llvm-svn: 169030
* Support for #pragma region/endregion for MSVC compatibility. Patch thanks ↵Aaron Ballman2012-11-301-0/+25
| | | | | | to pravic! llvm-svn: 169028
* Keep track of modules that have failed to build. If we encounter anDouglas Gregor2012-11-291-1/+8
| | | | | | | | | | | | import of that module elsewhere, don't try to build the module again: it won't work, and the experience is quite dreadful. We track this information somewhat globally, shared among all of the related CompilerInvocations used to build modules on-the-fly, so that a particular Clang instance will only try to build a given module once. Fixes <rdar://problem/12552849>. llvm-svn: 168961
* Remove obsolete comment missed by r162937Andy Gibbs2012-11-281-4/+0
| | | | llvm-svn: 168778
* Teach Lexer::getSpelling about raw string literals. Specifically, if a rawRichard Smith2012-11-281-42/+67
| | | | | | | | string literal needs cleaning (because it contains line-splicing in the encoding prefix or in the ud-suffix), do not clean the section between the double-quotes -- that's the "raw" bit! llvm-svn: 168776
* Clean up code according to coding standardsAndy Gibbs2012-11-171-3/+2
| | | | llvm-svn: 168274
* Fix crash on end-of-file after \ in a char literal, fixes PR14369.Nico Weber2012-11-171-6/+8
| | | | | | | This makes LexCharConstant() look more like LexStringLiteral(), which doesn't have this bug. Add tests for eof after \ for several other cases. llvm-svn: 168269
* Prevent premature macro expansion in __has_builtin, __has_feature,Andy Gibbs2012-11-171-3/+3
| | | | | | | __has_attribute, __has_extension, making them behave more akin to conventional macros. llvm-svn: 168268
* Made the "expected string literal" diagnostic more expressiveAndy Gibbs2012-11-173-5/+12
| | | | llvm-svn: 168267
* Refactored duplicate string literal lexing code within Preprocessor, into aAndy Gibbs2012-11-173-148/+86
| | | | | | | | | | | | | common LexStringLiteral function. In doing so, some consistency problems have been ironed out (e.g. where the first token in the string literal was lexed with macro expansion, but subsequent ones were not) and also an erroneous diagnostic has been corrected. LexStringLiteral is complemented by a FinishLexStringLiteral function which can be used in the situation where the first token of the string literal has already been lexed. llvm-svn: 168266
* Fix handling of invalid uses of the __has_warning builtin macroAndy Gibbs2012-11-171-2/+6
| | | | llvm-svn: 168265
* If an excluded header does not exist, just ignore itDouglas Gregor2012-11-151-1/+3
| | | | llvm-svn: 168077
* Suppress elided variadic macro argument extension diagnostic for macros usingEli Friedman2012-11-143-4/+40
| | | | | | | | | | | | | | | | | | | | | | the related comma pasting extension. In certain cases, we used to get two diagnostics for what is essentially one extension. This change suppresses the first diagnostic in certain cases where we know we're going to print the second diagnostic. The diagnostic is redundant, and it can't be suppressed in the definition of the macro because it points at the use of the macro, so we want to avoid printing it if possible. The implementation works by detecting constructs which look like comma pasting at the time of the definition of the macro; this information is then used when the macro is used. (We can't actually detect whether we're using the comma pasting extension until the macro is actually used, but we can detecting constructs which will be comma pasting if the varargs argument is elided.) <rdar://problem/12292192> llvm-svn: 167907
* Fix an assertion failure printing the unused-label fixit in files using CRLF ↵Eli Friedman2012-11-141-1/+8
| | | | | | line endings. <rdar://problem/12639047>. llvm-svn: 167900
* Revert r167801, "[preprocessor] When #including something that contributes noDaniel Dunbar2012-11-132-23/+1
| | | | | | tokens at all,". This change broke External/Nurbs in LLVM test-suite. llvm-svn: 167858
* UCNs in char literals are done (in LiteralSupport), remove FIXME. Expand UCN ↵Nico Weber2012-11-131-2/+1
| | | | | | FIXME in LexNumericConstant. llvm-svn: 167818
* [preprocessor] When #including something that contributes no tokens at all,Argyrios Kyrtzidis2012-11-132-1/+23
| | | | | | | | | don't recursively continue lexing. This avoids a stack overflow with a sequence of many empty #includes. rdar://11988695 llvm-svn: 167801
* In Lexer::LexTokenInternal, avoid code duplication; no functionality change.Argyrios Kyrtzidis2012-11-131-39/+26
| | | | llvm-svn: 167800
* s/BCPLComment/LineComment/Nico Weber2012-11-111-22/+22
| | | | llvm-svn: 167690
* Improved support for removing the comma preceding __VA_ARGS__ where __VA_ARGS__Andy Gibbs2012-11-091-17/+64
| | | | | | | | | | is empty in a variadic macro expansion. This fixes a divergence in support for the ", ## __VA_ARGS__" GCC extension which differed in behaviour when in strict C99 mode (note: there is no change in behaviour has been made in the gnu99 mode that clang uses by default). In addition, there is improved support for the Microsoft alternative extension ", __VA_ARGS__". llvm-svn: 167613
* LiteralSupport: Don't overflow the temporary buffer when decoding invalid ↵Benjamin Kramer2012-11-081-5/+6
| | | | | | | | | string parts. Instead just use a dummy buffer, we're not going to use the decoded string anyways. Fixes PR14292. llvm-svn: 167594
* LiteralSupport: Clean up style violations. No functionality change.Benjamin Kramer2012-11-081-15/+15
| | | | llvm-svn: 167593
* Remove C++11-isms I just introduced in r167482Douglas Gregor2012-11-061-3/+3
| | | | llvm-svn: 167483
* Introduce inferred framework modules into the module map file,Douglas Gregor2012-11-062-85/+263
| | | | | | | | | | | | | | allowing a module map to be placed one level above the '.framework' directories to specify that all .frameworks within that directory can be inferred as framework modules. One can also specifically exclude frameworks known not to work. This makes explicit (and more restricted) behavior modules have had "forever", where *any* .framework was assumed to be able to be built as a module. That's not necessarily true, so we white-list directories (with exclusions) when those directories have been audited. llvm-svn: 167482
* Rename LangOptions members for address sanitizer and thread sanitizer fromRichard Smith2012-11-051-1/+1
| | | | | | *Sanitizer to Sanitize* in preparation for later patches. llvm-svn: 167405
* Make the FilenameRange of the InclusionDirective callback more accurate,Argyrios Kyrtzidis2012-11-011-2/+2
| | | | | | | | preserve the macro location of the range end if the filename came from a macro. Patch by Kim Gräsman! llvm-svn: 167239
* Handle string encoding diagnostics when there are too many invalid ranges.David Blaikie2012-10-301-1/+2
| | | | llvm-svn: 167059
* improve highlighting of invalid string encodingsSeth Cantrell2012-10-281-11/+49
| | | | | | | limit highlight to exactly the bad encoding, and highlight every bad encoding in a string. llvm-svn: 166900
* Take into account that there may be a BOM at the beginning of the file,Argyrios Kyrtzidis2012-10-251-3/+6
| | | | | | when computing the size of the precompiled preamble. llvm-svn: 166659
* Teach the preprocessor to hold onto the preprocessor options.Douglas Gregor2012-10-241-2/+5
| | | | llvm-svn: 166599
OpenPOWER on IntegriCloud