diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-03 17:17:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-03 17:17:35 +0000 |
commit | 86a4d0dd6a630639aab7715323ed068940e650af (patch) | |
tree | f1669398f5a3889b5aece6d98e84c7feb39ce003 /include/clang/Basic/SourceManager.h | |
parent | 3b5b02345b88ff5214e756f57201fe7679af0c34 (diff) |
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().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index a19272f29d..c0fbd089e7 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -783,7 +783,7 @@ public: /// If the source file is included multiple times, the source location will /// be based upon the first inclusion. SourceLocation getLocation(const FileEntry *SourceFile, - unsigned Line, unsigned Col) const; + unsigned Line, unsigned Col); /// \brief Determines the order of 2 source locations in the translation unit. /// |