summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
* When placing an annotation token over an existing annotation token, make ↵Sebastian Redl2010-02-081-1/+1
| | | | | | sure that the new token's range extends to the end of the old token. Assert that in AnnotateCachedTokens. Fixes PR6248. llvm-svn: 95555
* don't inform comment handlers about comments in #if 0 blocks,Chris Lattner2010-02-031-7/+9
| | | | | | | | | doing so invalidates the file guard optimization and is not in the spirit of "#if 0" because it is supposed to completely skip everything, even if it isn't lexically valid. Patch by Abramo Bagnara! llvm-svn: 95253
* Fix subtle bug in Preprocessor::AdvanceToTokenCharacter(): use '+=' instead ↵Ted Kremenek2010-01-291-1/+1
| | | | | | of '='. llvm-svn: 94830
* Use raw_ostreams in Preprocessor::ExpandBuiltinMacro. Still not nice but ↵Benjamin Kramer2010-01-271-19/+17
| | | | | | less fragile than the old code. llvm-svn: 94679
* Fix typo in commentDouglas Gregor2010-01-261-1/+1
| | | | llvm-svn: 94576
* -fno-rtti is now the default.Chris Lattner2010-01-241-1/+0
| | | | llvm-svn: 94379
* ui64, etc. are valid VS suffixes.Fariborz Jahanian2010-01-221-1/+1
| | | | | | Fixes radar 7562363. llvm-svn: 94224
* Teach CIndex's cursor visitor to restrict its traversal to a specificDouglas Gregor2010-01-222-11/+11
| | | | | | | | | | | | | | region of interest (if provided). Implement clang_getCursor() in terms of this traversal rather than using the Index library; the unified cursor visitor is more complete, and will be The Way Forward. Minor other tweaks needed to make this work: - Extend Preprocessor::getLocForEndOfToken() to accept an offset from the end, making it easy to move to the last character in the token (rather than just past the end of the token). - In Lexer::MeasureTokenLength(), the length of whitespace is zero. llvm-svn: 94200
* revert my patch for rdar://7520940 that warns when a published headerChris Lattner2010-01-223-18/+4
| | | | | | | is #included with "foo.h" style syntax instead of framework syntax. It produced too much noise. llvm-svn: 94120
* allow the HandlerComment callback to push tokens into theChris Lattner2010-01-182-17/+34
| | | | | | | preprocessor. This could be used by an OpenMP implementation or something. Patch by Abramo Bagnara! llvm-svn: 93795
* simplify the code for skipping in a #if 0 block. The CurLexerChris Lattner2010-01-181-4/+1
| | | | | | | pointer is always non-null because the PTH case exits earlier in the method. llvm-svn: 93794
* Add a bunch more feature-checking macros for C++0x features. Some of these areAlexis Hunt2010-01-131-0/+10
| | | | | | | disabled with the intent that users can start with them now and not have to change a thing to have them work when we implement the features. llvm-svn: 93312
* add a TODO for a perf improvement in LexIdentifier.Chris Lattner2010-01-111-2/+5
| | | | llvm-svn: 93141
* Do not parse hexadecimal floating point literals in C++0x mode because they areAlexis Hunt2010-01-102-3/+9
| | | | | | | | | | | | | | | | | | incompatible with user-defined literals, specifically with the following form: 0x1p+1 The preprocessing-number token extends only as far as the 'p'; the '+' is not included. Previously we could get away with this extension as p was an invalid suffix, but now with user-defined literals, 'p' might well be a valid suffix and we are forced to consider it as such. This patch also adds a warning in non-0x C++ modes telling the user that this extension is incompatible with C++0x that is enabled by default (previously and with other languages, we warn only with a compliance option such as -pedantic). llvm-svn: 93135
* Simplify code. No functionality change.Benjamin Kramer2010-01-101-18/+1
| | | | llvm-svn: 93114
* stringref'ize a bunch of filename handling logic. MuchChris Lattner2010-01-105-92/+73
| | | | | | nicer than passing around two const char*'s. llvm-svn: 93094
* clarify comment.Chris Lattner2010-01-101-2/+2
| | | | llvm-svn: 93084
* implement rdar://7520940: published framework headers shouldChris Lattner2010-01-103-3/+16
| | | | | | | import other headers within the same framework with the full framework path, not with a relative include. llvm-svn: 93083
* Simplify with StringSwitch.Benjamin Kramer2010-01-091-28/+12
| | | | llvm-svn: 93064
* Teach Preprocessor::macro_begin/macro_end to lazily load all macroDouglas Gregor2010-01-042-4/+32
| | | | | | | | definitions from a precompiled header. This ensures that code-completion with macro names behaves the same with or without precompiled headers. llvm-svn: 92497
* Avoid an unnecessary copy of Predefines. getMemBufferCopy does the null ↵Benjamin Kramer2009-12-311-12/+3
| | | | | | termination for us. llvm-svn: 92358
* Convert to StringRef, avoid a memcpy in the common case.Benjamin Kramer2009-12-311-19/+16
| | | | llvm-svn: 92357
* use best-fit instead of first-fit when reusing a MacroArgs object,Chris Lattner2009-12-281-7/+16
| | | | | | this speeds up Eonly on the testcase in PR5888 from 30.5s to 0.85s llvm-svn: 92203
* The PreExpArgTokens array is indexed with an argument #,Chris Lattner2009-12-283-7/+8
| | | | | | | not a token number. Fix the reserve logic to get the right amount of space. llvm-svn: 92202
* Diagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641John McCall2009-12-241-13/+4
| | | | llvm-svn: 92127
* comment tweakChris Lattner2009-12-231-1/+1
| | | | llvm-svn: 92055
* fix the microsoft "charify" extension to return the charified token Chris Lattner2009-12-231-1/+1
| | | | | | | as a character literal, not a string literal. This might fix rdar://7486575 llvm-svn: 92025
* Eliminate a completely unnecessary buffer copy when parsing float literals.John McCall2009-12-231-6/+1
| | | | llvm-svn: 91974
* reimplement r90860, fixing a couple of problems:Chris Lattner2009-12-171-9/+21
| | | | | | | | | 1. Don't make a copy of LangOptions every time a lexer is created. 2. Don't make CharInfo global mutable state. 3. Fix the implementation to properly treat ^Z as EOF instead of as horizontal whitespace, which matches the semantic implemented by VC++. llvm-svn: 91586
* enable reuse of MacroArgs objects. This is a small (2.5%) win Chris Lattner2009-12-151-10/+32
| | | | | | | | | | on PR5610 (2.185 -> 2.130s). The big issue is that this is making insanely huge macro argument lists with over a million tokens in it. The reason that mallco and free are so expensive is that we are actually going to the kernel to get it, and switching to a bump pointer allocator won't change this in an interesting way. llvm-svn: 91449
* set up the machinery for a MacroArgs cache hanging off Preprocessor.Chris Lattner2009-12-153-2/+29
| | | | | | | | | We creating and free thousands of MacroArgs objects (and the related std::vectors hanging off them) for the testcase in PR5610 even though there are only ~20 live at a time. This doesn't actually use the cache yet. llvm-svn: 91391
* move the VarargsElided member of MacrosArgs to shrink the MacroArgs structChris Lattner2009-12-144-15/+17
| | | | | | | on 64-bit targets. Pass Preprocessor into create/destroy methods of MacroArgs even though it isn't used yet. llvm-svn: 91345
* fix typoChris Lattner2009-12-141-1/+1
| | | | llvm-svn: 91343
* teach clang to recover gracefully from conflict markers left in sourceChris Lattner2009-12-141-14/+133
| | | | | | files: PR5238. llvm-svn: 91270
* fix rdar://7466570 - Be more bug compatible with GCC when it comes to Chris Lattner2009-12-141-2/+21
| | | | | | | | expanding directives withing macro expansions. This is undefined behavior according to 6.10.3p11, so we might as well be undefined in ways similar to GCC. llvm-svn: 91266
* formatting changes.Chris Lattner2009-12-141-4/+5
| | | | llvm-svn: 91263
* reduce indentation.Chris Lattner2009-12-141-15/+14
| | | | llvm-svn: 91262
* Don't expand tabs when computing the offset from the code-completion columnDouglas Gregor2009-12-081-8/+2
| | | | llvm-svn: 90881
* Integrate the following from the 'objective-rewrite' branch:Steve Naroff2009-12-081-4/+9
| | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=80043 llvm-svn: 90860
* Get rid of some diagnostics that don't follow our rules for -pedanticEli Friedman2009-12-081-7/+0
| | | | | | | diagnostics (specifically, that any extension in a compiler-reserved namespace shouldn't trigger a diagnostic). llvm-svn: 90826
* Unbreak and add test case for r90276, a situation in which getBuffer is ↵Daniel Dunbar2009-12-061-1/+1
| | | | | | | | expected to fail. Also, update SourceManager.h doxyments for getBuffer() to reflect reality. llvm-svn: 90701
* Change Preprocessor::EnterSourceFile to make ErrorStr non-optional, clients ↵Daniel Dunbar2009-12-063-5/+8
| | | | | | should be forced to deal with error conditions. llvm-svn: 90700
* minor tidy.Chris Lattner2009-12-041-6/+5
| | | | llvm-svn: 90543
* Minor cleanup to the code-completion-point logic suggested by Chris.Douglas Gregor2009-12-031-1/+1
| | | | llvm-svn: 90459
* Add 'has_feature(cxx_exceptions)' to allow code to determine via ↵Ted Kremenek2009-12-031-0/+3
| | | | | | preprocessor logic if C++ exceptions are enabled. llvm-svn: 90378
* Rename has_feature(rtti) to has_feature(cxx_rtti) for clarity.Ted Kremenek2009-12-031-3/+3
| | | | llvm-svn: 90376
* Add "has_feature" support for C++ RTTI.Ted Kremenek2009-12-031-0/+3
| | | | llvm-svn: 90368
* Extend the source manager with the ability to override the contents ofDouglas Gregor2009-12-022-23/+68
| | | | | | | | | | files with the contents of an arbitrary memory buffer. Use this new functionality to drastically clean up the way in which we handle file truncation for code-completion: all of the truncation/completion logic is now encapsulated in the preprocessor where it belongs (<rdar://problem/7434737>). llvm-svn: 90300
* pass the reason for failure up from MemoryBuffer and report itChris Lattner2009-12-012-4/+7
| | | | | | | | | | | | in diagnostics when we fail to open a file. This allows us to report things like: $ clang test.c -I. test.c:2:10: fatal error: error opening file './foo.h': Permission denied #include "foo.h" ^ llvm-svn: 90276
* Fix PR5633 by making the preprocessor handle the case where we canChris Lattner2009-11-303-11/+22
| | | | | | | | | | stat a file but where mmaping it fails. In this case, we emit an error like: t.c:1:10: fatal error: error opening file '../../foo.h' instead of "cannot find file". llvm-svn: 90110
OpenPOWER on IntegriCloud