summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/SourceManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* SourceManager::getBufferData(SourceLocation) is dead, delete it.Chris Lattner2009-01-191-8/+2
| | | | llvm-svn: 62495
* some minor cleanups to SourceManager, and eliminate the Chris Lattner2009-01-191-1/+1
| | | | | | SourceManager::getBuffer(SourceLocation) method. llvm-svn: 62494
* Rename SourceLocation::getFileID to getChunkID, because it returnsChris Lattner2009-01-171-6/+6
| | | | | | | | the chunk ID not the file ID. This exposes problems in TextDiagnosticPrinter where it should have been using the canonical file ID but wasn't. Fix these along the way. llvm-svn: 62427
* this massive patch introduces a simple new abstraction: it makesChris Lattner2009-01-171-26/+35
| | | | | | | | | | | | | | | "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
* make "ContentCache::Buffer" mutable to avoid a const_cast.Chris Lattner2009-01-171-3/+1
| | | | llvm-svn: 62403
* more SourceLocation lexicon change: instead of referring to theChris Lattner2009-01-161-2/+2
| | | | | | "logical" location, refer to the "instantiation" location. llvm-svn: 62316
* rename "virtual location" of a macro to "instantiation location".Chris Lattner2009-01-161-3/+3
| | | | llvm-svn: 62315
* Change some terminology in SourceLocation: instead of referring to Chris Lattner2009-01-161-16/+16
| | | | | | | the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! llvm-svn: 62309
* SourceManager: Implement "lazy" creation of MemBuffers for source files.Ted Kremenek2009-01-061-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | - Big Idea: Source files are now mmaped when ContentCache::getBuffer() is first called. While this doesn't change the functionality when lexing regular source files, it can result in source files not being paged in when using PTH. - Performance change: - No observable difference (-fsyntax-only/-Eonly) on Cocoa.h when doing regular source lexing. - No observable time difference (-fsyntax-only/-Eonly) on Cocoa.h when using PTH. We do observe, however, a reduction of 279K in memory mapped source code (3% reduction). The majority of pages from Cocoa.h (and friends) are still being pulled in, however, because any literal will cause Preprocessor::getSpelling() to be called (causing the source for the file to get pulled in). The next possible optimization is to cache literal strings in the PTH file to avoid the need for the original header sources entirely. - Right now there is a preprocessor directive to toggle between "lazy" and "eager" creation of MemBuffers. This is not permanent, and is there in the short term to just test additional optimizations. llvm-svn: 61827
* Misc changes to SourceManager::ContentCache:Ted Kremenek2009-01-061-8/+36
| | | | | | | | | | | | | | - 'Buffer' is now private and must be accessed via 'getBuffer()'. This paves the way for lazily mapping in source files on demand. - Added 'getSize()' (which gets the size of the content without necessarily accessing the MemBuffer) and 'getSizeBytesMapped()'. - Modifed SourceManager to use these new methods. This reduces the number of places that actually access the MemBuffer object for a file to those that actually look at the character data. These changes result in no performance change for -fsyntax-only on Cocoa.h. llvm-svn: 61782
* SourceManager::getLineNumber is logically const except for caching.Chris Lattner2008-11-181-1/+1
| | | | | | Use mutable to make it so. llvm-svn: 59498
* Rename Characteristic_t to CharacteristicKindChris Lattner2008-10-271-1/+1
| | | | llvm-svn: 58224
* whitespace and comment changes, to fix grammar and 80 col violationsNico Weber2008-09-291-4/+4
| | | | llvm-svn: 56776
* clean up a bunch of fixme's I added, by moving Chris Lattner2008-09-261-3/+3
| | | | | | DirectoryLookup::DirType into SourceManager.h llvm-svn: 56692
* Fix the rest of rdar://6243860 hopefully. This requires changing FileIDInfoChris Lattner2008-09-261-3/+3
| | | | | | | | | | | to whether the fileid is a 'extern c system header' in addition to whether it is a system header, most of this is spreading plumbing around. Once we have that, PPLexerChange bases its "file enter/exit" notifications to PPCallbacks to base the system header state on FileIDInfo instead of HeaderSearch. Finally, in Preprocessor::HandleIncludeDirective, mirror logic in GCC: the system headerness of a file being entered can be set due to the #includer or the #includee. llvm-svn: 56688
* * Remove isInSystemHeader() from DiagClient, move it to SourceManagerNico Weber2008-08-101-3/+5
| | | | | | | | | | | | | | | | * Move FormatError() from TextDiagnostic up to DiagClient, remove now empty class TextDiagnostic * Make DiagClient optional for Diagnostic This fixes the following problems: * -html-diags (and probably others) does now output the same set of warnings as console clang does * nothing crashes if one forgets to call setHeaderSearch() on TextDiagnostic * some code duplication is removed llvm-svn: 54620
* Update to match simplified llvm MemoryBuffer interfaces for files.Chris Lattner2008-04-011-2/+1
| | | | llvm-svn: 49042
* prune dead #includesChris Lattner2008-04-011-2/+0
| | | | llvm-svn: 49033
* MemoryBuffer::getFile got smarter, obviating the need for readfilefast.Chris Lattner2008-04-011-60/+3
| | | | | | | The new MemoryBuffer doesn't "leak" file descriptors and handles the small file case efficiently. llvm-svn: 49032
* Hack ReadFileFast() to raise the threshold of memory mapped files (from ↵Steve Naroff2008-03-311-1/+1
| | | | | | | | | | 4->12 pages). This is a temporary solution to avoid running out of file descriptors (which defaults to 256). Need to benchmark to understand the speed benefit. If the benefit is small, the simple solution is to avoid memory mapping files. If the benefit is significant, more thought is necessary. llvm-svn: 48991
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+574
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