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 "<built-in>"?
================ Comment at: lib/Basic/SourceManager.cpp:1485 + + return getBuffer(FID, Invalid)->getBufferIdentifier(); } ---------------- This repeats the FID -> SLocEntry lookup; if you manage to get a ContentCache above, perhaps call `getBuffer(...)->getBufferIdentifier()` on it directly? (If you can't get a content cache, this code path will also fail and will produce the name "<<<INVALID BUFFER>>>".) Repository: rL LLVM https://reviews.llvm.org/D34985 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits