[PATCH] D34985: Do not read the file to determine its name.

2017-07-09 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Looks like most of the users of this function are detecting whether we're in the builtins buffer. Perhaps we should have a dedicated method for that which uses something more principled than a string comparison against ""? Comment at: lib/Basic/SourceM

[PATCH] D34985: Do not read the file to determine its name.

2017-07-07 Thread Axel Naumann via Phabricator via cfe-commits
karies added a comment. In https://reviews.llvm.org/D34985#801498, @bruno wrote: > @v.g.vassilev will this also benefit from `ContentCache::getBuffer` > improvements from https://reviews.llvm.org/D33275? I guess if `getBuffer` > transparently handles pointing to right buffer we won't need this

[PATCH] D34985: Do not read the file to determine its name.

2017-07-06 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno added a comment. @v.g.vassilev will this also benefit from `ContentCache::getBuffer` improvements from https://reviews.llvm.org/D33275? I guess if `getBuffer` transparently handles pointing to right buffer we won't need this change? Repository: rL LLVM https://reviews.llvm.org/D34985

[PATCH] D34985: Do not read the file to determine its name.

2017-07-05 Thread Axel Naumann via Phabricator via cfe-commits
karies added a comment. To be clear: emitting annotations will trigger the determination of `PresumedLoc`s. As part of that (but not the first part, IIRC) `SourceManager::getBufferName(()` will be called which will trigger the `fopen` of the file, just to get its name. Another task of `Presume

[PATCH] D34985: Do not read the file to determine its name.

2017-07-05 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. The test case could be shared from PR33688: echo 'void* func(char* p) __attribute__((annotate("blah"))); void* func(char* p){return p;}' > HEADER.h clang++ -std=c++14 -x c++-header -o HEADER.h.pch HEADER.h chmod a-r HEADER.h echo 'char i; void

[PATCH] D34985: Do not read the file to determine its name.

2017-07-05 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev created this revision. Patch by Axel Naumann! Repository: rL LLVM https://reviews.llvm.org/D34985 Files: lib/Basic/SourceManager.cpp Index: lib/Basic/SourceManager.cpp === --- lib/Basic/SourceManager.cpp +++ lib