[PATCH] D91296: Frontend: Clarify logic for using the preamble in ASTUnit::CodeComplete, almost NFC

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91296/new/ https://reviews.llvm.org/D91296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D91297: Frontend: Take VFS and MainFileBuffer by reference in PrecompiledPreamble::CanReuse, NFC

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91297/new/ https://reviews.llvm.org/D91297 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D91298: Frontend: Always create a new FileManager in ASTUnit::CodeComplete

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91298/new/ https://reviews.llvm.org/D91298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D90485: Lex: Update Module::findHeader to return FileEntryRef, NFC

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90485/new/ https://reviews.llvm.org/D90485 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D90053: Serialization: Change InputFile to use FileEntryRef and add getVirtualFileRef, NFC

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a reviewer: jansvoboda11. dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90053/new/ https://reviews.llvm.org/D90053 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D90484: FileManager: Add FileEntryRef::getDir, returning DirectoryEntryRef

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a reviewer: jansvoboda11. dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90484/new/ https://reviews.llvm.org/D90484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D90497: Module: Use FileEntryRef and DirectoryEntryRef in Umbrella, Header, and DirectoryName, NFC

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a reviewer: jansvoboda11. dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90497/new/ https://reviews.llvm.org/D90497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D90733: Frontend: Sink named pipe logic from CompilerInstance down to FileManager

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a reviewer: jansvoboda11. dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90733/new/ https://reviews.llvm.org/D90733 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D90887: ARCMigrate: Stop abusing PreprocessorOptions for passing back file remappings, NFC

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a reviewer: jansvoboda11. dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90887/new/ https://reviews.llvm.org/D90887 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D91317: Support: Add RedirectingFileSystem::create from simple list of redirections

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91317/new/ https://reviews.llvm.org/D91317 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D90888: Frontend: Remove redundant call to CompilerInstance::setFileManager, NFC

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90888/new/ https://reviews.llvm.org/D90888 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D90889: Remove RemappedFiles param from ASTUnit::LoadFromASTFile, NFC

2020-11-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90889/new/ https://reviews.llvm.org/D90889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D91297: Frontend: Take VFS and MainFileBuffer by reference in PrecompiledPreamble::CanReuse, NFC

2020-11-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/include/clang/Frontend/PrecompiledPreamble.h:108 bool CanReuse(const CompilerInvocation &Invocation, -const llvm::MemoryBuffer *MainFileBuffer, PreambleBounds Bounds, -llvm::vfs::FileSystem *V

[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2020-10-06 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. > Hmm ok should I redo this completely then? Not sure what is up but it shows > you as a reviewer hmm... This revision is old at this point, and I can't remember if you created a new revision with a separate D-number? I still can't "request changes". If you've

[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2020-10-06 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith requested changes to this revision. dexonsmith added a comment. This revision now requires changes to proceed. Ah, I think it's because you filled in the "project" field which I think we usually leave blank. Maybe now I can "request changes". Comment at: clang/lib/C

[PATCH] D66782: SourceManager: Prefer Optional over MemoryBuffer*

2020-10-06 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. Herald added a subscriber: usaxena95. ping: Besides rebasing, any concerns here? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66782/new/ https://reviews.llvm.org/D66782 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D67029: SourceManager: Prefer Optional over MemoryBuffer*

2020-10-06 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith abandoned this revision. dexonsmith added a comment. Herald added subscribers: usaxena95, rnkovacs. This appears to be a duplicate of https://reviews.llvm.org/D66782. Abandon the newer copy. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67029/new/ https://reviews.llvm.org/D6

[PATCH] D67030: ContentCache: Simplify by always owning the MemoryBuffer

2020-10-06 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. ping: Besides rebasing, any concerns here? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67030/new/ https://reviews.llvm.org/D67030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D62457: Frontend: Create basic CompilerInstanceBuilder

2020-10-06 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. Herald added a subscriber: ributzka. @rsmith ping -- Besides rebasing, any concerns about this? Alternatively, any more follow-ups on this thread from last year? - thread: http://lists.llvm.org/pipermail/cfe-dev/2019-May/062369.html CHANGES SINCE LAST ACTION https

[PATCH] D17053: [libcxx]: vector: Use < instead of != to improve failure mode

2020-10-06 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith abandoned this revision. dexonsmith added subscribers: ldionne, EricWF. dexonsmith added a comment. Herald added a subscriber: ributzka. In D17053#632700 , @EricWF wrote: > Maybe if we want to improve the failure mode we can add a > `_LIBCPP_ASS

[PATCH] D88984: Prefer libc++ headers in the -isysroot over the toolchain

2020-10-07 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith requested changes to this revision. dexonsmith added a comment. This revision now requires changes to proceed. > Furthermore, instead of always adding both search paths, we find > the first search path that exists and only add that one. Huh, I'm surprised this wasn't already the behavi

[PATCH] D88984: Prefer libc++ headers in the -isysroot over the toolchain

2020-10-07 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. Note that I don't see any issues besides splitting the patch and dealing with the clang-format linter problems. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88984/new/ https://reviews.llvm.org/D88984 _

[PATCH] D74813: Function block naming - add hash of parameter type to end of block name

2020-10-07 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith resigned from this revision. dexonsmith added a reviewer: Bigcheese. dexonsmith added a subscriber: Bigcheese. dexonsmith added a comment. Herald added a subscriber: dexonsmith. I'll let @erik.pilkington and @Bigcheese finish this review. CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D88984: Prefer libc++ headers in the -isysroot over the toolchain

2020-10-08 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added reviewers: rsmith, teemperor. dexonsmith added a comment. Hmm, that's right, to support user-provided libc++ headers it's simpler if we prefer the toolchain / next-to-clang. The reason we need to invert it is transitional. The status quo is that we have no headers in the SDKs (

[PATCH] D89136: Lex: Avoid MemoryBuffer* key in ExcludedPreprocessorDirectiveSkipMapping, NFC

2020-10-09 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. This is a prep patch for https://reviews.llvm.org/D66782, changing SourceManager to return `Optional` instead of `MemoryBuffer`. With that c

[PATCH] D66782: SourceManager: Prefer Optional over MemoryBuffer*

2020-10-09 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 297245. dexonsmith added a comment. Rebased (on top of https://reviews.llvm.org/D89136). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66782/new/ https://reviews.llvm.org/D66782 Files: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.c

[PATCH] D88984: Prefer libc++ headers in the -isysroot over the toolchain

2020-10-12 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith requested changes to this revision. dexonsmith added a comment. This revision now requires changes to proceed. @rsmith , @teemperor , @ldionne , thoughts on the above? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88984/new/ https://revi

[PATCH] D66782: SourceManager: Prefer Optional over MemoryBuffer*

2020-10-12 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang-tools-extra/clangd/SourceCode.cpp:459 Position P) { - llvm::StringRef Code = SM.getBuffer(SM.getMainFileID())->getBuffer(); + llvm::StringRef Code = SM.getBufferOrFake(S

[PATCH] D89136: Lex: Avoid MemoryBuffer* key in ExcludedPreprocessorDirectiveSkipMapping, NFC

2020-10-12 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 297648. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89136/new/ https://reviews.llvm.org/D89136 Files: clang/include/clang/Lex/PreprocessorExcludedConditionalDirectiveSkipMapping.h clang/lib/Lex/PPDirectives.cpp clang/lib/Tooling/Dependency

[PATCH] D89136: Lex: Avoid MemoryBuffer* key in ExcludedPreprocessorDirectiveSkipMapping, NFC

2020-10-12 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith marked an inline comment as done. dexonsmith added a comment. Agreed, looks cleaner without the indirection. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89136/new/ https://reviews.llvm.org/D89136 ___ cfe-commits mailing list cfe-

[PATCH] D66782: SourceManager: Prefer Optional over MemoryBuffer*

2020-10-12 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith planned changes to this revision. dexonsmith added a comment. I'm going to change my approach here to be less error-prone. The real goal is changing from `MemoryBuffer*` to `MemoryBufferRef`. I was adding `Optional<>` as a cleanup but that's really a nice-to-have, which is better land

[PATCH] D89136: Lex: Avoid MemoryBuffer* key in ExcludedPreprocessorDirectiveSkipMapping, NFC

2020-10-12 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG69feac12d053: Lex: Avoid MemoryBuffer* key in ExcludedPreprocessorDirectiveSkipMapping, NFC (authored by dexonsmith). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D89

[PATCH] D89136: Lex: Avoid MemoryBuffer* key in ExcludedPreprocessorDirectiveSkipMapping, NFC

2020-10-12 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. I cleaned up the access and removed `getBufferPtr` separately in d07b290e4b7c55823895e88b683de4178ffc66db , then landed my change in 69feac12d0539a7cc19cbda906d46f67029486e1

[PATCH] D89348: clang/Basic: Replace ContentCache::getBuffer with Optional semantics

2020-10-13 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added subscribers: ributzka, martong. Herald added a reviewer: shafik. dexonsmith requested review of this revision. Remove `ContentCache::getBuffer`, which always returned a dereferenceable `MemoryBuffer*` and had a `

[PATCH] D89348: clang/Basic: Replace ContentCache::getBuffer with Optional semantics

2020-10-13 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. Note that this is split off from https://reviews.llvm.org/D66782. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89348/new/ https://reviews.llvm.org/D89348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[PATCH] D89348: clang/Basic: Replace ContentCache::getBuffer with Optional semantics

2020-10-13 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 297987. dexonsmith added a comment. Fixed a bug where `Invalid` was only set when it was `true`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89348/new/ https://reviews.llvm.org/D89348 Files: clang-tools-extra/clang-tidy/ClangTidyDiagnosticCo

[PATCH] D89348: clang/Basic: Replace ContentCache::getBuffer with Optional semantics

2020-10-13 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 297990. dexonsmith added a comment. Fix a few more places where `Invalid` needs to be set to `false`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89348/new/ https://reviews.llvm.org/D89348 Files: clang-tools-extra/clang-tidy/ClangTidyDiagnos

[PATCH] D89348: clang/Basic: Replace ContentCache::getBuffer with Optional semantics

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298144. dexonsmith added a comment. Cleaned up the (fixed) `Invalid` logic to reduce the size of the diff and use a consistent pattern. Thanks for you patience with the false start; I think this is ready now. CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D89348: clang/Basic: Replace ContentCache::getBuffer with Optional semantics

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298145. dexonsmith added a comment. Hah, and now I notice while working on a follow-up that `SourceManager::getBufferOrNone` was missing a `const`-qualifier (the use in this patch didn't need it). Fixed that too. CHANGES SINCE LAST ACTION https://revi

[PATCH] D89394: clang/Basic: Stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Update `Basic` to stop relying on a `MemoryBuffer*`, using the `MemoryBufferRef` from `getBufferOrNone` or `getBufferOrFake` instead of `getBu

[PATCH] D89394: clang/Basic: Stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298152. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89394/new/ https://reviews.llvm.org/D89394 Files: clang/include/clang/Basic/SourceManager.h clang/lib/Basic/Diagnostic.cpp clang/lib/Basic/SourceLocation.cpp clang/lib/Basic/SourceManag

[PATCH] D89398: Lexer: Update the Lexer to use MemoryBufferRef, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added subscribers: usaxena95, ributzka, kadircet. dexonsmith requested review of this revision. Update `Lexer` / `Lexer::Lexer` to use `MemoryBufferRef` instead of `MemoryBuffer*`. Callers that were acquiring a `Memory

[PATCH] D89402: clang/Lex: Stop using SourceManager::getBuffer

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Update clang/lib/Lex to stop relying on a `MemoryBuffer*`, using the `MemoryBufferRef` from `getBufferOrNone` since both locations had logic f

[PATCH] D89406: clang/{Format,Rewrite}: Stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Update clang/lib/Format and clang/lib/Rewrite to use a `MemoryBufferRef` from `getBufferOrFake` instead of `MemoryBuffer*` from `getBuffer`.

[PATCH] D89409: clang/Frontend: Mostly stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Update clang/lib/Frontend to use a `MemoryBufferRef` from `getBufferOrFake` instead of `MemoryBuffer*` from `getBuffer`, with the exception

[PATCH] D89411: clang/CodeGen: Mostly stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Update `clang/lib/CodeGen` to use a `MemoryBufferRef` from `getBufferOrNone` instead of `MemoryBuffer*` from `getBuffer`. No functionality ch

[PATCH] D89414: clang/StaticAnalyzer: Stop using SourceManager::getBuffer

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added subscribers: steakhal, ASDenysPetrov, martong, ributzka, dkrupp, donat.nagy, Szelethus, a.sidorin, baloghadamsoftware. dexonsmith requested review of this revision. Update clang/lib/StaticAnalyzer to stop relyin

[PATCH] D89416: clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added subscribers: usaxena95, ributzka, kadircet. Herald added a reviewer: shafik. dexonsmith requested review of this revision. Update clang-tools-extra, clang/tools, clang/unittests to migrate from `SourceManager::ge

[PATCH] D89416: clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298206. dexonsmith added a comment. Removed the now-unused `Invalid` local variable from the libclang change; not sure how I missed the warning before. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89416/new/ https://reviews.llvm.org/D89416 Fil

[PATCH] D89414: clang/StaticAnalyzer: Stop using SourceManager::getBuffer

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298223. dexonsmith added a comment. Fix a warning about an unused `Invalid` flag. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89414/new/ https://reviews.llvm.org/D89414 Files: clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp clang

[PATCH] D89348: clang/Basic: Replace ContentCache::getBuffer with Optional semantics

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd758f79e5d38: clang/Basic: Replace ContentCache::getBuffer with Optional semantics (authored by dexonsmith). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D89348?vs=29

[PATCH] D89427: clang/Frontend: Use MemoryBufferRef in FrontendInputFile (and remove SourceManager::getBuffer)

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. In order to drop the final callers to `SourceManager::getBuffer`, change `FrontendInputFile` to use `Optional`. Also updated the "unowned" ver

[PATCH] D89427: clang/Frontend: Use MemoryBufferRef in FrontendInputFile (and remove SourceManager::getBuffer)

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298242. dexonsmith added a comment. Adding a couple of changes I forgot to stage (remove now-unused `UnownedTag` and a minor simplification to `createFileID`). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89427/new/ https://reviews.llvm.org/D89

[PATCH] D89429: clang/Basic: Replace SourceManager::getMemoryBufferForFile, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Replace `SourceManager::getMemoryBufferForFile`, which returned a dereferenceable `MemoryBuffer*` and had a `bool*Invalid` out parameter, with

[PATCH] D89430: clang/Basic: Remove SourceManager::getBufferPointer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Inline `Source::getBufferPointer` into its only remaining caller, `getBufferOrNone`. No functionality change. https://reviews.llvm.org/D8943

[PATCH] D89431: clang/Basic: ContentCache::InvalidFlag => ContentCache::IsBufferInvalid, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Move a flag out of the `MemoryBuffer*` to unblock changing it to a `unique_ptr`. There are plenty of bits available in the bitfield below. h

[PATCH] D89431: clang/Basic: ContentCache::InvalidFlag => ContentCache::IsBufferInvalid, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298252. dexonsmith added a comment. Add missing constructor initializations for the new bitfield member... CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89431/new/ https://reviews.llvm.org/D89431 Files: clang/include/clang/Basic/SourceManager.

[PATCH] D67030: ContentCache: Simplify by always owning the MemoryBuffer

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298257. dexonsmith edited the summary of this revision. dexonsmith added a comment. Rebased on top of https://reviews.llvm.org/D89431 (the tests haven't finished yet; I'll update if necessary, but this is pretty straightforward). CHANGES SINCE LAST ACTIO

[PATCH] D66782: SourceManager: Prefer Optional over MemoryBuffer*

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith abandoned this revision. dexonsmith added a comment. I finished reimplementing this patch mostly as discussed, culminating in https://reviews.llvm.org/D89431. I've rebased https://reviews.llvm.org/D89431 on top of that. Abandoning this revision. CHANGES SINCE LAST ACTION https://r

[PATCH] D89394: clang/Basic: Stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG54c1bcab9010: clang/Basic: Stop using SourceManager::getBuffer, NFC (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D89409: clang/Frontend: Mostly stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG63af24227981: clang/Frontend: Mostly stop using SourceManager::getBuffer, NFC (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D89445: clang/Basic: Remove ContentCache::getRawBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added subscribers: ributzka, kbarton, nemanjai. dexonsmith requested review of this revision. Replace `ContentCache::getRawBuffer` with `getBufferDataIfLoaded` and `getBufferIfLoaded`, excising another accessor for the

[PATCH] D89411: clang/CodeGen: Stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdde4e0318c4c: clang/CodeGen: Stop using SourceManager::getBuffer, NFC (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://re

[PATCH] D89414: clang/StaticAnalyzer: Stop using SourceManager::getBuffer

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGaf4fb416bd35: clang/StaticAnalyzer: Stop using SourceManager::getBuffer (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://

[PATCH] D89416: clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC

2020-10-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG006519816689: clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D89469: FileManager: Test FileManager::getFileRef

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Add a test demonstrating `getFileRef`'s behaviour, which isn't obvious from code inspection when it's handling a redirected file. https://re

[PATCH] D89488: WIP: FileManager: Shrink FileEntryRef to the size of a pointer

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added subscribers: usaxena95, ributzka, kadircet. dexonsmith requested review of this revision. This is a WIP patch to shrink FileEntryRef to the size of a pointer, posting for early feedback in case someone has some.

[PATCH] D89488: WIP: FileManager: Shrink FileEntryRef to the size of a pointer

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith planned changes to this revision. dexonsmith added a comment. I'd still appreciate feedback on the direction, but `clang/test/ClangScanDeps/modules-full.cpp` is failing (getting `""` listed twice under `"file-deps"` for each translation unit) so I'm marking this as needing changes.

[PATCH] D89445: clang/Basic: Remove ContentCache::getRawBuffer, NFC

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298434. dexonsmith added a comment. Fix a compile error (I forgot to run `check-clang-tools` before). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89445/new/ https://reviews.llvm.org/D89445 Files: clang-tools-extra/clang-tidy/ExpandModularHea

[PATCH] D89498: HeaderSearch: Simplify use of FileEntryRef in HeaderSearch::LookupFile, NFC

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Simplify `HeaderSearch::LookupFile`. Instead of deconstructing a `FileEntryRef` into a name and `FileEntry` and then rebuilding it later, use

[PATCH] D89503: SourceManager: Factor out helpers for common SLocEntry lookup pattern, NFC

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Add helpers `getSLocEntryOrNull`, which handles the `Invalid` logic around `getSLocEntry`, and `getSLocEntryForFile`, which also checks for

[PATCH] D89507: SourceManager: Change SourceManager::isMainFile to take a FileEntry, NFC

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. `SourceManager::isMainFile` does not use the filename, so it doesn't need the full `FileEntryRef`; in fact, it's misleading to take the name b

[PATCH] D89508: SourceManager: getFileEntryRefForID => getNonBuiltinFilenameForID, NFC

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added reviewers: arphaman, Bigcheese. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. `SourceManager::getFileEntryRefForID`'s remaining callers just want the filename component, which is coming from the `FileInfo`. Rep

[PATCH] D89488: WIP: FileManager: Shrink FileEntryRef to the size of a pointer

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. In D89488#2332998 , @dexonsmith wrote: > I'd still appreciate feedback on the direction, but > `clang/test/ClangScanDeps/modules-full.cpp` is failing (getting > `""` listed twice under `"file-deps"` for each translation unit)

[PATCH] D89488: WIP: FileManager: Shrink FileEntryRef to the size of a pointer

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298503. dexonsmith added a comment. Rebased on top of https://reviews.llvm.org/D89508. Still some things to split apart, but the bug is fixed and this is a fair bit smaller. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89488/new/ https://review

[PATCH] D89508: SourceManager: getFileEntryRefForID => getNonBuiltinFilenameForID, NFC

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/lib/Basic/SourceManager.cpp:729-730 if (const SrcMgr::SLocEntry *Entry = getSLocEntryForFile(FID)) if (auto *Content = Entry->getFile().getContentCache()) if (Content && Content->OrigEntry) +return Entry->

[PATCH] D89488: WIP: FileManager: Shrink FileEntryRef to the size of a pointer

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298508. dexonsmith added a comment. Removing some noise from the patch that I missed in the last update. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89488/new/ https://reviews.llvm.org/D89488 Files: clang-tools-extra/clangd/ParsedAST.cpp c

[PATCH] D89514: clangd: Stop calling FileEntryRef::FileEntryRef

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added subscribers: usaxena95, ributzka, kadircet. dexonsmith requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. In `ReplayPreamble::replay`, use `getFileRef` instead of `getFile`, and

[PATCH] D89488: WIP: FileManager: Shrink FileEntryRef to the size of a pointer

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298517. dexonsmith added a comment. Peeled off the clangd change into https://reviews.llvm.org/D89514 and rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89488/new/ https://reviews.llvm.org/D89488 Files: clang/include/clang/Basic/FileMa

[PATCH] D89521: FileManager: Reorder declarations of FileEntry and FileEntryRef, NFC

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. This reduces noise in a future patch, but shouldn't change anything otherwise. https://reviews.llvm.org/D89521 Files: clang/include/clang

[PATCH] D89488: FileManager: Shrink FileEntryRef to the size of a pointer

2020-10-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 298530. dexonsmith retitled this revision from "WIP: FileManager: Shrink FileEntryRef to the size of a pointer" to "FileManager: Shrink FileEntryRef to the size of a pointer". dexonsmith added a comment. Rebase on top of https://reviews.llvm.org/D89521 to

[PATCH] D89554: SourceManager: Clarify that FileInfo always has a ContentCache, NFC

2020-10-16 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: arphaman. Herald added subscribers: ributzka, martong. Herald added a reviewer: shafik. dexonsmith requested review of this revision. It turns out that `FileInfo` *always* has a ContentCache. Clarify that in the code: - Update the pri

[PATCH] D91861: [clang][cli] Split DefaultAnyOf into a default value and ImpliedByAnyOf

2020-11-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. I like this direction; the logic in the `.td` files seems much cleaner. The `MARSHALLING` macro logic seems a bit harder to follow and there may be a bug, but I'm not sure. See comments inline. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:

[PATCH] D91861: [clang][cli] Split DefaultAnyOf into a default value and ImpliedByAnyOf

2020-11-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:4038-4043 if (((FLAGS)&options::CC1Option) && \ - (ALWAYS_EMIT || EXTRACTOR(this->KEYPATH) != DEFAULT_VALUE)) { \ + (ALWAYS_E

[PATCH] D91844: [llvm][clang] Add checks for the smart pointers with the possibility to be null

2020-11-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. Is it possible to split these up into separate patches for unrelated code? Comment at: clang/utils/TableGen/ClangAttrEmitter.cpp:1346-1353 if (!Ptr) { // Search in reverse order so that the most-derived type is handled first. ArrayRef> B

[PATCH] D83694: [clang][cli] Port DependencyOutput option flags to new option parsing system

2020-11-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith requested changes to this revision. dexonsmith added inline comments. This revision now requires changes to proceed. Comment at: clang/include/clang/Driver/Options.td:473 +MarshallingInfoFlag<"DependencyOutputOpts.OutputFormat", "DependencyOutputFormat::Make">, +

[PATCH] D83697: [clang][cli] Port Frontend option flags to new option parsing system

2020-11-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith requested changes to this revision. dexonsmith added a comment. This revision now requires changes to proceed. This is close, just a few nits. Also, since this has the first uses of `IsNegative`, it'd be great to have a couple of tests for one of the flags it's used on. ===

[PATCH] D83694: [clang][cli] Port DependencyOutput option flags to new option parsing system

2020-11-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:156-159 +template +FlagToValueNormalizer makeFlagToValueNormalizer(T Value) { + return FlagToValueNormalizer{std::move(Value)}; } dexonsmith wrote: > Please declare this `s

[PATCH] D83211: Factor out call to EXTRACTOR in generateCC1CommandLine

2020-11-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith requested changes to this revision. dexonsmith added a comment. This revision now requires changes to proceed. Marking as "requested changes" to get this off my queue, but if my lambda suggestion doesn't work well for some reason (maybe it significantly increases compile-time), I'm op

[PATCH] D83211: [clang][cli] Factor out call to EXTRACTOR in generateCC1CommandLine (NFC)

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith accepted this revision. dexonsmith added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83211/new/ https://reviews.llvm.org/D83211

[PATCH] D91861: [clang][cli] Split DefaultAnyOf into a default value and ImpliedByAnyOf

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:4027-4031 + if (((FLAGS)&options::CC1Option) && \ + (ALWAYS_EMIT || \ + (EXTRACT

[PATCH] D83697: [clang][cli] Port Frontend option flags to new option parsing system

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith accepted this revision. dexonsmith added a comment. This revision is now accepted and ready to land. LGTM! Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83697/new/ https://reviews.llvm.org/D83697

[PATCH] D83694: [clang][cli] Port DependencyOutput option flags to new option parsing system

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith accepted this revision. dexonsmith added a comment. This revision is now accepted and ready to land. This LGTM, with one more nit to consider. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:163 +static constexpr bool is_int_convertible() { + return sizeof(T)

[PATCH] D91861: [clang][cli] Split DefaultAnyOf into a default value and ImpliedByAnyOf

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith accepted this revision. dexonsmith added a comment. This revision is now accepted and ready to land. This LGTM. Thanks again for the cleanup, I think the new syntax is more intuitive. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:4027-4031 + if (((FLAGS)&op

[PATCH] D90053: Serialization: Change InputFile to use FileEntryRef and add getVirtualFileRef, NFC

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGac40a2d8f16b: Serialization: Change InputFile to use FileEntryRef and add getVirtualFileRef… (authored by dexonsmith). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D9

[PATCH] D90484: FileManager: Add FileEntryRef::getDir, returning DirectoryEntryRef

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/unittests/Basic/FileEntryTest.cpp:95 OptionalFileEntryRefDegradesToFileEntryPtr M0; OptionalFileEntryRefDegradesToFileEntryPtr M1 = R1; jansvoboda11 wrote: > Dead variable, do we need it? Thanks, nice ca

[PATCH] D90484: FileManager: Add FileEntryRef::getDir, returning DirectoryEntryRef

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1b042de5b29a: FileManager: Add FileEntryRef::getDir, returning DirectoryEntryRef (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D90484: FileManager: Add FileEntryRef::getDir, returning DirectoryEntryRef

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. Thanks again for the review, landed in 1b042de5b29af4869a77ecbc632029fba0313dec . Comment at: clang/unittests/Basic/FileEntryTest.cpp:95 OptionalFileEntryRefDegradesToFileEntr

[PATCH] D83892: [clang][cli] Port CodeGen option flags to new option parsing system

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. In D83892#2417903 , @jansvoboda11 wrote: > This is now ready to be reviewed. If you see a deleted option in the diff, > it's either because it was moved closer to its counterpart, or because it's > now generated by a multicla

[PATCH] D90485: Lex: Update Module::findHeader to return FileEntryRef, NFC

2020-11-30 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf85db7f7ba68: Lex: Update Module::findHeader to return FileEntryRef, NFC (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

<    1   2   3   4   5   6   7   8   9   10   >