- Apr 15, 2011
-
-
Chris Lattner authored
Luis Felipe Strano Moraes! llvm-svn: 129559
-
- Apr 09, 2011
-
-
Eric Christopher authored
Nom Nom Nom. Patch by Anton Korobeynikov! llvm-svn: 129174
-
- Mar 09, 2011
-
-
Argyrios Kyrtzidis authored
should report the original file name for contents of files that were overriden by other files, otherwise it should report the name of the new file. Default is true. Also add similar field in PreprocessorOptions and pass similar parameter in ASTUnit::LoadFromCommandLine. llvm-svn: 127289
-
- Mar 05, 2011
-
-
Argyrios Kyrtzidis authored
Currently we can only remap a file by creating a MemoryBuffer and replacing the file contents with it. Allow remapping a file by specifying another filename whose contents should be loaded if the original file gets loaded. This allows to override files without having to create & load buffers in advance. llvm-svn: 127052
-
- Feb 23, 2011
-
-
Chandler Carruth authored
exist. Cheat and do this by adding some wrappers around the PresumedLoc machinery that directly return the line and column number. llvm-svn: 126281
-
- Feb 16, 2011
-
-
Douglas Gregor authored
Fix a thinko with llvm::Optional, which is clearly the most dangerous class template in the universe llvm-svn: 125679
-
- Feb 11, 2011
-
-
Douglas Gregor authored
contents when it's safe. I just *love* C++ some days. llvm-svn: 125378
-
- Feb 03, 2011
-
-
Douglas Gregor authored
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
-
- Jan 31, 2011
-
-
Douglas Gregor authored
the disappearance/alteration of files. llvm-svn: 124616
-
- Dec 24, 2010
-
-
Argyrios Kyrtzidis authored
Handle locations coming from macro instantiations properly in SourceManager::isBeforeInTranslationUnit(). Fixes rdar://8790245 and http://llvm.org/PR8821. llvm-svn: 122536
-
- Nov 29, 2010
-
-
Michael J. Spencer authored
llvm-svn: 120297
-
- Nov 23, 2010
-
-
Chris Lattner authored
this code. no functionality change. llvm-svn: 120011
-
Chris Lattner authored
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
-
Chris Lattner authored
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
-
- Nov 18, 2010
-
-
Argyrios Kyrtzidis authored
-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
-
Benjamin Kramer authored
llvm-svn: 119698
-
- Nov 03, 2010
-
-
Argyrios Kyrtzidis authored
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
-
- Nov 02, 2010
-
-
Douglas Gregor authored
llvm-svn: 117990
-
- Oct 26, 2010
-
-
Dan Gohman authored
doesn't need its return value. llvm-svn: 117393
-
- Oct 23, 2010
-
-
Chandler Carruth authored
llvm-svn: 117204
-
- Oct 05, 2010
-
-
Zhanyong Wan authored
Fix handling of the 'Invalid' argument in SourceManager's methods (patch by Dean Sturtevant, reviewed by chandlerc and Sebastian Redl). llvm-svn: 115638
-
- Aug 26, 2010
-
-
Dan Gohman authored
llvm-svn: 112219
-
- Aug 19, 2010
-
-
Sebastian Redl authored
llvm-svn: 111472
-
- Jul 28, 2010
-
-
Sebastian Redl authored
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
-
- Jul 26, 2010
-
-
Douglas Gregor authored
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
-
- May 07, 2010
-
-
Chris Lattner authored
code into a MoveUpIncludeHierarchy helper, and use the helper to fix a case involving macros which regressed from my recent patch. llvm-svn: 103288
-
Chris Lattner authored
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
-
Chris Lattner authored
llvm-svn: 103236
-
Chris Lattner authored
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
-
- May 06, 2010
-
-
Ted Kremenek authored
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
-
- Apr 20, 2010
-
-
Chris Lattner authored
a const_cast. llvm-svn: 101940
-
Chris Lattner authored
into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location. llvm-svn: 101939
-
Chris Lattner authored
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
-
- Apr 10, 2010
-
-
Daniel Dunbar authored
it. PR6812. - This is another attempt at silencing annoying buildbot failures. llvm-svn: 100914
-
- Apr 09, 2010
-
-
Douglas Gregor authored
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
-
- Mar 22, 2010
-
-
Douglas Gregor authored
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
-
- Mar 21, 2010
-
-
Douglas Gregor authored
entry in a precompiled header, so that we can detect modified files even when we miss in the stat cache. llvm-svn: 99149
-
- Mar 19, 2010
-
-
Douglas Gregor authored
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
-
- Mar 17, 2010
-
-
Douglas Gregor authored
whether a file has changed since it was originally read. llvm-svn: 98726
-
Douglas Gregor authored
changed, rather than trying to point out how it changed. The "why" doesn't matter. llvm-svn: 98725
-