#
e664276b |
| 03-Feb-2011 |
Douglas Gregor <dgregor@apple.com> |
Teach SourceManager::getLocation() how to cope with a source file whose inode has changed since the file was first created and that is being seen through a different path name (e.g., due to symlinks
Teach SourceManager::getLocation() how to cope with a source file whose inode has changed since the file was first created and that is being seen through a different path name (e.g., due to symlinks or relative path elements), such that its FileEntry pointer doesn't match a known FileEntry pointer. Since this requires a system call (to stat()), we only perform this deeper checking if we can't find the file by comparing FileEntry pointers.
Also, add a micro-optimization where we don't bother to compute line numbers when given the location (1, 1). This improves the efficiency of clang_getLocationForOffset().
llvm-svn: 124800
show more ...
|
#
86af9844 |
| 31-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Harden Lexer::GetBeginningOfToken() against bogus source locations and the disappearance/alteration of files.
llvm-svn: 124616
|
#
338f9aaa |
| 24-Dec-2010 |
Argyrios Kyrtzidis <akyrtzi@gmail.com> |
Handle locations coming from macro instantiations properly in SourceManager::isBeforeInTranslationUnit(). Fixes rdar://8790245 and http://llvm.org/PR8821.
llvm-svn: 122536
|
#
8aaf4995 |
| 29-Nov-2010 |
Michael J. Spencer <bigcheesegs@gmail.com> |
Merge System into Support.
llvm-svn: 120297
|
#
5631b052 |
| 23-Nov-2010 |
Chris Lattner <sabre@nondot.org> |
reduce indentation and use early outs, to make it easier to read this code. no functionality change.
llvm-svn: 120011
|
#
5159f616 |
| 23-Nov-2010 |
Chris Lattner <sabre@nondot.org> |
now the FileManager has a FileSystemOpts ivar, stop threading FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on
now the FileManager has a FileSystemOpts ivar, stop threading FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext.
llvm-svn: 120010
show more ...
|
#
4ac569b2 |
| 23-Nov-2010 |
Chris Lattner <sabre@nondot.org> |
Partially revert Doug's PCH validation patch (r98585).
This patch completely defeated the "passing in a prestat'd size to MemoryBuffer" optimization, leading to an extra fstat call for every buffer
Partially revert Doug's PCH validation patch (r98585).
This patch completely defeated the "passing in a prestat'd size to MemoryBuffer" optimization, leading to an extra fstat call for every buffer opened, in order to find out if the datestamp and size of the file on disk matches what is in the stat cache.
I fully admit that I don't completely understand what is going on here: why punish code when a stat cache isn't in use? what is the point of a stat cache if you have to turn around and stat stuff to validate it?
To resolve both these issues, just drop the modtime check and check the file size, which is the important thing anyway. This should also resolve PR6812, because presumably windows is stable when it comes to file sizes. If the modtime is actually important, we should get it and keep it on the first stat.
This eliminates 833 fstat syscalls when processing Cocoa.h, speeding up system time on -Eonly Cocoa.h from 0.041 to 0.038s.
llvm-svn: 120001
show more ...
|
#
d0040648 |
| 18-Nov-2010 |
Argyrios Kyrtzidis <akyrtzi@gmail.com> |
Refactoring of Diagnostic class.
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for
Refactoring of Diagnostic class.
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces.
llvm-svn: 119730
show more ...
|
#
5a3f1cfa |
| 18-Nov-2010 |
Benjamin Kramer <benny.kra@googlemail.com> |
Fix a typo in the UTF-8 BOM (PR8645). Use a StringSwitch while at it.
llvm-svn: 119698
|
#
71731d6b |
| 03-Nov-2010 |
Argyrios Kyrtzidis <akyrtzi@gmail.com> |
Implement -working-directory.
When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't requ
Implement -working-directory.
When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along.
--FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism.
FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions.
Addresses rdar://8583824.
llvm-svn: 118203
show more ...
|
#
75f26d6c |
| 02-Nov-2010 |
Douglas Gregor <dgregor@apple.com> |
Teach SourceManager::getPresumedLoc() how to fail gracefully if getLineNumber/getColumnNumber fail
llvm-svn: 117990
|
#
5d223dcb |
| 26-Oct-2010 |
Dan Gohman <gohman@apple.com> |
getOrCreateContentCache never returns null, so overrideFileContents doesn't need its return value.
llvm-svn: 117393
|
#
c3ce5840 |
| 23-Oct-2010 |
Chandler Carruth <chandlerc@gmail.com> |
Update remaining attribute macros to new style.
llvm-svn: 117204
|
Revision tags: llvmorg-2.8.0 |
|
#
ea6d7f33 |
| 05-Oct-2010 |
Zhanyong Wan <wan@google.com> |
Fix handling of the 'Invalid' argument in SourceManager's methods (patch by Dean Sturtevant, reviewed by chandlerc and Sebastian Redl).
llvm-svn: 115638
|
Revision tags: llvmorg-2.8.0-rc3, llvmorg-2.8.0-rc2, llvmorg-2.8.0-rc1, llvmorg-2.8.0-rc0 |
|
#
ce46f02a |
| 26-Aug-2010 |
Dan Gohman <gohman@apple.com> |
Fix a typo.
llvm-svn: 112219
|
#
d44cd6ad |
| 18-Aug-2010 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
More PCH -> AST renaming.
llvm-svn: 111472
|
#
887d6b08 |
| 28-Jul-2010 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
Add a test case for tentative definitions in chained PCH. Fix a bug that completely messed up source locations and thus caused a crash whenever a diagnostic was emitted in chained PCH files.
llvm-sv
Add a test case for tentative definitions in chained PCH. Fix a bug that completely messed up source locations and thus caused a crash whenever a diagnostic was emitted in chained PCH files.
llvm-svn: 109660
show more ...
|
#
3f4bea06 |
| 26-Jul-2010 |
Douglas Gregor <dgregor@apple.com> |
Introduce basic support for loading a precompiled preamble while reparsing an ASTUnit. When saving a preamble, create a buffer larger than the actual file we're working with but fill everything from
Introduce basic support for loading a precompiled preamble while 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
show more ...
|
#
a99fa1ae |
| 07-May-2010 |
Chris Lattner <sabre@nondot.org> |
clean up isBeforeInTranslationUnit by factoring out some common code into a MoveUpIncludeHierarchy helper, and use the helper to fix a case involving macros which regressed from my recent patch.
llv
clean up isBeforeInTranslationUnit by factoring out some common code into a MoveUpIncludeHierarchy helper, and use the helper to fix a case involving macros which regressed from my recent patch.
llvm-svn: 103288
show more ...
|
#
06821c9e |
| 07-May-2010 |
Chris Lattner <sabre@nondot.org> |
reimplement the guts of SourceManager::isBeforeInTranslationUnit to be algorithmically faster and avoid an std::map. This routine basically boils down to finding the nearest common ancestor in a tre
reimplement the guts of SourceManager::isBeforeInTranslationUnit to be algorithmically faster and avoid an std::map. This routine basically boils down to finding the nearest common ancestor in a tree, and we (implicitly) have information about nesting depth, use it!
This wraps up rdar://7948633 - SourceManager::isBeforeInTranslationUnit has poor performance
llvm-svn: 103239
show more ...
|
#
46e3b480 |
| 07-May-2010 |
Chris Lattner <sabre@nondot.org> |
start using the caching now that it appears to work!
llvm-svn: 103236
|
#
66d2f924 |
| 07-May-2010 |
Chris Lattner <sabre@nondot.org> |
reimplement the caching in the SourceManager::isBeforeInTranslationUnit() method to be correct. Right now it correctly computes the cache, then goes ahead and computes the result the hard way, then
reimplement the caching in the SourceManager::isBeforeInTranslationUnit() method to be correct. Right now it correctly computes the cache, then goes ahead and computes the result the hard way, then asserts that they match. Next I'll actually turn it on.
llvm-svn: 103231
show more ...
|
#
5b0773e2 |
| 06-May-2010 |
Ted Kremenek <kremenek@apple.com> |
Workaround a really serious caching bug in SourceManager::isBeforeInTranslationUnit() where the method will sometimes return different results for the same input SourceLocations. I haven't unraveled
Workaround a really serious caching bug in SourceManager::isBeforeInTranslationUnit() where the method will sometimes return different results for the same input SourceLocations. I haven't unraveled this method completely yet, so this truly is a workaround until a better fix comes along.
llvm-svn: 103143
show more ...
|
Revision tags: llvmorg-2.7.0 |
|
#
8f5bc9f0 |
| 20-Apr-2010 |
Chris Lattner <sabre@nondot.org> |
change FullSourceLoc to have a *const* SourceManager&, eliminating a const_cast.
llvm-svn: 101940
|
#
fb24a3a4 |
| 20-Apr-2010 |
Chris Lattner <sabre@nondot.org> |
push some source location information down through the compiler, into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location.
llv
push some source location information down through the compiler, into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location.
llvm-svn: 101939
show more ...
|