Inline Source::getBufferPointer into its only remaining caller,
getBufferOrNone. No functionality change.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM
clang/lib/Basic/SourceManager.cpp | ||
---|---|---|
167 | Orthogonal to this patch but an idea for a follow-up: this seems lightly error prone and repetitive. We could put it in an llvm::scope_exit and then release it before the final return on line 200. |
Thanks for the review!
clang/lib/Basic/SourceManager.cpp | ||
---|---|---|
167 | Good call; I refactored this a bit in https://reviews.llvm.org/D89431; after that lands I'll do what you suggest, or possibly start with IsBufferInvalid = true and then set it back to false at the end of the function (once we know it's good). |
clang/lib/Basic/SourceManager.cpp | ||
---|---|---|
167 | Posted the follow-up at https://reviews.llvm.org/D89722. |
Orthogonal to this patch but an idea for a follow-up: this seems lightly error prone and repetitive. We could put it in an llvm::scope_exit and then release it before the final return on line 200.