[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-18 Thread Volodymyr Sapsai via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL342517: Add a callback for `__has_include` and use it for dependency scanning. (authored by vsapsai, committed by ). Herald added subscribers: llvm-commits, jsji. Changed prior to commit:

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-17 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 too. https://reviews.llvm.org/D30882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-17 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment. @dexonsmith, does my change address your concerns? https://reviews.llvm.org/D30882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-14 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added inline comments. Comment at: clang/lib/Frontend/DependencyFile.cpp:340 +return; + StringRef Filename = File->getName(); + if (!FileMatchesDepCriteria(Filename.data(), FileType)) vsapsai wrote: > rsmith wrote: > >

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-14 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added inline comments. Comment at: clang/lib/Frontend/DependencyFile.cpp:300-304 StringRef Filename = FE->getName(); if (!FileMatchesDepCriteria(Filename.data(), FileType)) return; AddFilename(llvm::sys::path::remove_leading_dotslash(Filename));

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-14 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Frontend/DependencyFile.cpp:340 +return; + StringRef Filename = File->getName(); + if (!FileMatchesDepCriteria(Filename.data(), FileType)) Should we really be using the (arbitrary) name of the file from

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-14 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: lib/Frontend/DependencyFile.cpp:325 +void DFGImpl::HasInclude(SourceLocation Loc, const FileEntry *File) { + if (!File) +return; vsapsai wrote: > rsmith wrote: > > Have you thought about whether we should add a

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-14 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai marked 2 inline comments as done. vsapsai added inline comments. Comment at: lib/Frontend/DependencyFile.cpp:325 +void DFGImpl::HasInclude(SourceLocation Loc, const FileEntry *File) { + if (!File) +return; rsmith wrote: > Have you thought about

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-14 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai marked 3 inline comments as done. vsapsai added inline comments. Comment at: include/clang/Lex/PPCallbacks.h:263 + /// \brief Callback invoked when a has_include directive is read. + virtual void HasInclude(SourceLocation Loc, const FileEntry *File) { + }

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-14 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai updated this revision to Diff 165610. vsapsai added a comment. - Improve tests, fix -MMD, address comments. https://reviews.llvm.org/D30882 Files: clang/include/clang/Lex/PPCallbacks.h clang/lib/Frontend/DependencyFile.cpp clang/lib/Lex/PPMacroExpansion.cpp

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-09-14 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai commandeered this revision. vsapsai added a reviewer: pete. vsapsai added a comment. Taking over the change, I'll address the reviewers' comments. https://reviews.llvm.org/D30882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-04-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: include/clang/Lex/PPCallbacks.h:263 + /// \brief Callback invoked when a has_include directive is read. + virtual void HasInclude(SourceLocation Loc, const FileEntry *File) { + } This callback seems pretty unhelpful

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-04-23 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. In https://reviews.llvm.org/D30882#1075589, @dexonsmith wrote: > In https://reviews.llvm.org/D30882#1075576, @pete wrote: > > > Would it be ok to turn this on by default, without a flag, only in the case > > of the path actually existing, and only the found path

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-04-23 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. In https://reviews.llvm.org/D30882#1075576, @pete wrote: > Oh, that actually wasn't my intention when I wrote it. > > Honestly I didn't expect it to log anything for missing paths at all, as we > don't currently log all the missing (but attempted) paths for regular

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-04-23 Thread Pete Cooper via Phabricator via cfe-commits
pete added a comment. In https://reviews.llvm.org/D30882#1075461, @dexonsmith wrote: > In https://reviews.llvm.org/D30882#1075407, @ddunbar wrote: > > > In https://reviews.llvm.org/D30882#1074822, @dexonsmith wrote: > > > > > I don't think this is quite right. I know at least `make`-based > >

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-04-23 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. In https://reviews.llvm.org/D30882#1075407, @ddunbar wrote: > In https://reviews.llvm.org/D30882#1074822, @dexonsmith wrote: > > > I don't think this is quite right. I know at least `make`-based > > incremental builds wouldn't deal well with this. > > > This is

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-04-23 Thread Daniel Dunbar via Phabricator via cfe-commits
ddunbar added a comment. In https://reviews.llvm.org/D30882#1074822, @dexonsmith wrote: > I don't think this is quite right. I know at least `make`-based incremental > builds wouldn't deal well with this. This is actually not a novel problem w.r.t. this patch. The exact same situation comes

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-04-22 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: kbarton. I don't think this is quite right. I know at least `make`-based incremental builds wouldn't deal well with this. Given t.cpp: #if

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2017-03-13 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno accepted this revision. bruno added a comment. This revision is now accepted and ready to land. Hi Pete, thanks for working on this! LGTM with the minor comments below. Comment at: include/clang/Lex/PPCallbacks.h:264 + virtual void HasInclude(SourceLocation Loc, const

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2017-03-13 Thread Pete Cooper via Phabricator via cfe-commits
pete created this revision. Herald added a subscriber: nemanjai. This adds a PP callback for the __has_include and __has_include_next directives. Checking for the presence of a header should add it to the list of header dependencies so this overrides the callback in the dependency scanner. I