aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ScratchBuffer.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-04-06MSan told me that we actually dump the entire scratch buffer into PCH files, ↵Benjamin Kramer1-3/+4
initialize it. Writing 4k of zeros is preferrable to 4k of random memory. Document that. While there remove the initialization of the first byte of the buffer and start at index zero. It was writing a literal '0' instead of a null byte at the beginning anyways, which didn't matter since we never read it. llvm-svn: 234202
2015-04-06Prefer uninitialized memory for scratch space.Benjamin Kramer1-1/+1
No functional change intended. llvm-svn: 234184
2014-08-29unique_ptrify SourceManager::createFileIDDavid Blaikie1-1/+1
llvm-svn: 216715
2014-08-27Update for LLVM api change.Rafael Espindola1-4/+5
llvm-svn: 216585
2014-05-17[C++11] Use 'nullptr'. Lex edition.Craig Topper1-1/+2
llvm-svn: 209083
2014-05-16Rename SourceManager::createFileIDForMemBuffer()Alp Toker1-1/+1
It makes more sense to just overload createFileID(). Gardening only. llvm-svn: 209002
2011-09-19Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.Argyrios Kyrtzidis1-1/+1
It already works (and is useful with) macro locs as well. llvm-svn: 140057
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump1-5/+5
llvm-svn: 81346
2009-03-08add \n characters to the scratch buffer *before* returned tokens. Chris Lattner1-3/+7
This prevents caret diagnostics from the scratch buffer from including other tokens in the scratch buffer that occurred beforei them. llvm-svn: 66375
2009-03-08simplify some logic by making ScratchBuffer handle the application of trailingChris Lattner1-5/+11
\0's to created tokens instead of making all clients do it. No functionality change. llvm-svn: 66373
2009-01-26This change refactors some of the low-level lexer interfaces a bit.Chris Lattner1-11/+5
Token now has a class of kinds for "literals", which include numeric constants, strings, etc. These tokens can optionally have a pointer to the start of the token in the lexer buffer. This makes it faster to get spelling and do other gymnastics, because we don't have to go through source locations. This change is performance neutral, but will make other changes more feasible down the road. llvm-svn: 63028
2009-01-26Check in the long promised SourceLocation rewrite. This lays theChris Lattner1-1/+1
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
2009-01-19Make some enums in SourceLocation private, remove a useless assertion from ↵Chris Lattner1-3/+0
ScratchBuffer. llvm-svn: 62492
2009-01-17this massive patch introduces a simple new abstraction: it makesChris Lattner1-3/+3
"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
2008-03-15Make a major restructuring of the clang tree: introduce a top-levelChris Lattner1-0/+72
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