summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Remove the check for repeated tok::eofs, we are not supposed to go past eof ↵Argyrios Kyrtzidis2010-07-121-9/+4
| | | | | | | | so this code is totally unnecessary. llvm-svn: 108199
* If we are past tok::eof and in caching lex mode, avoid caching repeated ↵Argyrios Kyrtzidis2010-07-121-4/+12
| | | | | | tok::eofs. llvm-svn: 108175
* we do in fact have to cache the EOF token returned by the preprocessor.Chris Lattner2010-07-121-6/+3
| | | | | | | | | | In the case of backtracking, the cached token lexer will be the only lexer on the stack, without this the token stack will be empty and EOF won't be returned. This fixes PR7072. llvm-svn: 108124
* fix PR4499, patch by Kyle Dean!Chris Lattner2010-07-071-24/+16
| | | | llvm-svn: 107836
* Implement support for #pragma message, patch by Michael Spencer!Chris Lattner2010-06-261-1/+72
| | | | llvm-svn: 106950
* More clang support for darwin tls. Add a __has_feature macro andEric Christopher2010-06-241-0/+2
| | | | | | target specific preprocessor define as well. llvm-svn: 106715
* Remove a dead argument to ProcessUCNEscape.Chris Lattner2010-06-151-10/+5
| | | | | | | | | | Fix string concatenation to treat escapes in concatenated strings that are wide because of other string chunks to process the escapes as wide themselves. Before we would warn about and miscompile the attached testcase. This fixes rdar://8040728 - miscompile + warning: hex escape sequence out of range llvm-svn: 106012
* Preprocessor: Ignore unknown pragmas in -E -dM and -Eonly modes.Daniel Dunbar2010-06-111-0/+8
| | | | llvm-svn: 105830
* Fix memory leak in Preprocessor where MacroInfo objects in the MICache ↵Ted Kremenek2010-06-081-0/+8
| | | | | | | | wouldn't have their associated SmallVectors get deallocated. llvm-svn: 105658
* Makefiles: Set Clang CPP compiler flags in a single location, instead of ↵Daniel Dunbar2010-06-081-2/+0
| | | | | | scattered throughout the project Makefiles. llvm-svn: 105638
* Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.Daniel Dunbar2010-06-081-3/+3
| | | | | | - This eliminates most dependencies on how Clang is installed relative to LLVM. llvm-svn: 105637
* simpler fix for rdar://8044135 - escaped newlines have alreadyChris Lattner2010-05-301-10/+7
| | | | | | been processed, so they don't have to be tip-toed around. llvm-svn: 105182
* Improve our handling of NULL after an escaping '\' in a stringDouglas Gregor2010-05-301-2/+7
| | | | | | literal. Fixes <rdar://problem/8044135>. llvm-svn: 105181
* Fix a miscompile of wchar pascal strings.Fariborz Jahanian2010-05-281-0/+2
| | | | | | (radar 8020384) llvm-svn: 104996
* Tell the string literal parser when it's not permitted to emitDouglas Gregor2010-05-261-20/+35
| | | | | | | | diagnostics. That would be while we're parsing string literals for the sole purpose of producing a diagnostic about them. Fixes <rdar://problem/8026030>. llvm-svn: 104684
* Improve code completion in failure cases in two ways:Douglas Gregor2010-05-251-0/+3
| | | | | | | | | | | 1) Suppress diagnostics as soon as we form the code-completion token, so we don't get any error/warning spew from the early end-of-file. 2) If we consume a code-completion token when we weren't expecting one, go into a code-completion recovery path that produces the best results it can based on the context that the parser is in. llvm-svn: 104585
* robustify the conflict marker stuff. Don't add 7 twice, which wouldChris Lattner2010-05-171-1/+2
| | | | | | | | | | | | | | | | | | | | | make it miss (invalid) things like: <<<<<<< >>>>>>> and crash if <<<<<<< was at the end of the line. When we find a >>>>>>> that is not at the end of the line, make sure to reset Pos so we don't crash on something like: <<<<<<< >>>>>>> This isn't worth making testcases for, since each would require a new file. rdar://7987078 - signal 11 compiling "<<<<<<<<<<" llvm-svn: 103968
* when code completing inside a C-style block comment, don't emit errors aboutChris Lattner2010-05-161-2/+3
| | | | | | | | a missing */ since we truncated the file. This fixes rdar://7948776 llvm-svn: 103913
* Add '__has_feature' support for weak ObjC classes.Ted Kremenek2010-04-291-0/+1
| | | | llvm-svn: 102588
* Sort '__has_feature' cases. No functionality change.Ted Kremenek2010-04-291-15/+15
| | | | llvm-svn: 102587
* push some source location information down through the compiler,Chris Lattner2010-04-203-19/+17
| | | | | | | | into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location. llvm-svn: 101939
* add a PPCallback handler for a skipped #include, patch byChris Lattner2010-04-191-6/+9
| | | | | | Zhanyong Wan! llvm-svn: 101813
* emit warn_char_constant_too_large at most once per literal, fixing PR6852Chris Lattner2010-04-161-1/+4
| | | | llvm-svn: 101580
* Improve line marker directive locations, patch by Jordy RoseChris Lattner2010-04-141-2/+3
| | | | llvm-svn: 101226
* make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."Chris Lattner2010-04-141-2/+4
| | | | | | when avoiding paste. Patch by David Peixotto! llvm-svn: 101218
* fix a minor bug I noticed while work with Jordy's patch for PR6101,Chris Lattner2010-04-121-2/+4
| | | | | | | | | | | | | | | | | in an input file like this: # 42 int x; we were emitting: # <something> int x; (with a space before the int) because we weren't clearing the leading whitespace flag properly after the \n from the directive was handled. llvm-svn: 101084
OpenPOWER on IntegriCloud