summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/TokenLexer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Only resolve a macro's instantiation loc once per macro, instead of onceChris Lattner2009-01-261-0/+7
| | | | | | | | per token lexed from it. This speeds up clang on c99-intconst-1.c from the GCC testsuite from 3.64s to 2.66s (36%). This reduces the number of binary search FileID lookups from 251570522 to 114175649 on this testcase. llvm-svn: 62992
* Check in the long promised SourceLocation rewrite. This lays theChris Lattner2009-01-261-3/+4
| | | | | | | | | | ground work for implementing #line, and fixes the "out of macro ID's" problem. There is nothing particularly tricky about the code, other than the very performance sensitive SourceManager::getFileID() method. llvm-svn: 62978
* This is a follow-up to r62675:Chris Lattner2009-01-231-3/+8
| | | | | | | | | | Refactor how the preprocessor changes a token from being an tok::identifier to a keyword (e.g. tok::kw_for). Instead of doing this in HandleIdentifier, hoist this common case out into the caller, so that every keyword doesn't have to go through HandleIdentifier. This drops time in HandleIdentifier from 1.25ms to .62ms, and speeds up clang -Eonly with PTH by about 1%. llvm-svn: 62855
* Add a bit to IdentifierInfo that acts as a simple predicate whichChris Lattner2009-01-211-2/+3
| | | | | | | | | tells us whether Preprocessor::HandleIdentifier needs to be called. Because this method is only rarely needed, this saves a call and a bunch of random checks. This drops the time in HandleIdentifier from 3.52ms to .98ms on cocoa.h on my machine. llvm-svn: 62675
* Make SourceLocation::getFileLoc private to reduce the API exposure of Chris Lattner2009-01-191-4/+12
| | | | | | | SourceLocation. This requires making some cleanups to token pasting and _Pragma expansion. llvm-svn: 62490
* make the verbose raw-lexer ctor fully explicit instead of havingChris Lattner2009-01-171-4/+4
| | | | | | embedded magic. llvm-svn: 62417
* this massive patch introduces a simple new abstraction: it makesChris Lattner2009-01-171-2/+1
| | | | | | | | | | | | | | | "FileID" a concept that is now enforced by the compiler's type checker instead of yet-another-random-unsigned floating around. This is an important distinction from the "FileID" currently tracked by SourceLocation. *That* FileID may refer to the start of a file or to a chunk within it. The new FileID *only* refers to the file (and its #include stack and eventually #line data), it cannot refer to a chunk. FileID is a completely opaque datatype to all clients, only SourceManager is allowed to poke and prod it. llvm-svn: 62407
* Remove the last of the old-style Preprocessor::Diag methods.Chris Lattner2008-11-181-2/+2
| | | | llvm-svn: 59554
* Simplify raw mode lexing by treating an unterminate /**/ comment theChris Lattner2008-10-121-5/+1
| | | | | | | | same we we do an unterminated string or character literal. This makes it so we can guarantee that the lexer never calls into the preprocessor (which would be suicide for a raw lexer). llvm-svn: 57395
* Change how raw lexers are handled: instead of creating them and thenChris Lattner2008-10-121-6/+6
| | | | | | | | | | | using LexRawToken, create one and use LexFromRawLexer. This avoids twiddling the RawLexer flag around and simplifies some code (even speeding raw lexing up a tiny bit). This change also improves the token paster to use a Lexer on the stack instead of new/deleting it. llvm-svn: 57393
* whitespace and comment changes, to fix grammar and 80 col violationsNico Weber2008-09-291-1/+1
| | | | llvm-svn: 56776
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+488
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud