#
8fbe98b3 |
| 20-Apr-2010 |
Chris Lattner <sabre@nondot.org> |
enhance sourcemgr to detect various UTF BOM's and emit a fatal error about it instead of producing tons of garbage from the lexer.
It would be even better for sourcemgr to dynamically transcode (e.g
enhance sourcemgr to detect various UTF BOM's and emit a fatal error about it instead of producing tons of garbage from the lexer.
It would be even better for sourcemgr to dynamically transcode (e.g. from UTF16 -> UTF8).
llvm-svn: 101924
show more ...
|
#
584344f2 |
| 10-Apr-2010 |
Daniel Dunbar <daniel@zuster.org> |
Disable diag::err_file_modified on Win32 completely, until someone cares to fix it. PR6812. - This is another attempt at silencing annoying buildbot failures.
llvm-svn: 100914
|
#
08288f28 |
| 09-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
On Windows, disable the modification-time check for files used in precompiled headers and/or when reading the contents of the file into memory. These checks seem to be causing spurious regression-tes
On Windows, disable the modification-time check for files used in precompiled headers and/or when reading the contents of the file into memory. These checks seem to be causing spurious regression-test failures on Windows.
llvm-svn: 100866
show more ...
|
#
85795316 |
| 22-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Introduce the notion of a single "delayed" diagnostic into the Diagnostic subsystem, which is used in the rare case where we find a serious problem (i.e., an inconsistency in the file system) while w
Introduce the notion of a single "delayed" diagnostic into the Diagnostic subsystem, which is used in the rare case where we find a serious problem (i.e., an inconsistency in the file system) while we're busy formatting another diagnostic. In this case, the delayed diagnostic will be emitted after we're done with the other diagnostic. This is only to be used for fatal conditions detected at very inconvenient times, where we can neither stop the current diagnostic in flight nor can we suppress the second error.
llvm-svn: 99175
show more ...
|
#
b41ca8f2 |
| 21-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Keep track of the size/modification time of each file source-location entry in a precompiled header, so that we can detect modified files even when we miss in the stat cache.
llvm-svn: 99149
|
#
51c2351d |
| 19-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Fix a longstanding (but previously unknown) bug in the lazy deserialization of precompiled headers, where the deserialization of the source location entry for a buffer (e.g., macro instantiation scra
Fix a longstanding (but previously unknown) bug in the lazy deserialization of precompiled headers, where the deserialization of the source location entry for a buffer (e.g., macro instantiation scratch space) would overwrite a one-element FileID cache in the source manager. When tickled at the wrong time, we would return the wrong decomposed source location and eventually cause c-index-test to crash.
Found by dumb luck. It's amazing this hasn't shown up before.
llvm-svn: 98940
show more ...
|
#
22fde23b |
| 17-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Check the inode in addition to size and modification time to determine whether a file has changed since it was originally read.
llvm-svn: 98726
|
#
6597f595 |
| 17-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Use a simple diagnostic (file modified) when we detect that a file has changed, rather than trying to point out how it changed. The "why" doesn't matter.
llvm-svn: 98725
|
#
82752ec8 |
| 16-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Teach SourceManager's content cache to keep track of whether its buffer was invalid when it was created, and use that bit to always set the "Invalid" flag according to whether the buffer is invalid.
Teach SourceManager's content cache to keep track of whether its buffer was invalid when it was created, and use that bit to always set the "Invalid" flag according to whether the buffer is invalid. This ensures that all accesses to an invalid buffer are marked invalid, improving recovery.
llvm-svn: 98690
show more ...
|
#
4fb7fbef |
| 16-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Audit all getBuffer() callers (for both the FullSourceLoc and SourceManager versions), updating those callers that need to recover gracefully from failure.
llvm-svn: 98665
|
#
eb92dc0b |
| 16-Mar-2010 |
Benjamin Kramer <benny.kra@googlemail.com> |
Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.
llvm-svn: 98630
|
#
7bda4b83 |
| 16-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Introduce optional "Invalid" parameters to routines that invoke the SourceManager's getBuffer() and, therefore, could fail, along with Preprocessor::getSpelling(). Use the Invalid parameters in the l
Introduce optional "Invalid" parameters to routines that invoke the SourceManager's getBuffer() and, therefore, could fail, along with Preprocessor::getSpelling(). Use the Invalid parameters in the literal parsers (string, floating point, integral, character) to make them robust against errors that stem from, e.g., PCH files that are not consistent with the underlying file system.
I still need to audit every use caller to all of these routines, to determine which ones need specific handling of error conditions.
llvm-svn: 98608
show more ...
|
#
874cc628 |
| 16-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Use SourceManager's Diagnostic object for all file-reading errors, simplifying the SourceManager interfaces somewhat.
llvm-svn: 98598
|
#
e0fbb83b |
| 16-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Give SourceManager a Diagnostic object with which to report errors, and start simplifying the interfaces in SourceManager that can fail.
llvm-svn: 98594
|
#
0adf3182 |
| 15-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Add some <cstdio> includes to unbreak the buildbots
llvm-svn: 98591
|
#
802b7760 |
| 15-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Introduce a new BufferResult class to act as the return type of SourceManager's getBuffer() (and similar) operations. This abstract can be used to force callers to cope with errors in getBuffer(), su
Introduce a new BufferResult class to act as the return type of SourceManager's getBuffer() (and similar) operations. This abstract can be used to force callers to cope with errors in getBuffer(), such as missing files and changed files. Fix a bunch of callers to use the new interface.
Add some very basic checks for file consistency (file size, modification time) into ContentCache::getBuffer(), although these checks don't help much until we've updated the main callers (e.g., SourceManager::getSpelling()).
llvm-svn: 98585
show more ...
|
#
4a265240 |
| 10-Mar-2010 |
Ted Kremenek <kremenek@apple.com> |
Fix -Wsign-compare warning reported by clang++.
llvm-svn: 98170
|
#
b8b9f28e |
| 27-Feb-2010 |
Douglas Gregor <dgregor@apple.com> |
Robustify SourceManager::getLocation(), so that it returns an end-of-line source location when given a column number beyond the length of the line, or an end-of-file source location when given a line
Robustify SourceManager::getLocation(), so that it returns an end-of-line source location when given a column number beyond the length of the line, or an end-of-file source location when given a line number beyond the length of the file. Previously, we would return an invalid location.
llvm-svn: 97299
show more ...
|
#
5647d319 |
| 12-Feb-2010 |
Chris Lattner <sabre@nondot.org> |
fix a bug in SourceManager::getInstantiationLocSlowCase, where we'd add an offset from the spelling location space to the instantiation location, which doesn't make sense and would lead up to the te
fix a bug in SourceManager::getInstantiationLocSlowCase, where we'd add an offset from the spelling location space to the instantiation location, which doesn't make sense and would lead up to the text diagnostics crashing when presented with non-sensical locations.
This fixes rdar://7597492, a crash on 255.vortex.
llvm-svn: 96004
show more ...
|
#
7cea5f17 |
| 06-Dec-2009 |
Daniel Dunbar <daniel@zuster.org> |
Add a pretty horrible hack to prevent clang from crashing with inconsistent PCH files. - The issue is that PCH uses a stat cache, which may reference files which have been deleted or moved. In su
Add a pretty horrible hack to prevent clang from crashing with inconsistent PCH files. - The issue is that PCH uses a stat cache, which may reference files which have been deleted or moved. In such cases ContentCache::getBuffer was returning 0 but most clients are incapable of dealing with this (i.e., they don't).
For the time being, resolve this issue by just making up some invalid file contents and. Eventually we should detect that we are in an inconsistent situation and error out with a nice message that the PCH is out of date.
llvm-svn: 90699
show more ...
|
#
5f498834 |
| 03-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
Minor cleanup to the code-completion-point logic suggested by Chris.
llvm-svn: 90459
|
#
53ad6b94 |
| 02-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
Extend the source manager with the ability to override the contents of files with the contents of an arbitrary memory buffer. Use this new functionality to drastically clean up the way in which we ha
Extend the source manager with the ability to override the contents of 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
show more ...
|
#
2a1b6916 |
| 02-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
Eliminate the unnecessary FirstFID cache variable from the source manager's ContentCache
llvm-svn: 90294
|
#
465f4c48 |
| 01-Dec-2009 |
Daniel Dunbar <daniel@zuster.org> |
In SourceManager::isBeforeInTranslationUnit, if we are trying to compare two source locations with no common ancestor in the include stack, determine order by assuming memory buffers preceed files, a
In SourceManager::isBeforeInTranslationUnit, if we are trying to compare two source locations with no common ancestor in the include stack, determine order by assuming memory buffers preceed files, and then that FileIDs are created in order.
The later assumption is patently false, but this was already broken -- this situation is conceptually impossible, my feeling is we should fix SourceManager and friends to make it impossible in practice as well. However, we need to fix PR5662 and perhaps some other things involving memory buffers first. In the short term I'm pretty sure this is reliable.
Chris, Argiris, is this going to break anything that wasn't already broken?
llvm-svn: 90280
show more ...
|
#
ed3b3602 |
| 01-Dec-2009 |
Chris Lattner <sabre@nondot.org> |
pass the reason for failure up from MemoryBuffer and report it 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 o
pass the reason for failure up from MemoryBuffer and report it 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
show more ...
|