summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* When we parse a pragma, keep track of how that pragma was originallyDouglas Gregor2010-09-092-25/+46
| | | | | | | | spelled (#pragma, _Pragma, __pragma). In -E mode, use that information to add appropriate newlines when translating _Pragma and __pragma into #pragma, like GCC does. Fixes <rdar://problem/8412013>. llvm-svn: 113553
* Clean up some of the CMake dependenciesDouglas Gregor2010-09-081-0/+2
| | | | llvm-svn: 113416
* fix 7320: we can't delete a trailing space if it doesn't exist.Chris Lattner2010-09-051-1/+3
| | | | llvm-svn: 113125
* Use getSpelling to get original text of theFariborz Jahanian2010-09-031-3/+1
| | | | | | c++ operator token. (radar 8328250). llvm-svn: 112977
* Patch to allow alternative representation of c++Fariborz Jahanian2010-09-031-1/+3
| | | | | | | operators (and, or, etc.) to be used as selectors to match g++'s behavior. llvm-svn: 112935
* Prevent warning when built with assert off.Fariborz Jahanian2010-08-311-0/+1
| | | | llvm-svn: 112680
* Some support for unicode string constantsFariborz Jahanian2010-08-311-3/+18
| | | | | | in wide strings. radar 8360841. llvm-svn: 112672
* Implement __has_feature(cxx_inline_namespaces)Sebastian Redl2010-08-311-0/+1
| | | | llvm-svn: 112671
* improve isHexaLiteral to work with escaped newlines and trigraphs,Chris Lattner2010-08-311-7/+8
| | | | | | patch by Francois Pichet! llvm-svn: 112602
* silence a warningChris Lattner2010-08-301-1/+1
| | | | llvm-svn: 112549
* Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt2010-08-303-65/+20
| | | | | | some issues being sorted out. llvm-svn: 112493
* add a fixme.Chris Lattner2010-08-301-1/+5
| | | | llvm-svn: 112491
* use 'features' instead of 'PP->getLangOptions'.Chris Lattner2010-08-301-8/+8
| | | | llvm-svn: 112490
* Now that GCC will have #pragma push/pop (in GCC 4.6), allow theDouglas Gregor2010-08-301-31/+14
| | | | | | | #pragma without requiring it to be in the "clang" namespace, from Louis Gerbarg! llvm-svn: 112484
* In Microsoft compatibility mode, don't parse the exponent as part ofDouglas Gregor2010-08-301-1/+10
| | | | | | | the pp-number in a hexadecimal floating point literal, from Francois Pichet! Fixes PR7968. llvm-svn: 112481
* Implement C++0x user-defined string literals.Alexis Hunt2010-08-293-20/+65
| | | | | | | | | | The extra data stored on user-defined literal Tokens is stored in extra allocated memory, which is managed by the PreprocessorLexer because there isn't a better place to put it that makes sure it gets deallocated, but only after it's used up. My testing has shown no significant slowdown as a result, but independent testing would be appreciated. llvm-svn: 112458
* Complain if a __pragma isn't terminated.John McCall2010-08-291-0/+5
| | | | llvm-svn: 112392
* Add support for Microsoft's __pragma in the preprocessor.John McCall2010-08-282-5/+61
| | | | | | Patch by Francois Pichet! llvm-svn: 112391
* Tweak wording in an assertion, from dawn@burble.org.Douglas Gregor2010-08-261-1/+1
| | | | llvm-svn: 112182
* Introduce a preprocessor code-completion hook for contexts where weDouglas Gregor2010-08-252-6/+29
| | | | | | | expect "natural" language and should not provide any completions, e.g., comments, string literals, #error. llvm-svn: 112054
* Implement code completion for preprocessor expressions and in macroDouglas Gregor2010-08-242-0/+14
| | | | | | arguments. llvm-svn: 111976
* Implement preprocessor code completion where a macro name is expected,Douglas Gregor2010-08-242-1/+15
| | | | | | | e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname> expression in a preprocessor conditional. llvm-svn: 111954
* Introduce basic code-completion support for preprocessor directives,Douglas Gregor2010-08-243-22/+36
| | | | | | e.g., after a "#" we'll suggest #if, #ifdef, etc. llvm-svn: 111943
* Detabify.Eli Friedman2010-08-221-1/+1
| | | | llvm-svn: 111768
* fix PR7943, a corner case with the GNU __VA_ARGS__ comma Chris Lattner2010-08-211-0/+7
| | | | | | swallowing extension. llvm-svn: 111701
* More PCH -> AST renaming.Sebastian Redl2010-08-181-2/+2
| | | | llvm-svn: 111472
* CrashRecovery: Add #pragma clang __debug handle_crash, useful when debuggingDaniel Dunbar2010-08-181-0/+5
| | | | | | | CrashRecovery since it avoids sending a signal which may be intercepted by the debugger. llvm-svn: 111449
* no need to pass bumppointer allocator into macroinfo::destroyChris Lattner2010-08-182-4/+4
| | | | llvm-svn: 111364
* Lex: Add #pragma clang __debug {llvm_fatal_error, llvm_unreachable}, for testingDaniel Dunbar2010-08-171-7/+13
| | | | | | those crash paths. llvm-svn: 111311
* Implement #pragma push_macro, patch by Francois Pichet!Chris Lattner2010-08-173-4/+158
| | | | llvm-svn: 111234
* Don't emit end-of-file diagnostics like "unterminated conditional" orDouglas Gregor2010-08-123-8/+13
| | | | | | "unterminated string" when we're performing code completion. llvm-svn: 110933
* Random temporary string cleanup.Benjamin Kramer2010-08-114-7/+7
| | | | llvm-svn: 110807
* Use precompiled preambles for in-process code completion.Douglas Gregor2010-08-091-2/+16
| | | | llvm-svn: 110596
* Revert r110440, the fix for PR4897. Chris claims to have a better way.Douglas Gregor2010-08-082-50/+28
| | | | llvm-svn: 110544
* Push location through the MacroUndefined PPCallback and use it to print ↵Benjamin Kramer2010-08-072-2/+4
| | | | | | #undefs in -dD mode. (PR7818) llvm-svn: 110523
* Fix the #include search path when reading from stdin, from Jon Simons!Douglas Gregor2010-08-062-28/+50
| | | | | | Fixes PR4897. llvm-svn: 110440
* After a lengthy design discussion, add support for "ownership attributes" ↵Ted Kremenek2010-07-311-0/+3
| | | | | | for malloc/free checking. Patch by Andrew McGregor! llvm-svn: 109939
* Transcribe clattner email to SVN.Daniel Dunbar2010-07-291-1/+1
| | | | llvm-svn: 109727
* Change #pragma crash to segv, instead of abort.Daniel Dunbar2010-07-291-1/+1
| | | | llvm-svn: 109725
* Preprocessor: Add support for '#pragma clang __debug crash' and '#pragma clangDaniel Dunbar2010-07-281-0/+28
| | | | | | | | __debug overflow_stack'. - For testing crash reporting stuff... you'd think I could just use some C++ code but Doug keeps fixing stuff! llvm-svn: 109587
* Record macros in dependent PCHs. Also add various info tables to dependent ↵Sebastian Redl2010-07-271-0/+1
| | | | | | PCHs; tests for this to follow. llvm-svn: 109554
* Add PTHLexer::LexEndOfFile() to emit diagnostics at end-of-file similar to ↵Ted Kremenek2010-07-271-4/+25
| | | | | | those by Lexer::LexEndOfFile(). llvm-svn: 109486
* Introduce basic support for loading a precompiled preamble whileDouglas Gregor2010-07-262-3/+21
| | | | | | | | | | | | | | | | | | | | | | | reparsing an ASTUnit. When saving a preamble, create a buffer larger than the actual file we're working with but fill everything from the end of the preamble to the end of the file with spaces (so the lexer will quickly skip them). When we load the file, create a buffer of the same size, filling it with the file and then spaces. Then, instruct the lexer to start lexing after the preamble, therefore continuing the parse from the spot where the preamble left off. It's now possible to perform a simple preamble build + parse (+ reparse) with ASTUnit. However, one has to disable a bunch of checking in the PCH reader to do so. That part isn't committed; it will likely be handled with some other kind of flag (e.g., -fno-validate-pch). As part of this, fix some issues with null termination of the memory buffers created for the preamble; we were trying to explicitly NULL-terminate them, even though they were also getting implicitly NULL terminated, leading to excess warnings about NULL characters in source files. llvm-svn: 109445
* Fix namespace polution.Dan Gohman2010-07-261-0/+4
| | | | llvm-svn: 109440
* Improve performance during cursor traversal when a region of interestDouglas Gregor2010-07-221-0/+53
| | | | | | | | | | | | | | | | | | | | | is present. Rather than using clang_getCursorExtent(), which requires us to lex the token at the ending position to determine its length. Then, we'd be comparing [a, b) source ranges that cover the characters in the range rather than the normal behavior for Clang's source ranges, which covers the tokens in the range. However, relexing causes us to read the source file (which may come from a precompiled header), which is rather unfortunate and affects performance. In the new scheme, we only use Clang-style source ranges that cover the tokens in the range. At the entry points where this matters (clang_annotateTokens, clang_getCursor), we make sure to move source locations to the start of the token. Addresses most of <rdar://problem/8049381>. llvm-svn: 109134
* Introduce a new lexer function to compute the "preamble" of a file,Douglas Gregor2010-07-201-0/+125
| | | | | | | | | which is the part of the file that contains all of the initial comments, includes, and preprocessor directives that occur before any of the actual code. Added a new -print-preamble cc1 action that is only used for testing. llvm-svn: 108913
* Complain when string literals are too long for the active languageDouglas Gregor2010-07-201-0/+14
| | | | | | standard's minimum requirements. llvm-svn: 108837
* BUILD_ARCHIVE is the default for libraries, no need to set it.Chris Lattner2010-07-181-1/+0
| | | | llvm-svn: 108633
* Add another terrible VC++ compatibility hack: allow users toChris Lattner2010-07-171-2/+7
| | | | | | | allow invalid token pastes (when in -fms-extensions mode) with -Wno-invalid-token-paste llvm-svn: 108624
* Modify the pragma handlers to accept and use StringRefs instead of ↵Argyrios Kyrtzidis2010-07-132-75/+61
| | | | | | | | | | | IdentifierInfos. When loading the PCH, IdentifierInfos that are associated with pragmas cause declarations that use these identifiers to be deserialized (e.g. the "clang" pragma causes the "clang" namespace to be loaded). We can avoid this if we just use StringRefs for the pragmas. As a bonus, since we don't have to create and pass IdentifierInfos, the pragma interfaces get a bit more simplified. llvm-svn: 108237
OpenPOWER on IntegriCloud