History log of /llvm-project/clang/lib/Basic/FileManager.cpp (Results 176 – 200 of 245)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-3.1.0, llvmorg-3.1.0-rc3
# 6eec06d0 03-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com>

[PCH] When validating that the files coming from PCH did not change, also
validate that we didn't override the contents of any of such files.

If this is detected, emit a diagnostic error and recover

[PCH] When validating that the files coming from PCH did not change, also
validate that we didn't override the contents of any of such files.

If this is detected, emit a diagnostic error and recover gracefully
by using the contents of the original file that the PCH was built from.

Part of rdar://11305263

llvm-svn: 156107

show more ...


Revision tags: llvmorg-3.1.0-rc2, llvmorg-3.1.0-rc1
# 2c1dd271 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org>

Basic: import SmallString<> into clang namespace

(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

llvm-svn: 149799


# e2778999 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org>

Basic: import OwningPtr<> into clang namespace

llvm-svn: 149798


# 1ced737e 22-Dec-2011 Dylan Noblesmith <nobled@dreamwidth.org>

remove unneeded config.h includes

llvm-svn: 147195


Revision tags: llvmorg-3.0.0, llvmorg-3.0.0-rc4
# 32f1acf1 17-Nov-2011 NAKAMURA Takumi <geek4civic@gmail.com>

Revert r132539 for now, "My testing shows that function stat has no problem with trailing separators. (tested on Windows and Darwin)."

It caused PR10331. MSVCRT stat() cannot strip trailing '/'. (ca

Revert r132539 for now, "My testing shows that function stat has no problem with trailing separators. (tested on Windows and Darwin)."

It caused PR10331. MSVCRT stat() cannot strip trailing '/'. (can '\')

llvm-svn: 144884

show more ...


Revision tags: llvmorg-3.0.0-rc3
# 44f91da8 06-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com>

Use StringRef's case transformation methods.

llvm-svn: 143889


Revision tags: llvmorg-3.0.0-rc2, llvmorg-3.0.0-rc1
# 1735f4e7 13-Sep-2011 Douglas Gregor <dgregor@apple.com>

For modules, use a hash of the compiler version, language options, and
target triple to separate modules built under different
conditions. The hash is used to create a subdirectory in the module
cach

For modules, use a hash of the compiler version, language options, and
target triple to separate modules built under different
conditions. The hash is used to create a subdirectory in the module
cache path where other invocations of the compiler (with the same
version, language options, etc.) can find the precompiled modules.

llvm-svn: 139662

show more ...


# faeb1d46 12-Sep-2011 Douglas Gregor <dgregor@apple.com>

When an import statement fails to find a module in the module cache,
but there is a corresponding umbrella header in a framework, build the
module on-the-fly so it can be immediately loaded at the im

When an import statement fails to find a module in the module cache,
but there is a corresponding umbrella header in a framework, build the
module on-the-fly so it can be immediately loaded at the import
statement. This is very much proof-of-concept code, with details to be
fleshed out over time.

llvm-svn: 139558

show more ...


# 0e62c1cc 23-Jul-2011 Chris Lattner <sabre@nondot.org>

remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.

llvm-svn: 135852


# dd04c69a 03-Jun-2011 Francois Pichet <pichet2000@gmail.com>

My testing shows that function stat has no problem with trailing separators. (tested on Windows and Darwin).

This fixes a bug on Windows:
clang c:\test.cpp

Here the call stat("c:") is not recognize

My testing shows that function stat has no problem with trailing separators. (tested on Windows and Darwin).

This fixes a bug on Windows:
clang c:\test.cpp

Here the call stat("c:") is not recognized as a directory (must be "c:\").

llvm-svn: 132539

show more ...


Revision tags: llvmorg-2.9.0, llvmorg-2.9.0-rc3, llvmorg-2.9.0-rc2
# 5e368405 18-Mar-2011 Anders Carlsson <andersca@mac.com>

Add FileManager::getNoncachedStatValue, which will resolve relative paths against the working directory specified in the file system options.

llvm-svn: 127893


# d6278e32 16-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com>

Having FileManager::getFile always open the file, brought much consternation and leaking of file descriptors.

Add 'openFile' bool to FileManager::getFile to specify whether we want to have the file

Having FileManager::getFile always open the file, brought much consternation and leaking of file descriptors.

Add 'openFile' bool to FileManager::getFile to specify whether we want to have the file opened or not, have it
false by default, and enable it only in HeaderSearch.cpp where the open+fstat optimization matters.

Fixes rdar://9139899.

llvm-svn: 127748

show more ...


# 669b0b15 15-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com>

Stop leaking file descriptors.

After the open+fstat optimization, files were already opened for FileManager::getBufferForFile() and we closed them after reading them.
The problem was that when -work

Stop leaking file descriptors.

After the open+fstat optimization, files were already opened for FileManager::getBufferForFile() and we closed them after reading them.
The problem was that when -working-directory was passed, the code path that actually reuses & closes the already opened file descriptor
was not followed.

llvm-svn: 127639

show more ...


# 9ba8fb1e 14-Mar-2011 Anders Carlsson <andersca@mac.com>

Get rid of the static FileManager::FixupRelativePath.

llvm-svn: 127573


Revision tags: llvmorg-2.9.0-rc1
# 878b3e2b 07-Mar-2011 Anders Carlsson <andersca@mac.com>

Check in the implementation as well...

llvm-svn: 127144


# b5c356a4 06-Mar-2011 Anders Carlsson <andersca@mac.com>

Convert FileManager::FixupRelativePath over to using PathV2.

llvm-svn: 127133


# f3c0ff73 11-Feb-2011 Zhanyong Wan <wan@google.com>

Uses llvm::sys::path instead of hand-rolled algorithm in FileManager.
Reviewed by dgregor.

llvm-svn: 125407


# e1dd3e2c 11-Feb-2011 Zhanyong Wan <wan@google.com>

Improves Clang's virtual file handling.

This patch contains:

- making some of the existing comments more accurate in the presence
of virtual files/directories.

- renaming some private data members

Improves Clang's virtual file handling.

This patch contains:

- making some of the existing comments more accurate in the presence
of virtual files/directories.

- renaming some private data members of FileManager to match their roles better.

- creating 'DirectorEntry's for the parent directories of virtual
files, such that we can tell whether two virtual files are from the
same directory. This is useful for injecting virtual files whose
directories don't exist in the real file system.

- minor clean-ups and adding comments for class
FileManager::UniqueDirContainer and FileManager::UniqueFileContainer.

- adding statistics on virtual files to FileManager::PrintStats().

- adding unit tests to verify the existing and new behavior of FileManager.

llvm-svn: 125384

show more ...


# 09b6989e 10-Feb-2011 Douglas Gregor <dgregor@apple.com>

Implement two related optimizations that make de-serialization of
AST/PCH files more lazy:
- Don't preload all of the file source-location entries when reading
the AST file. Instead, load them la

Implement two related optimizations that make de-serialization of
AST/PCH files more lazy:
- Don't preload all of the file source-location entries when reading
the AST file. Instead, load them lazily, when needed.
- Only look up header-search information (whether a header was already
#import'd, how many times it's been included, etc.) when it's needed
by the preprocessor, rather than pre-populating it.

Previously, we would pre-load all of the file source-location entries,
which also populated the header-search information structure. This was
a relatively minor performance issue, since we would end up stat()'ing
all of the headers stored within a AST/PCH file when the AST/PCH file
was loaded. In the normal PCH use case, the stat()s were cached, so
the cost--of preloading ~860 source-location entries in the Cocoa.h
case---was relatively low.

However, the recent optimization that replaced stat+open with
open+fstat turned this into a major problem, since the preloading of
source-location entries would now end up opening those files. Worse,
those files wouldn't be closed until the file manager was destroyed,
so just opening a Cocoa.h PCH file would hold on to ~860 file
descriptors, and it was easy to blow through the process's limit on
the number of open file descriptors.

By eliminating the preloading of these files, we neither open nor stat
the headers stored in the PCH/AST file until they're actually needed
for something. Concretely, we went from

*** HeaderSearch Stats:
835 files tracked.
364 #import/#pragma once files.
823 included exactly once.
6 max times a file is included.
3 #include/#include_next/#import.
0 #includes skipped due to the multi-include optimization.
1 framework lookups.
0 subframework lookups.

*** Source Manager Stats:
835 files mapped, 3 mem buffers mapped.
37460 SLocEntry's allocated, 11215575B of Sloc address space used.
62 bytes of files mapped, 0 files with line #'s computed.

with a trivial program that uses a chained PCH including a Cocoa PCH
to

*** HeaderSearch Stats:
4 files tracked.
1 #import/#pragma once files.
3 included exactly once.
2 max times a file is included.
3 #include/#include_next/#import.
0 #includes skipped due to the multi-include optimization.
1 framework lookups.
0 subframework lookups.

*** Source Manager Stats:
3 files mapped, 3 mem buffers mapped.
37460 SLocEntry's allocated, 11215575B of Sloc address space used.
62 bytes of files mapped, 0 files with line #'s computed.

for the same program.

llvm-svn: 125286

show more ...


# c6236065 08-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com>

Update for API change.

llvm-svn: 125129


# 606c4ac3 05-Feb-2011 Douglas Gregor <dgregor@apple.com>

Improve our uniquing of file entries when files are re-saved or are
overridden via remapping. Thus, when we create a "virtual" file in the
file manager, we still stat() the real file that lives behin

Improve our uniquing of file entries when files are re-saved or are
overridden via remapping. Thus, when we create a "virtual" file in the
file manager, we still stat() the real file that lives behind it so
that we can provide proper uniquing based on inodes. This helps keep
the file manager much more consistent.

To take advantage of this when reparsing files in libclang, we disable
the use of the stat() cache when reparsing or performing code
completion, since the stat() cache is very likely to be out of date in
this use case.

llvm-svn: 124971

show more ...


# 5b554540 03-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com>

Revert 124754 and 124760 as they made clang unusable in the presence of symbolic
links.

llvm-svn: 124776


# 8c0577fa 03-Feb-2011 Douglas Gregor <dgregor@apple.com>

Improve the performance of filename canonicalization by avoiding
redundant searches in the string. No functionality change.

llvm-svn: 124760


# 3c0d263a 02-Feb-2011 Douglas Gregor <dgregor@apple.com>

Canonicalize path names in the file manager before performing a lookup
on that name. Canonicalization eliminates silliness such as "." and
"foo/.." that breaks the uniquing of files in the presence o

Canonicalize path names in the file manager before performing a lookup
on that name. Canonicalization eliminates silliness such as "." and
"foo/.." that breaks the uniquing of files in the presence of virtual
files or files whose inode numbers have changed during
parsing/re-parsing. c-index-test isn't able to create this crazy
situation, so I've resorted to testing outside of the Clang
tree. Fixes <rdar://problem/8928220>.

Note that this hackery will go away once we have a real virtual file
system on which we can layer FileManager; the virtual-files hack is
showing cracks.

llvm-svn: 124754

show more ...


# 63fbaeda 27-Jan-2011 Axel Naumann <Axel.Naumann@cern.ch>

TextDiagnosticPrinter.cpp: Show diagnostics as far as possible even with invalid PresomedLoc, instead of just silencing it.

FileManager.cpp: Allow virtual files in nonexistent directories.
FileManag

TextDiagnosticPrinter.cpp: Show diagnostics as far as possible even with invalid PresomedLoc, instead of just silencing it.

FileManager.cpp: Allow virtual files in nonexistent directories.
FileManager.cpp: Close FileDescriptor for virtual files that correspond to actual files.
FileManager.cpp: Enable virtual files to be created even for files that were flagged as NON_EXISTENT_FILE, e.g. by a prior (unsuccessful) addFile().

ASTReader.cpp: Read a PCH even if the original source files cannot be found.

Add a test for reading a PCH of a file that has been removed and diagnostics referencing that file.

llvm-svn: 124374

show more ...


12345678910