This revision was automatically updated to reflect the committed changes.
Closed by commit rG6ebd0aa42066: [include-cleaner] Record macro references in
#ifdef clause. (authored by VitaNuo, committed by hokein).
Changed prior to commit:
https://reviews.llvm.org/D138559?vs=477722&id=477759#toc
R
hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.
Thanks, LGTM. I will commit it for you.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
VitaNuo updated this revision to Diff 477722.
VitaNuo added a comment.
Simplify test.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
Files:
clang-tools-extra/include-cleaner/lib/Record.cpp
clang-tool
VitaNuo added inline comments.
Comment at: clang-tools-extra/include-cleaner/unittests/RecordTest.cpp:249
+
+ Inputs.Code = MainFile.code();
+ auto AST = build();
hokein wrote:
> The `elifndef` and `elifdef` is a C++2b extension feature, so
> `Inputs.ExtraArgs
VitaNuo updated this revision to Diff 477721.
VitaNuo added a comment.
Add -std=c++2b argument to avoid compiler warnings.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
Files:
clang-tools-extra/includ
hokein added inline comments.
Comment at: clang-tools-extra/include-cleaner/unittests/RecordTest.cpp:235
+
+int main() {
+ #ifdef Y
nit: we can get rid of the main function, it is not needed.
Comment at: clang-tools-extra/include-clean
VitaNuo updated this revision to Diff 477716.
VitaNuo added a comment.
Formatting.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
Files:
clang-tools-extra/include-cleaner/lib/Record.cpp
clang-tools-e
VitaNuo added inline comments.
Comment at: clang-tools-extra/include-cleaner/unittests/RecordTest.cpp:248
+ SourceManager &SM = AST.sourceManager();
+ ASSERT_THAT(Recorded.MacroReferences, Not(IsEmpty()));
+
hokein wrote:
> nit: this can be removed, as the EXPE
VitaNuo added inline comments.
Comment at: clang-tools-extra/include-cleaner/lib/Record.cpp:95
private:
- void recordMacroRef(const Token &Tok, const MacroInfo &MI) {
+ void recordMacroRef(const Token &Tok, const MacroInfo &MI, RefType RT) {
if (MI.isBuiltinMacro())
-
VitaNuo updated this revision to Diff 477711.
VitaNuo added a comment.
Address review comments. Format and simplify code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
Files:
clang-tools-extra/include
VitaNuo updated this revision to Diff 477707.
VitaNuo added a comment.
Add support for #if defined(X), #elifdef, #elifndef
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
Files:
clang-tools-extra/includ
hokein added inline comments.
Comment at: clang-tools-extra/include-cleaner/lib/Record.cpp:87
+ void Ifdef(SourceLocation Loc, const Token &MacroNameTok,
+ const MacroDefinition &MD) override {
+if (!Active)
the indentation doesn't look r
VitaNuo updated this revision to Diff 477554.
VitaNuo added a comment.
Make explicit RefType default.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
Files:
clang-tools-extra/include-cleaner/lib/Record.
VitaNuo updated this revision to Diff 477551.
VitaNuo added a comment.
Remove the extra test.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
Files:
clang-tools-extra/include-cleaner/lib/Record.cpp
cl
VitaNuo updated this revision to Diff 477549.
VitaNuo added a comment.
Update.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
Files:
clang-tools-extra/include-cleaner/lib/Record.cpp
clang-tools-extra
hokein added a comment.
Thanks, this code looks good to me overall. I think we can extend it to handle
the `Defined`, `Elifdef`, `Elifndef` cases.
And please add a `[include-cleaner]` prefix in the commit title.
Comment at: clang-tools-extra/include-cleaner/lib/Record.cpp:95
VitaNuo updated this revision to Diff 477461.
VitaNuo added a comment.
Update
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138559/new/
https://reviews.llvm.org/D138559
Files:
clang-tools-extra/include-cleaner/lib/Record.cpp
clang-tools-extra/
VitaNuo created this revision.
Herald added a project: All.
VitaNuo requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.
Records macro references in #ifdef clauses as ambiguous.
Repository:
rG LLVM Github Monorepo
https://review
18 matches
Mail list logo