summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* PR4991: Properly remove trailing newline from __TIMESTAMP__.Benjamin Kramer2009-09-161-3/+3
| | | | | | Replace strcpy with memcpy while at it. llvm-svn: 82043
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-0919-991/+991
| | | | llvm-svn: 81346
* Updated GNU runtime non-fragile ABI.David Chisnall2009-08-311-0/+3
| | | | | | | Added -fconstant-string-class= option. Added __has_feature() test for non-fragile ABI. llvm-svn: 80591
* Replace cerr with errs().Benjamin Kramer2009-08-232-30/+30
| | | | llvm-svn: 79854
* Don't install Clang libraries.Douglas Gregor2009-08-231-0/+3
| | | | llvm-svn: 79824
* Update lexer to work with the new APFloat string parsing.Erick Tryzelaar2009-08-161-2/+6
| | | | llvm-svn: 79211
* CharLiteralParser::IsMultiChar was sometimes uninitialized.Daniel Dunbar2009-07-291-1/+2
| | | | llvm-svn: 77420
* fix segfault (because of erasing after the vector boundaries) when the ↵Nuno Lopes2009-07-261-1/+2
| | | | | | cached token position is at the end llvm-svn: 77159
* Lexically order files in CMakeLists.txt files.Ted Kremenek2009-07-151-2/+2
| | | | llvm-svn: 75832
* Fix the buildAlisdair Meredith2009-07-141-2/+6
| | | | llvm-svn: 75627
* Basic support for C++0x unicode types. Support for literals will follow in ↵Alisdair Meredith2009-07-141-1/+3
| | | | | | an incremental patch llvm-svn: 75622
* There is no need to value initialize this array.Daniel Dunbar2009-07-131-1/+1
| | | | llvm-svn: 75517
* add push/pop semantics for diagnostics. Patch by Louis Gerbarg!Chris Lattner2009-07-121-8/+36
| | | | llvm-svn: 75431
* Convert the CharInfo table to be statically initialized, instead of ↵Chris Lattner2009-07-071-15/+86
| | | | | | dynamically initialized. Patch by Ryan Flynn! llvm-svn: 74919
* fix an out-of-date comment.Chris Lattner2009-07-071-5/+3
| | | | llvm-svn: 74894
* Add support for retrieving the Doxygen comment associated with a givenDouglas Gregor2009-07-023-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | declaration in the AST. The new ASTContext::getCommentForDecl function searches for a comment that is attached to the given declaration, and returns that comment, which may be composed of several comment blocks. Comments are always available in an AST. However, to avoid harming performance, we don't actually parse the comments. Rather, we keep the source ranges of all of the comments within a large, sorted vector, then lazily extract comments via a binary search in that vector only when needed (which never occurs in a "normal" compile). Comments are written to a precompiled header/AST file as a blob of source ranges. That blob is only lazily loaded when one requests a comment for a declaration (this never occurs in a "normal" compile). The indexer testbed now supports comment extraction. When the -point-at location points to a declaration with a Doxygen-style comment, the indexer testbed prints the associated comment block(s). See test/Index/comments.c for an example. Some notes: - We don't actually attempt to parse the comment blocks themselves, beyond identifying them as Doxygen comment blocks to associate them with a declaration. - We won't find comment blocks that aren't adjacent to the declaration, because we start our search based on the location of the declaration. - We don't go through the necessary hops to find, for example, whether some redeclaration of a declaration has comments when our current declaration does not. Similarly, we don't attempt to associate a \param Foo marker in a function body comment with the parameter named Foo (although that is certainly possible). - Verification of my "no performance impact" claims is still "to be done". llvm-svn: 74704
* Fix our check for "random whitespace between a \ and newline" to workChris Lattner2009-06-231-2/+3
| | | | | | | | | | | | | | | with dos style newlines. I have a trivial test for this: // RUN: clang-cc %s -verify #define test(x, y) \ x ## y but I don't know how to get svn to not change newlines and testrunner doesn't work with dos style newlines either, so "not worth it". :) rdar://6994000 llvm-svn: 73945
* Fix a crash that can occur when a #pragma handler eats to the end of theChris Lattner2009-06-181-1/+1
| | | | | | | | line, and when the pragma is at the end of a file. In this case, the last token consumed could pop the lexer, invalidating CurPPLexer. Thanks to Peter Thoman for pointing it out. llvm-svn: 73689
* my refactoring of builtins changed target-specific builtins to only beChris Lattner2009-06-161-1/+1
| | | | | | | | | registered when PCH wasn't being used. We should always install (in BuiltinInfo) information about target-specific builtins, but we shouldn't register any builtin identifier infos. This fixes the build of apps that use PCH and target specific builtins together. llvm-svn: 73492
* PR4395: Don't detect token concatenation in C mode for Eli Friedman2009-06-151-3/+5
| | | | | | C++-specific tokens. llvm-svn: 73408
* Fix #pragma GCC system_header by making it insert a virtual linemarker intoChris Lattner2009-06-151-2/+16
| | | | | | | the file at the point of the pragma. This allows clang to know that all sourcelocations after the pragma are in a system header. llvm-svn: 73376
* use the new Path::isAbsolute function, fixing a fixme. Patch by Gregory ↵Chris Lattner2009-06-151-3/+1
| | | | | | Curfman! llvm-svn: 73370
* implement and document a new __has_feature and __has_builtin magic Chris Lattner2009-06-131-13/+82
| | | | | | | | | builtin preprocessor macro. This appears to work with two caveats: 1) builtins are registered in -E mode, and 2) target-specific builtins are unconditionally registered even if they aren't supported by the target (e.g. SSE4 builtin when only SSE1 is enabled). llvm-svn: 73289
* PR4353: Add support for \E as a character escape.Eli Friedman2009-06-101-1/+4
| | | | llvm-svn: 73153
* Move CharIsSigned from TargetInfo to LangOptions.Eli Friedman2009-06-052-2/+2
| | | | llvm-svn: 72928
* PR4283: Don't truncate multibyte character constants in the Eli Friedman2009-06-012-2/+7
| | | | | | preprocessor. llvm-svn: 72686
* fix the "pasting formed 'a]', an invalid preprocessing token"Chris Lattner2009-05-281-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic to include the full instantiation location for the invalid paste. For: #define foo(a, b) a ## b #define bar(x) foo(x, ]) bar(a) bar(zdy) Instead of: t.c:3:22: error: pasting formed 'a]', an invalid preprocessing token #define foo(a, b) a ## b ^ t.c:3:22: error: pasting formed 'zdy]', an invalid preprocessing token we now produce: t.c:7:1: error: pasting formed 'a]', an invalid preprocessing token bar(a) ^ t.c:4:16: note: instantiated from: #define bar(x) foo(x, ]) ^ t.c:3:22: note: instantiated from: #define foo(a, b) a ## b ^ t.c:8:1: error: pasting formed 'zdy]', an invalid preprocessing token bar(zdy) ^ t.c:4:16: note: instantiated from: #define bar(x) foo(x, ]) ^ t.c:3:22: note: instantiated from: #define foo(a, b) a ## b ^ llvm-svn: 72519
* Don't vary token concatenation based on the language options; this Eli Friedman2009-05-271-6/+3
| | | | | | behavior is more likely to be confusing than useful. llvm-svn: 72499
* Make the bad paste diagnostic print the entire pasted token.Eli Friedman2009-05-271-1/+1
| | | | llvm-svn: 72497
* Fix a couple of bugs:Chris Lattner2009-05-251-18/+27
| | | | | | | | | | | | 1. When we accept "#garbage" in asm-with-cpp mode, change the token kind of the # to unknown so that the preprocessor won't try to process it as a real #. This fixes a crash on the attached example 2. Fix macro definition extents processing to handle #foo at the end of a macro to say the definition ends with the foo, not the #. This is a follow-on fix to r72283, and rdar://6916026 llvm-svn: 72388
* improve comment, no functionality change.Chris Lattner2009-05-251-10/+15
| | | | llvm-svn: 72386
* Make sure an invalid concatentaion doesn't insert whitespace before Eli Friedman2009-05-241-1/+5
| | | | | | the RHS. Fixes assembler-with-cpp issue reported on cfe-dev. llvm-svn: 72370
* In assembler-with-cpp mode, don't error on '#' (stringize) operator applied toDaniel Dunbar2009-05-221-3/+5
| | | | | | non-argument names, pass the tokens through. llvm-svn: 72283
* The TokenLexer may encounter annotations if the parser enters them using ↵Argyrios Kyrtzidis2009-05-221-1/+2
| | | | | | | | Preprocessor::EnterTokenStream. So check for annotation before using the Token's IdentifierInfo. llvm-svn: 72278
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-212-3/+4
| | | | llvm-svn: 72210
* PR3942: Don't warn on unsigned overflow in preprocessor expressions.Eli Friedman2009-05-161-4/+4
| | | | llvm-svn: 71960
* Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.Chris Lattner2009-05-131-2/+2
| | | | llvm-svn: 71643
* When we expect two arguments but have zero, make sure to addChris Lattner2009-05-132-0/+6
| | | | | | | | | two empty arguments. Also, add an assert so that this bug manifests as an assertion failure, not a valgrind problem. This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion llvm-svn: 71616
* accept "#pragma clang foo" where we accept "#pragma GCC foo".Chris Lattner2009-05-121-1/+12
| | | | llvm-svn: 71572
* Fix for PR4132: make sure to insert whitespace consistently before a Eli Friedman2009-05-031-1/+1
| | | | | | pasted token. llvm-svn: 70793
* Implement -Wfour-char-constants, which is an extension, not an extwarn,Chris Lattner2009-04-281-23/+23
| | | | | | and apparently not part of -Wall llvm-svn: 70329
* implement -WmulticharChris Lattner2009-04-281-1/+2
| | | | llvm-svn: 70315
* Emit keyword extension warning in all modes, not just C99 mode.Eli Friedman2009-04-281-1/+3
| | | | llvm-svn: 70283
* Get rid of some useless uses of NoExtensions. The philosophy here is Eli Friedman2009-04-282-7/+4
| | | | | | | | | | | | that if we're going to print an extension warning anyway, there's no point to changing behavior based on NoExtensions: it will only make error recovery worse. Note that this doesn't cause any behavior change because NoExtensions isn't used by the current front-end. I'm still considering what to do about the remaining use of NoExtensions in IdentifierTable.cpp. llvm-svn: 70273
* Lazily load the controlling macros for all of the headers known in theDouglas Gregor2009-04-251-6/+20
| | | | | | | | PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes us from reading 503 identifiers down to 37 and from 470 macros down to 4. It also results in an 8% performance improvement. llvm-svn: 70094
* Silence gcc warnings.Eli Friedman2009-04-251-2/+2
| | | | llvm-svn: 70086
* Add PCH support for #import.Steve Naroff2009-04-242-4/+10
| | | | llvm-svn: 69987
* fix rdar://6816766 - Crash with function-like macro test at end of directive.Chris Lattner2009-04-241-0/+2
| | | | llvm-svn: 69964
* simplification and speedupChris Lattner2009-04-241-1/+1
| | | | llvm-svn: 69963
* apply Eli's patch to fix PR4008, with a testcase. Thanks Eli!Chris Lattner2009-04-211-0/+8
| | | | llvm-svn: 69750
OpenPOWER on IntegriCloud