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
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
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
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
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
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