summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPExpressions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use %select to merge similar diagnostics. NFCCraig Topper2015-11-141-2/+2
| | | | llvm-svn: 253119
* SourceRanges are small and trivially copyable, don't them by reference.Craig Topper2015-10-041-1/+1
| | | | llvm-svn: 249259
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Switch PPCallbacks to take the new MacroDefinition instead of ↵Richard Smith2015-05-041-3/+1
| | | | | | MacroDirective*, in order to preserve full information on module macro expansion. llvm-svn: 236404
* Rename MacroDefinition -> MacroDefinitionRecord, ↵Richard Smith2015-05-041-2/+2
| | | | | | | | | | Preprocessor::MacroDefinition -> MacroDefinition. clang::MacroDefinition now models the currently-defined value of a macro. The previous MacroDefinition type, which represented a record of a macro definition directive for a detailed preprocessing record, is now called MacroDefinitionRecord. llvm-svn: 236400
* clang-format function definition header. NFC.Yaron Keren2015-05-021-2/+1
| | | | llvm-svn: 236390
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-291-10/+6
| | | | | | | | | | | | | | Modules builds fundamentally have a non-linear macro history. In the interest of better source fidelity, represent the macro definition information faithfully: we have a linear macro directive history within each module, and at any point we have a unique "latest" local macro directive and a collection of visible imported directives. This also removes the attendent complexity of attempting to create a correct MacroDirective history (which we got wrong in the general case). No functionality change intended. llvm-svn: 236176
* Commit patch for PR19649. Set the correct sign of wide character for ↵Michael Wong2015-02-241-1/+3
| | | | | | | | | | literals based on underlying type of wchar_t. Reviewed: http://reviews.llvm.org/D7559 Patch by Rachel Craig; Test cases by Hubert Tong. llvm-svn: 230333
* [c++1z] Support for u8 character literals.Richard Smith2014-11-081-0/+1
| | | | llvm-svn: 221576
* Use enumerators instead of hardcoded integers when processing macro names.Serge Pavlov2014-10-241-1/+1
| | | | llvm-svn: 220572
* Fix the buildDavid Majnemer2014-10-131-9/+4
| | | | llvm-svn: 219637
* Improving the "integer constant too large" diagnostics based on post-commit ↵Aaron Ballman2014-07-241-4/+3
| | | | | | feedback from Richard Smith. Amends r213657. llvm-svn: 213865
* Provide extra information in the "integer constant is too large" diagnostic. ↵Aaron Ballman2014-07-221-2/+5
| | | | | | This will be used to improve other diagnostics. llvm-svn: 213657
* Preprocessor: support defined() with operator names for MS compatibilityAlp Toker2014-05-211-5/+3
| | | | | | | | | Also flesh out missing tests, improve diagnostic QOI and fix a couple of corner cases found in the process. Fixes PR10606. llvm-svn: 209276
* [C++11] Use 'nullptr'. Lex edition.Craig Topper2014-05-171-2/+2
| | | | llvm-svn: 209083
* Add two missing entries to the C++11 support page. Bump one relevant diagnosticRichard Smith2014-03-141-2/+3
| | | | | | | | (for an integer too large for any signed type) from Warning to ExtWarn -- it's ill-formed in C++11 and C99 onwards, and UB during translation in C89 and C++98. Add diagnostic groups for two relevant diagnostics. llvm-svn: 203974
* Switch over more of the parser to err_expectedAlp Toker2013-12-301-2/+2
| | | | | | | Includes a fix for a missing highlight range caused by a ',' typo in the PP diagnostics. llvm-svn: 198252
* Cleanup: Switch the preprocessor to err_pp_expected_afterAlp Toker2013-12-301-1/+2
| | | | | | | | | | This is approaching consistency but the PP and Parse categories they still have slightly different wording: def err_pp_expected_after : Error<"missing %1 after %0">; def err_expected_after : Error<"expected %1 after %0">; llvm-svn: 198189
* Support and use token kinds as diagnostic argumentsAlp Toker2013-12-241-3/+3
| | | | | | | | | | | | | | | | | | | Introduce proper facilities to render token spellings using the diagnostic formatter. Replaces most of the hard-coded diagnostic messages related to expected tokens, which all shared the same semantics but had to be multiply defined due to variations in token order or quote marks. The associated parser changes are largely mechanical but they expose commonality in whole chunks of the parser that can now be factored away. This commit uses C++11 typed enums along with a speculative legacy fallback until the transition is complete. Requires corresponding changes in LLVM r197895. llvm-svn: 197972
* Partially revert r186903.Eli Friedman2013-07-261-1/+1
| | | | | | | | It turns out that Plum Hall depends on us not emitting an error on integer literals which fit into long long, but fit into unsigned long long. So C99 conformance requires not conforming to C99. :) llvm-svn: 187172
* Integers which are too large should be an error.Eli Friedman2013-07-231-4/+4
| | | | | | | | Switch some warnings over to errors which should never have been warnings in the first place. (Also, a minor fix to the preprocessor rules for integer literals while I'm here.) llvm-svn: 186903
* Add SourceRange to PPCallbacks::Defined callback.John Thompson2013-07-191-9/+14
| | | | llvm-svn: 186707
* [Preprocessor/Modules] Separate the macro directives kinds into their own ↵Argyrios Kyrtzidis2013-03-261-1/+1
| | | | | | | | | | | | | | | | MacroDirective's subclasses. For each macro directive (define, undefine, visibility) have a separate object that gets chained to the macro directive history. This has several benefits: -No need to mutate a MacroDirective when there is a undefine/visibility directive. Stuff like PPMutationListener become unnecessary. -No need to keep extra source locations for the undef/visibility locations for the define directive object (which is the majority of the directives) -Much easier to hide/unhide a section in the macro directive history. -Easier to track the effects of the directives across different submodules. llvm-svn: 178037
* PR15539: Record "evaluating if/elif condition" flag in the right placeDavid Blaikie2013-03-181-0/+2
| | | | | | | The previous implementation missed the case where the elif condition was evaluated from the context of an #ifdef that was false causing PR15539. llvm-svn: 177345
* [preprocessor] Use MacroDirective in the preprocessor callbacks to make ↵Argyrios Kyrtzidis2013-02-241-7/+7
| | | | | | | | available the full information about the macro (e.g if it was imported and where). llvm-svn: 175978
* Micro-change: moved a brace for better readabilityAlexander Kornienko2013-01-311-2/+2
| | | | llvm-svn: 174075
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-1/+1
| | | | llvm-svn: 171367
* [Preprocessor] Enhance Ifdef/Ifndef/Defined preprocessor callbacks to also passArgyrios Kyrtzidis2012-12-081-3/+9
| | | | | | 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-041-3/+3
| | | | | | | | | | | | | 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
* Change the wording of the extension warning fromDmitri Gribenko2012-09-241-4/+9
| | | | | | | | | > 'long long' is an extension when C99 mode is not enabled to > 'long long' is a C++11 extension while compiling in C++98 mode. llvm-svn: 164545
* Small cleanup of literal semantic analysis: hiding 'char *' pointers behindDmitri Gribenko2012-09-241-2/+1
| | | | | | | StringRef makes code cleaner. Also, make the temporary buffer smaller: 512 characters is unreasonably large for integer literals. llvm-svn: 164484
* The keywords "true" and "false" shouldn't warn under -Wundef.Eli Friedman2012-09-201-1/+3
| | | | llvm-svn: 164279
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-4/+4
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Add support for cooked forms of user-defined-integer-literal andRichard Smith2012-03-081-1/+5
| | | | | | | user-defined-floating-literal. Support for raw forms of these literals to follow. llvm-svn: 152302
* User-defined literals: reject string and character UDLs in all places where theRichard Smith2012-03-061-0/+4
| | | | | | | | | | grammar requires a string-literal and not a user-defined-string-literal. The two constructs are still represented by the same TokenKind, in order to prevent a combinatorial explosion of different kinds of token. A flag on Token tracks whether a ud-suffix is present, in order to prevent clients from needing to look at the token's spelling. llvm-svn: 152098
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-2/+2
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-2/+0
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* -Wc++98-compat warnings for the lexer.Richard Smith2011-10-151-4/+3
| | | | | | | | This also adds a -Wc++98-compat-pedantic for warning on constructs which would be diagnosed by -std=c++98 -pedantic (that is, it warns even on C++11 features which we enable by default, with no warning, in C++98 mode). llvm-svn: 142034
* Add a preprocessor callback that is invoked every time the 'defined'Douglas Gregor2011-10-141-0/+4
| | | | | | operator is seen, from Jason Haslam! llvm-svn: 141926
* Fix missing includes for llvm_unreachableDavid Blaikie2011-09-231-0/+1
| | | | llvm-svn: 140368
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Support code-completion for C++ inline methods and ObjC buffering methods.Argyrios Kyrtzidis2011-09-041-0/+2
| | | | | | | | | | | | | | Previously we would cut off the source file buffer at the code-completion point; this impeded code-completion inside C++ inline methods and, recently, with buffering ObjC methods. Have the code-completion inserted into the source buffer so that it can be buffered along with a method body. When we actually hit the code-completion point the cut-off lexing or parsing. Fixes rdar://10056932&8319466 llvm-svn: 139086
* A couple fixes for preprocessor expressions:Eli Friedman2011-08-031-9/+13
| | | | | | | | | | | 1. Be more tolerant of comments in -CC (comment-preserving) mode. We were missing a few cases. 2. Make sure to expand the second FOO in "#if defined FOO FOO". (See also r97253, which addressed the case of "#if defined(FOO FOO".) Fixes PR10286. llvm-svn: 136748
* Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor2011-07-271-4/+12
| | | | llvm-svn: 136210
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Rename tok::eom to tok::eod.Peter Collingbourne2011-02-281-9/+9
| | | | | | | | The previous name was inaccurate as this token in fact appears at the end of every preprocessing directive, not just macro definitions. No functionality change, except for a diagnostic tweak. llvm-svn: 126631
* Fix diagnostic pragmas.Argyrios Kyrtzidis2010-12-151-1/+1
| | | | | | | | | | | | Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state. Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect a lot of places, like C++ inline methods, template instantiations, the lexer, etc. Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location. Fixes rdar://8365684. llvm-svn: 121873
* move logic for computing signed integer overflow when constant foldingChris Lattner2010-10-131-27/+22
| | | | | | into APInt. llvm-svn: 116453
* Implement code completion for preprocessor expressions and in macroDouglas Gregor2010-08-241-0/+6
| | | | | | arguments. llvm-svn: 111976
OpenPOWER on IntegriCloud