[PATCH] D152770: [clang][ExtractAPI] Add support for Objective-C categories

2023-07-13 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Thanks for the patch! Like I mentioned in the inline comments, I'm not sure I understand the need of the "abstract" (in the sense that it's not really a concrete API) subtype of `APIRecord`. The design doesn't feel right within the existing structure. If I recall the orig

[PATCH] D146759: [ExtractAPI] Remove extra attributes in property declaration fragments

2023-04-04 Thread Zixu Wang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG32b53cf9d0c8: [ExtractAPI] Remove extra attributes in property declaration fragments (authored by Unique_Usman, committed by zixuw). Herald added a project: clang. Herald added a subscriber: cfe-commits.

[PATCH] D146656: [clang][ExtractAPI] Refactor ExtractAPIVisitor to make it more extensible

2023-03-24 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. LGTM for the `ExtractAPIVisitor` part. Remaining: - update test with `@LINE` - the libclang side Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146656/new/ https://reviews.llvm.org/D146656 ___

[PATCH] D146656: [clang][ExtractAPI] Refactor ExtractAPIVisitor to make it more extensible

2023-03-22 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/include/clang/ExtractAPI/ExtractAPIVisitor.h:628 +public: + ExtractAPIVisitor(ASTContext &Context, APISet &API) : Base(Context, API) {} + Same as above, should the constructor be `protected`? I guess it depends if w

[PATCH] D146656: [clang][ExtractAPI] Refactor ExtractAPIVisitor to make it more extensible

2023-03-22 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Good to see refactoring to make ExtractAPI easier to extend and use. Thanks Daniel! Some comments on the ExtractAPIVisitor part. I'll leave the libclang part to the experts. Comment at: clang/include/clang/ExtractAPI/ExtractAPIVisitor.h:32 +template +c

[PATCH] D144672: [Sanitizers] Error when attempting to use `static-lsan` with `TSan` or `Asan` on darwin

2023-03-02 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: compiler-rt/test/asan/TestCases/replaceable_new_delete_static.cpp:10-11 + +// darwin only supports shared-libsan, so this should fail. +// XFAIL: darwin + dmaclach wrote: > yln wrote: > > This should work, right? > No..

[PATCH] D144672: [Sanitizers] Error when attempting to use `static-lsan` with `TSan` or `Asan` on darwin

2023-03-01 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Hi! This broke the asan replaceable_new_delete.cpp test on Darwin because it has a run line using `-static-libsan`. Could you take a look? Probably need to separate that check out and mark as unsupported on Darwin Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D140010: [clang][ExtractAPI] Fix naming of typedef'd anonymous enums

2022-12-15 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/ExtractAPI/ExtractAPIVisitor.cpp:174-175 + StringRef Name = Decl->getName(); if (Name.empty()) Name = getTypedefName(Decl); + if (Name.empty

[PATCH] D140010: [clang][ExtractAPI] Fix naming of typedef'd anonymous enums

2022-12-14 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/ExtractAPIVisitor.cpp:174-175 + StringRef Name = Decl->getName(); if (Name.empty()) Name = getTypedefName(Decl); + if (Name.empty()) { dang wrote: > zixuw wrote: > > Aren't these two lines su

[PATCH] D140010: [clang][ExtractAPI] Fix naming of typedef'd anonymous enums

2022-12-14 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/ExtractAPIVisitor.cpp:174-175 + StringRef Name = Decl->getName(); if (Name.empty()) Name = getTypedefName(Decl); + if (Name.empty()) { Aren't these two lines supposed to do this? Repository

[PATCH] D139115: [clang][ExtractAPI] Add support for single symbol SGF

2022-12-06 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/include/clang/ExtractAPI/API.h:128-130 + /// Store hierarchy information for a given record. + /// + /// This is roughly analogous to the DeclContext hierarchy for an AST Node. Misplaced comment? ===

[PATCH] D136455: [clang][ExtractAPI] Add targetFallback to relationships in symbol graph

2022-10-24 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Is it easy to/worth checking if the target is actually outside of the current module to keep the output smaller and concise? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136455/new/ https://reviews.llvm.org/D136455 ___

[PATCH] D135295: [clang][ExtractAPI] Don't print locations for anonymous tags

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5301826fa86a: [clang][ExtractAPI] Don't print locations for anonymous tags (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D135295: [clang][ExtractAPI] Don't print locations for anonymous tags

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D135295#3837895 , @zixuw wrote: > In D135295#3837855 , @zixuw wrote: > >> In D135295#3837734 , @ributzka >> wrote: >> >>> This doesn't affect an

[PATCH] D134813: Properly print unnamed TagDecl objects in diagnostics

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. With the PrintingPolicy fix in https://reviews.llvm.org/D135295 and landed USR fix, the diff within ExtractAPI tests is only the wording with anonymous enums, and we can drop the lit change: 658c658 < "spelling": "(anonymous)" --- > "spelli

[PATCH] D134813: Properly print unnamed TagDecl objects in diagnostics

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. I'm pulling this on top of https://reviews.llvm.org/D135295 to try locally now. Comment at: clang/include/clang/AST/Decl.h:3647 + void printName(raw_ostream &OS, const PrintingPolicy &Policy) const; + nit: missing an `override` here. (

[PATCH] D135295: [clang][ExtractAPI] Don't print locations for anonymous tags

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw marked an inline comment as done. zixuw added a comment. In D135295#3837855 , @zixuw wrote: > In D135295#3837734 , @ributzka > wrote: > >> This doesn't affect any tests? > > Just finished building locally,

[PATCH] D135295: [clang][ExtractAPI] Don't print locations for anonymous tags

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 465505. zixuw added a comment. Update on top of the existing PrintingPolicy in the ASTContext instead of creating a new default one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135295/new/ https://reviews.llvm

[PATCH] D135295: [clang][ExtractAPI] Don't print locations for anonymous tags

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:854 + // Do not include location in anonymous decls. + PrintingPolicy Policy(CI.getASTContext().getLangOpts()); + Policy.AnonymousTagLocations = false; sammccall wrote: > nit:

[PATCH] D135295: [clang][ExtractAPI] Don't print locations for anonymous tags

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D135295#3837734 , @ributzka wrote: > This doesn't affect any tests? Just finished building locally, running tests to verify now Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D13529

[PATCH] D135295: [clang][ExtractAPI] Don't print locations for anonymous tags

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 465486. zixuw added a comment. Set PrintingPolicy properly Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135295/new/ https://reviews.llvm.org/D135295 Files: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp Index:

[PATCH] D134813: Properly print unnamed TagDecl objects in diagnostics

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Setting `PrintingPolicy::AnonymousTagLocations` to `false` in https://reviews.llvm.org/D135295 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134813/new/ https://reviews.llvm.org/D134813 _

[PATCH] D135295: [clang][ExtractAPI] Don't print locations for anonymous tags

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw created this revision. Herald added a subscriber: ributzka. Herald added a reviewer: dang. Herald added a reviewer: ributzka. Herald added a project: All. zixuw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. ExtractAPI doesn't care a

[PATCH] D134813: Properly print unnamed TagDecl objects in diagnostics

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Ah sorry I just finished reading the discussions. IIUC 20c9ac29250493f5e0a3791dc1e5e9114ff0dc6e should have already fixed the USR generation part, and all of the USR updates in the test cases should be

[PATCH] D134813: Properly print unnamed TagDecl objects in diagnostics

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/test/ExtractAPI/typedef_anonymous_record.c:74 "interfaceLanguage": "objective-c", -"precise": "c:@SA@MyStruct" +"precise": "c:@S@MyStruct" }, Why is the `A` dropped here? Isn't this US

[PATCH] D134813: Properly print unnamed TagDecl objects in diagnostics

2022-10-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a subscriber: QuietMisdreavus. zixuw added a comment. In D134813#3836836 , @aaron.ballman wrote: >> I'd guess we need some kind of change to CommentXML and ExtractAPI, but I >> don't know enough to be sure what it should be. > > Ping @dang @

[PATCH] D130918: [clang][ExtractAPI] Record availability information on all platforms

2022-08-02 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw 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/D130918/new/ https://reviews.llvm.org/D130918 ___

[PATCH] D130918: [clang][ExtractAPI] Record availability information on all platforms

2022-08-01 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Thanks Daniel! Comment at: clang/test/ExtractAPI/availability.c:16 +//--- input.h +/// Documentation for a. +void a(void); Do we care about doc comments for this particular test? The testing convention for all the ExtractAPI tests is prob

[PATCH] D130583: [clang][ExtractAPI] Add a space between type and name in property declaration fragments

2022-07-26 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw added a comment. This revision is now accepted and ready to land. Awesome! Thanks Daniel! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130583/new/ https://reviews.llvm.org/D130583 __

[PATCH] D130581: [clang][ExtractAPI] Ensure that class properties have a kind of "Type Property"

2022-07-26 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw added a comment. This revision is now accepted and ready to land. LGTM. Thanks Daniel! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130581/new/ https://reviews.llvm.org/D130581 _

[PATCH] D125678: [clang][extract-api] Don't emit symbols prefixed with an underscore

2022-05-16 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw added a comment. In D125678#3517168 , @QuietMisdreavus wrote: > clang-format failed: > > --- clang-format > > changed files: > > clang/test/ExtractAPI/underscored.c I think it's fine. clang-format alw

[PATCH] D125061: [clang] A more robust way to attach comments

2022-05-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Well, apparently there are still some corner-case bugs in the logic. ExtractAPI and a few other tests failed. Will look into it tomorrow. And if folks have concerns or opinions of the performance/space cost of adding the extra pointer to `DeclBase`, I can try to keep the

[PATCH] D125061: [clang] A more robust way to attach comments

2022-05-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw created this revision. Herald added a subscriber: arphaman. Herald added a reviewer: dang. Herald added a project: All. zixuw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The current implementation in `getRawCommentForDeclNoCacheIm

[PATCH] D124964: Revert "Revert "[clang][extract-api] Use relative includes""

2022-05-04 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGcb5bb28511f2: Revert "Revert "[clang][extract-api] Use relative includes"" (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D124964: Revert "Revert "[clang][extract-api] Use relative includes""

2022-05-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D124964#3492423 , @dang wrote: > LGTM! If I understand the issue correctly we gave `llvm::Regex::match` a > string temporary to match against before and now we store it for long enough > to process the match results? Yup, exac

[PATCH] D124964: Revert "Revert "[clang][extract-api] Use relative includes""

2022-05-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 427140. zixuw added a comment. Whitespace change: clang-format removed an empty line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124964/new/ https://reviews.llvm.org/D124964 Files: clang/include/clang/Extrac

[PATCH] D124964: Revert "Revert "[clang][extract-api] Use relative includes""

2022-05-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw created this revision. zixuw added reviewers: ributzka, dang, cishida. Herald added a project: All. zixuw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Reapply the change after fixing sanitizer errors. The original problem was that

[PATCH] D123831: [clang][extract-api] Use relative includes

2022-05-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Accidentally added another test case in my local workspace. Removed in 5f841c71fc2cc77c92f526791cd7a938bcac69aa Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D123831: [clang][extract-api] Use relative includes

2022-05-04 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4c262fee08b5: [clang][extract-api] Use relative includes (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D123831: [clang][extract-api] Use relative includes

2022-05-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 427061. zixuw added a comment. Herald added a subscriber: arphaman. Update test case to use cc1 instead of driver Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123831/new/ https://reviews.llvm.org/D123831 Files:

[PATCH] D123831: [clang][extract-api] Use relative includes

2022-05-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D123831#3490684 , @dang wrote: > Since this is a new test can we use the approach in > https://reviews.llvm.org/D124634 to check for diagnostics output. I used FileCheck to check the input buffer dump in this test, but I'll try

[PATCH] D123831: [clang][extract-api] Use relative includes

2022-05-03 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 426803. zixuw added a comment. - Capture whether the include is quoted in KnownFiles - Misc: use `getInputBufferName()` instead of string literal Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123831/new/ https://

[PATCH] D123831: [clang][extract-api] Use relative includes

2022-05-02 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 426547. zixuw added a comment. Convert file path to use slashes for headermap reverse lookup Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123831/new/ https://reviews.llvm.org/D123831 Files: clang/lib/ExtractA

[PATCH] D123831: [clang][extract-api] Use relative includes

2022-05-02 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 426540. zixuw added a comment. - Delete test `known_files_only_hmap` - Handle quoted includes - Attempt to fix Windows fails by converting backslashes before matching the framework regex - Update test `relative_include` Repository: rG LLVM Github Monorepo

[PATCH] D124638: [clang] Track how headers get included generally during lookup time

2022-04-28 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw 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/D124638/new/ https://reviews.llvm.org/D124638 ___

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-25 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 425083. zixuw added a comment. - Rewrite commit message for preparation - Remove shortening paths based on the current working directory: it does not work with angled includes, and unnecessary for our use - XFAIL test known_files_only_hmap.c, as it is not a val

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-25 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:134 +if (!SpelledFilename.empty()) + return SpelledFilename.str(); + zixuw wrote: > zixuw wrote: > > One problem I can see in this right now is that there might

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-25 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:134 +if (!SpelledFilename.empty()) + return SpelledFilename.str(); + zixuw wrote: > One problem I can see in this right now is that there might be multiple > he

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-25 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:134 +if (!SpelledFilename.empty()) + return SpelledFilename.str(); + One problem I can see in this right now is that there might be multiple headermaps that tog

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-25 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 425017. zixuw added a comment. - Create FileManager in PrepareToExecuteAction - Use FileManager to load headermaps and reverse lookup mappings - Use FileSystem to correctly get working directory and make absolute paths Repository: rG LLVM Github Monorepo CH

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-25 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. The problem is that we are trying to shorten the input file paths in `PrepareToExecuteAction`, where the `CompilerInstance` is still primal and doesn't even have a `FileManager` that we could use. That makes it hard (if possible at all) to reverse lookup headermaps and us

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-25 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 424959. zixuw added a comment. - Use first match in `getRelativeIncludeName` - Try to get Preprocessor and reverse lookup headermaps in `getRelativeIncludeName` - Use `getRelativeIncludeName` to check for known files in `LocationFileChecker` - Misc fixes & adju

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-14 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 423011. zixuw added a comment. Add test case to demonstrate the framework case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123831/new/ https://reviews.llvm.org/D123831 Files: clang/lib/ExtractAPI/ExtractAPI

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-14 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:87 +Dir = DirPath; +for (auto NI = path::begin(File), NE = path::end(File), + DI = path::begin(Dir), DE = path::end(Dir); I still need to dig into this logic

[PATCH] D123831: [POC][WIP] Use relative include in extract-api

2022-04-14 Thread Zixu Wang via Phabricator via cfe-commits
zixuw created this revision. zixuw added reviewers: ributzka, dang, cishida. Herald added a project: All. zixuw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Proof-of-concept patch. Needs more work. Transform input headers to relative (an

[PATCH] D123533: [clang][extract-api] Add support for true anonymous enums

2022-04-12 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw 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/D123533/new/ https://reviews.llvm.org/D123533 ___ c

[PATCH] D123526: [clang][ExtractAPI][NFC] Fix sed delimiter in test

2022-04-12 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe08c435401bc: [clang][ExtractAPI][NFC] Fix sed delimiter in test (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D123533: [clang][extract-api] Add support for true anonymous enums

2022-04-12 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/test/ExtractAPI/enum.c:693 +], +"title": "(anonymous)" + }, dang wrote: > zixuw wrote: > > So the `Name` of the record is literally `(anonymous)`? I think this might > > create problems (well I

[PATCH] D123533: [clang][extract-api] Add support for true anonymous enums

2022-04-11 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/test/ExtractAPI/enum.c:684 +}, +"uri": "file:///Users/dgrumberg/VersionControlledDocuments/oss/llvm-project/build/tools/clang/test/ExtractAPI/Output/enum.c.tmp/input.h" + }, nit: normalize ===

[PATCH] D123526: [clang][ExtractAPI][NFC] Fix sed delimiter in test

2022-04-11 Thread Zixu Wang via Phabricator via cfe-commits
zixuw created this revision. Herald added a reviewer: dang. Herald added a project: All. zixuw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fix path replacement in sed (properly this time) using lit regex_replacement. Repository: rG

[PATCH] D123304: [clang][extract-api] Emit "functionSignature" in SGF for ObjC methods.

2022-04-11 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw 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/D123304/new/ https://reviews.llvm.org/D123304 ___

[PATCH] D123304: [clang][extract-api] Emit "functionSignature" in SGF for ObjC methods.

2022-04-11 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:495 +if (const auto *Method = dyn_cast(Member.get())) + serializeObject(*MemberRecord, "functionSignature", dang wrote: > zixuw wrote: > > I'd prefer

[PATCH] D123304: [clang][extract-api] Emit "functionSignature" in SGF for ObjC methods.

2022-04-07 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:495 +if (const auto *Method = dyn_cast(Member.get())) + serializeObject(*MemberRecord, "functionSignature", I'd prefer not to use `dyn_cast` as `Membe

[PATCH] D123261: [clang][ExtractAPI] Fix declaration fragments for ObjC methods

2022-04-07 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4048aad85a84: [clang][ExtractAPI] Fix declaration fragments for ObjC methods (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D123295: [clang][extract-api] Use dedicated API to check for macro equality

2022-04-07 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw 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/D123295/new/ https://reviews.llvm.org/D123295 ___ c

[PATCH] D123259: [clang][ExtractAPI] Fix appendSpace in DeclarationFragments

2022-04-07 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGfe2c77a0065c: [clang][ExtractAPI] Fix appendSpace in DeclarationFragments (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D123261: [clang][ExtractAPI] Fix declaration fragments for ObjC methods

2022-04-06 Thread Zixu Wang via Phabricator via cfe-commits
zixuw created this revision. Herald added a reviewer: dang. Herald added a project: All. zixuw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Objective-C methods selector parts should be considered as identifiers. Depends on D123259

[PATCH] D123259: [clang][ExtractAPI] Fix appendSpace in DeclarationFragments

2022-04-06 Thread Zixu Wang via Phabricator via cfe-commits
zixuw created this revision. Herald added a reviewer: dang. Herald added a project: All. zixuw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. There is a bug in `DeclarationFragments::appendSpace` where the space character is added to a loc

[PATCH] D122774: [clang][extract-api] Add Objective-C Category support

2022-04-06 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG178aad9b946e: [clang][extract-api] Add Objective-C Category support (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D122774: [clang][extract-api] Add Objective-C Category support

2022-04-06 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 420964. zixuw added a comment. Remove extra commas in test case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122774/new/ https://reviews.llvm.org/D122774 Files: clang/include/clang/ExtractAPI/API.h clang/i

[PATCH] D122774: [clang][extract-api] Add Objective-C Category support

2022-04-06 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 420956. zixuw added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122774/new/ https://reviews.llvm.org/D122774 Files: clang/include/clang/ExtractAPI/API.h clang/include/clang/ExtractAPI/Dec

[PATCH] D123019: [clang][extract-api] Add support for typedefs

2022-04-06 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw 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/D123019/new/ https://reviews.llvm.org/D123019 __

[PATCH] D123045: [clang][extract-api] Fix small issues with SymbolGraphSerializer

2022-04-06 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw added a comment. Unused include of declaration fragments in SymbolGraphSerializer. Otherwise LGTM! Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:17 #include "clang/ExtractAPI/API.h" +#include "clang/ExtractAPI/Dec

[PATCH] D123148: [clang][extract-api] Process only APIs declared in inputs

2022-04-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/test/ExtractAPI/known_files_only.c:20 +// Let's make sure we aren't pulling in symbols from complex.h +#include +double complex build_complex(double real, double imaginary); I would just include another header split

[PATCH] D123019: [clang][extract-api] Add support for typedefs

2022-04-05 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:611 + + (*Typedef)["type"] = Record.UnderlyingType.USR; + Curious: where does this come from the format spec? Is this required/correctly populated? I see a `ty

[PATCH] D123045: [clang][extract-api] Fix small issues with SymbolGraphSerializer

2022-04-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:510 Symbols.emplace_back(std::move(*Obj)); + PathComponentContext.pop_back(); } zixuw wrote: > QuietMisdreavus wrote: > > zixuw wrote: > > > What's the cost

[PATCH] D122774: [clang][extract-api] Add Objective-C Category support

2022-04-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 420333. zixuw marked an inline comment as done. zixuw added a comment. Address review comment: - Use `llvm_unreachable` for the Objective-C category case in `serializeSymbolKind` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D122774: [clang][extract-api] Add Objective-C Category support

2022-04-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw marked an inline comment as done. zixuw added inline comments. Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:396 break; + case APIRecord::RK_ObjCCategory: +Kind["identifier"] = AddLangPrefix("category"); dang wrote: > Si

[PATCH] D123045: [clang][extract-api] Fix small issues with SymbolGraphSerializer

2022-04-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:510 Symbols.emplace_back(std::move(*Obj)); + PathComponentContext.pop_back(); } QuietMisdreavus wrote: > zixuw wrote: > > What's the cost/would it worth it

[PATCH] D123045: [clang][extract-api] Fix small issues with SymbolGraphSerializer

2022-04-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D123045#3427699 , @QuietMisdreavus wrote: > After a quick scan comparing the current output of these symbol graphs with > the primary library used for reading them > , the last th

[PATCH] D123019: [clang][extract-api] Add support for typedefs

2022-04-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/DeclarationFragments.cpp:15 +#include "TypedefUnderlyingTypeResolver.h" + #include "clang/ExtractAPI/DeclarationFragments.h" Empty line Comment at: clang/lib/ExtractAPI/Serializatio

[PATCH] D123045: [clang][extract-api] Fix small issues with SymbolGraphSerializer

2022-04-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:17 #include "clang/ExtractAPI/API.h" +#include "clang/ExtractAPI/DeclarationFragments.h" #include "llvm/Support/JSON.h" Not needed Comment a

[PATCH] D123056: [clang][extract-api] Undefining macros should not result in a crash

2022-04-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw added a comment. This revision is now accepted and ready to land. Ha! Nice catch! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123056/new/ https://reviews.llvm.org/D123056 __

[PATCH] D122798: [clang][extract-api][NFC] Add documentation

2022-04-04 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Has this landed yet? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122798/new/ https://reviews.llvm.org/D122798 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[PATCH] D122774: [clang][extract-api] Add Objective-C Category support

2022-03-31 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 419474. zixuw added a comment. Add missing documentatin for ObjCCategoryRecord. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122774/new/ https://reviews.llvm.org/D122774 Files: clang/include/clang/ExtractAPI/

[PATCH] D122774: [clang][extract-api] Add Objective-C Category support

2022-03-30 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 419298. zixuw added a comment. Remove probably unnecessary includes added automatically by clangd. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122774/new/ https://reviews.llvm.org/D122774 Files: clang/includ

[PATCH] D122774: [clang][extract-api] Add Objective-C Category support

2022-03-30 Thread Zixu Wang via Phabricator via cfe-commits
zixuw created this revision. Herald added a reviewer: dang. Herald added a project: All. zixuw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add (partial) support for Objective-C category records in ExtractAPI. The current ExtractAPI coll

[PATCH] D122611: [clang][extract-api] Add support for macros

2022-03-30 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw 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/D122611/new/ https://reviews.llvm.org/D122611 ___

[PATCH] D122648: [clang][extractapi] Tie API and serialization to the FrontendAction

2022-03-30 Thread Zixu Wang via Phabricator via cfe-commits
zixuw accepted this revision. zixuw added a comment. This revision is now accepted and ready to land. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122648/new/ https://reviews.llvm.org/D122648 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D122611: [clang][extract-api] Add support for macros

2022-03-29 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/include/clang/ExtractAPI/API.h:334 + using RecordMap = llvm::MapVector>; + /// /// Get the target triple for the ExtractAPI invocation. Extra/should-be-empty line here? Comment at: clang/lib/E

[PATCH] D122511: [clang][extract-api] Add Objective-C protocol support

2022-03-29 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd1d34bafef56: [clang][extract-api] Add Objective-C protocol support (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D122446: [clang][extract-api] Add Objective-C interface support

2022-03-29 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. zixuw marked an inline comment as done. Closed by commit rG9b36e126fdb1: [clang][extract-api] Add Objective-C interface support (authored by zixuw). Repository: rG L

[PATCH] D122648: [clang][extractapi] Tie API and serialization to the FrontendAction

2022-03-29 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Mostly LGTM after addressing the inline comments. Comment at: clang/include/clang/ExtractAPI/FrontendActions.h:42-58 /// Prepare to execute the action on the given CompilerInstance. /// /// This is called before executing the action on any inputs

[PATCH] D122446: [clang][extract-api] Add Objective-C interface support

2022-03-29 Thread Zixu Wang via Phabricator via cfe-commits
zixuw marked an inline comment as done. zixuw added inline comments. Comment at: clang/lib/ExtractAPI/DeclarationFragments.cpp:642-648 +// Instantiate template for FunctionDecl. +template FunctionSignature +DeclarationFragmentsBuilder::getFunctionSignature(const FunctionDecl *);

[PATCH] D122495: [clang][extract-api] Use correct language info from inputs

2022-03-29 Thread Zixu Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG15bf0e567375: [clang][extract-api] Use correct language info from inputs (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D122611: [clang][extract-api] Add support for macros

2022-03-28 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h:22 #include "clang/ExtractAPI/Serialization/SerializerBase.h" +#include "clang/Lex/PreprocessingRecord.h" #include "llvm/Support/JSON.h" Why do we nee

[PATCH] D122511: [clang][extract-api] Add Objective-C protocol support

2022-03-28 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:269 +// Collect symbol information. +StringRef Name = Decl->getName(); +StringRef USR = API.recordUSR(Decl); dang wrote: > I think we should be recording this in Stri

[PATCH] D122511: [clang][extract-api] Add Objective-C protocol support

2022-03-28 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 418744. zixuw marked 2 inline comments as done. zixuw added a comment. Rebase upstream changes in D122446 : - Move the change of the `objc_interface.m` test to D122446 . Repository: rG LLV

[PATCH] D122446: [clang][extract-api] Add Objective-C interface support

2022-03-28 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added inline comments. Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:245 +if (const auto *SuperClassDecl = Decl->getSuperClass()) { + SuperClass.Name = SuperClassDecl->getObjCRuntimeNameAsString(); + SuperClass.USR = API.recordUSR(SuperClassDecl); --

[PATCH] D122446: [clang][extract-api] Add Objective-C interface support

2022-03-28 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 418738. zixuw marked 4 inline comments as done. zixuw added a comment. - Address review comments: - Use template to reuse logic for building function signatures for FunctionDecl and ObjCMethodDecl. - Move the change of `objc_interface.m` test in this patch fr

  1   2   >