[PATCH] D85474: Add -fbinutils-version= to gate ELF features on the specified binutils version

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. In D85474#2343326 , @MaskRay wrote: > In D85474#2342365 , @compnerd wrote: > >> Is there a reason to not use the existing `-mlinker-version=` option and >> expanding that beyond just Dar

[PATCH] D89722: SourceManager: Simplify early returns in ContentCache::getBufferOrNone, NFC

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4aa97e3dacf3: SourceManager: Simplify early returns in ContentCache::getBufferOrNone, NFC (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG296314516d10: ContentCache: Simplify by always owning the MemoryBuffer (authored by dexonsmith). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D67030?vs=298257&id=2995

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

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1d78e2101ab7: clang/Basic: ContentCache::InvalidFlag => ContentCache::IsBufferInvalid, NFC (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D89834: FileManager: Improve the FileEntryRef API and add MaybeFileEntryRef

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. Note that https://reviews.llvm.org/D89836 is an example of a follow-up patch that leverages these API changes. The original version of that patch was much, much noisier. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89834/new/ https://reviews.llvm.org/D8983

[PATCH] D89836: Change Module::ASTFile and ModuleFile::File => MaybeFileEntryRef, NFC

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added reviewers: arphaman, JDevlieghere, teemperor. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Change `Module::ASTFile` and `ModuleFile::File` to use `MayeFileEntryRef` instead of `const FileEntry *`. One of many

[PATCH] D89835: ModuleManager: Simplify lookupModuleFile by only setting the out parameter once, NFC

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: JDevlieghere. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. https://reviews.llvm.org/D89835 Files: clang/lib/Serialization/ModuleManager.cpp Index: clang/lib/Serialization/ModuleManager.cpp ===

[PATCH] D89834: FileManager: Improve the FileEntryRef API and add MaybeFileEntryRef

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 299506. dexonsmith added a comment. Attaching the correct diff :/. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89834/new/ https://reviews.llvm.org/D89834 Files: clang/include/clang/Basic/FileEntry.h clang/unittests/Basic/CMakeLists.txt c

[PATCH] D89834: FileManager: Improve the FileEntryRef API and add MaybeFileEntryRef

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added reviewers: JDevlieghere, arphaman, teemperor. Herald added subscribers: llvm-commits, ributzka, mgorny. Herald added a project: LLVM. dexonsmith requested review of this revision. Make a few changes to the `FileEntryRef` API in preparation for pro

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

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

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

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

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

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. ping In D67030#2331280 , @dexonsmith wrote: > 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). (FTR, the tests passed as expec

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

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. Herald added a subscriber: ormris. In D89469#2342117 , @arphaman wrote: > Thanks. Could you expand the comment in the test that this test path > specifically exercises the behavior produced by the RedirectingFileSystem? Yup, d

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

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG729d7d23282e: FileManager: Test FileManager::getFileRef (authored by dexonsmith). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D89469?vs=298379&id=299416#toc Reposit

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

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG51d1d585e583: clang/Frontend: Use MemoryBufferRef in FrontendInputFile (and remove… (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

[PATCH] D89761: Split out llvm/Support/FileSystem/UniqueID.h and clang/Basic/FileEntry.h, NFC

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 299365. dexonsmith added a comment. Use `#include ` to pull `StringRef` and `Optional` into `clang::`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89761/new/ https://reviews.llvm.org/D89761 Files: clang/include/clang/Basic/FileEntry.h cla

[PATCH] D89761: Split out llvm/Support/FileSystem/UniqueID.h and clang/Basic/FileEntry.h, NFC

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/include/clang/Basic/FileEntry.h:33 + +using llvm::Optional; +using llvm::StringRef; dexonsmith wrote: > JDevlieghere wrote: > > Won't this now make `llvm::Optional` visible as `clang::Optional` > > everywhere t

[PATCH] D89719: [clang][Basic] Make SourceLocation usable as key in hash maps, NFCI

2020-10-20 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/D89719/new/ https://reviews.llvm.org/D89719

[PATCH] D89761: Split out llvm/Support/FileSystem/UniqueID.h and clang/Basic/FileEntry.h, NFC

2020-10-20 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/include/clang/Basic/FileEntry.h:33 + +using llvm::Optional; +using llvm::StringRef; JDevlieghere wrote: > Won't this now make `llvm::Optional` visible as `clang::Optional` everywhere > this header is included?

[PATCH] D89761: Split out llvm/Support/FileSystem/UniqueID.h and clang/Basic/FileEntry.h, NFC

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added reviewers: teemperor, Bigcheese, arphaman, JDevlieghere. Herald added subscribers: llvm-commits, ributzka, mgorny. Herald added a project: LLVM. dexonsmith requested review of this revision. Split out llvm/Support/FileSystem/UniqueID.h and clang/B

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

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith updated this revision to Diff 299246. dexonsmith edited the summary of this revision. dexonsmith added a comment. Improved the naming of the helper types for `FileEntryRef` and the `SeenFileEntries` map and removed dead code for the old typedef. Found when working on a follow-up. CH

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

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

[PATCH] D89749: SourceManager: Don't allocate an SLocEntry until it's loaded

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added reviewers: teemperor, Bigcheese. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Convert `SLocEntryLoaded` into an index vector into `LoadedSLocEntryTable`, where 0 indicates "not loaded", and change `LoadedSLocE

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

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb3eff6b7bb31: Lexer: Update the Lexer to use MemoryBufferRef, NFC (authored by dexonsmith). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D89748: SourceManager: Use the same fake SLocEntry whenever it fails to load

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: teemperor. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. Instead of putting a fake `SLocEntry` at `LoadedSLocEntryTable[Index]` when it fails to load in `SourceManager::loadSLocEntry`, allocate a fa

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

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/include/clang/Lex/Lexer.h:145 /// outlive it, so it doesn't take ownership of either of them. - Lexer(FileID FID, const llvm::MemoryBuffer *InputFile, Preprocessor &PP); + Lexer(FileID FID, const llvm::MemoryBufferRef &Inpu

[PATCH] D31363: [libc++] Remove cmake glob for source files

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith resigned from this revision. dexonsmith added a reviewer: ldionne. dexonsmith added a comment. In D31363#889044 , @smeenai wrote: > @rjmccall, this adds a libc++ build dependency on LLVM's cmake modules. There > were some issues when @zturner ha

[PATCH] D22943: [Driver] Add FIXME's where we can't use effective triples (NFC)

2020-10-19 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. Herald added subscribers: pengfei, fedor.sergeev, kristof.beyls, krytarowski. Herald added a reviewer: JDevlieghere. I'm not sure if you're still interested in pursuing this, b

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

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/include/clang/Lex/Lexer.h:145 /// outlive it, so it doesn't take ownership of either of them. - Lexer(FileID FID, const llvm::MemoryBuffer *InputFile, Preprocessor &PP); + Lexer(FileID FID, const llvm::MemoryBufferRef &Inpu

[PATCH] D69903: [Basic] Introduce PODSourceLocation, NFCI

2020-10-19 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. An alternative would be to update the unions to an `AlignedCharArrayUnion` and use `SourceLocation` directly. WDYT? Comment at: clang/include/clang/AST/Dec

[PATCH] D69844: [Basic] Integrate SourceLocation and SourceRange with FoldingSet, NFCI

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith requested changes to this revision. dexonsmith added a reviewer: dexonsmith. dexonsmith added inline comments. Comment at: clang/include/clang/Basic/SourceLocation.h:184-185 + /// Write this source location to a FoldingSetNodeID + void Profile(llvm::FoldingSetNodeI

[PATCH] D69840: [clang] Use SourceLocation as key in hash maps, NFCI

2020-10-19 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. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69840/new/ https://reviews.llvm.org/D69840 ___ cfe-commits mailing list cfe-co

[PATCH] D89719: [clang][Basic] Make SourceLocation usable as key in hash maps, NFCI

2020-10-19 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. We don't usually add code without any current users. I suggest either adding a small unit test proving `SourceLocation` can now be used as a `DenseMap` key (probably preferre

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

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/lib/Basic/SourceManager.cpp:121-127 llvm::Optional ContentCache::getBufferOrNone(DiagnosticsEngine &Diag, FileManager &FM, SourceLocation Loc) const { if (auto *B = getBufferPointer(Diag, FM,

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

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

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

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/lib/Basic/SourceManager.cpp:167 Buffer.setInt(Buffer.getInt() | InvalidFlag); +return None; dexonsmith wrote: > JDevlieghere wrote: > > Orthogonal to this patch but an idea for a follow-up: this seems

[PATCH] D89722: SourceManager: Simplify early returns in ContentCache::getBufferOrNone, NFC

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith created this revision. dexonsmith added a reviewer: JDevlieghere. Herald added a subscriber: ributzka. dexonsmith requested review of this revision. As suggested in the review for https://reviews.llvm.org/D89430, simplify the logic for marking the buffer as invalid in the early return p

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

2020-10-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. Thanks for the review! Comment at: clang/lib/Basic/SourceManager.cpp:167 Buffer.setInt(Buffer.getInt() | InvalidFlag); +return None; JDevlieghere wrote: > Orthogonal to this patch but an idea for a follow-up: this seems li

[PATCH] D89705: [clang] Use SourceLocation as key in std::map, NFCI

2020-10-19 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, assuming fix the linter problem by running `git show -U0 | clang-format-diff.py -i -p1` (or similar). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://

[PATCH] D24688: Introduce "hosted" module flag.

2020-10-17 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. Herald added subscribers: kerbowa, steven_wu, atanasyan, zzheng, MaskRay, fedor.sergeev, hiraditya, jvesely, sdardis, emaste. Herald added a reviewer: espindola. Herald added a

[PATCH] D45639: [Driver] Support default libc++ library location on Darwin

2020-10-17 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. If this is still relevant, I’m happy for @ldionne and @Bigcheese to make the call. Repository: rC Clang

[PATCH] D58559: emit '(assertions enabled)' in the version string for a build of clang with assertions enabled

2020-10-16 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 "Request changes" to get this off my queue; are you still interested in pursuing this? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D69840: [Basic] Make SourceLocation usable as key in hash maps, NFCI

2020-10-16 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. Herald added a subscriber: sstefan1. If you're still interested in pursuing this, I'm happy to review it. A general comment is that there are a couple of functional changes in

[PATCH] D89580: SourceManager: Fix an SLocEntry memory regression introduced with FileEntryRef

2020-10-16 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. 4dc5573acc0d2e7c59d8bac2543eb25cb4b32984 added `FileEntryRef` in order to help enable sharing of a `FileManager` between `CompilerIn

[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] 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] 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: 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] 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 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] 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 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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-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-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 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 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] 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] 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] 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
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] 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] 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] 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

<    5   6   7   8   9   10   11   12   13   14   >