[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-21 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D119479#3388498 , @uabelho wrote: > Hello, > > Did you see this sanitizer error when running global_record.c? > > https://lab.llvm.org/buildbot/#/builders/5/builds/20765/steps/13/logs/stdio @dang fixed this in fc3537697db7724834

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-17 Thread Mikael Holmén via Phabricator via cfe-commits
uabelho added a comment. In D119479#3389684 , @zixuw wrote: > In D119479#3388498 , @uabelho wrote: > >> Hello, >> >> Did you see this sanitizer error when running global_record.c? >> >> https://lab.llvm.org/buildb

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-17 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D119479#3388498 , @uabelho wrote: > Hello, > > Did you see this sanitizer error when running global_record.c? > > https://lab.llvm.org/buildbot/#/builders/5/builds/20765/steps/13/logs/stdio Hi @uabelho, I've disabled the test fo

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-17 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D119479#3388498 , @uabelho wrote: > Hello, > > Did you see this sanitizer error when running global_record.c? > > https://lab.llvm.org/buildbot/#/builders/5/builds/20765/steps/13/logs/stdio Hi! Taking a look right now Reposito

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-17 Thread Mikael Holmén via Phabricator via cfe-commits
uabelho added a comment. Hello, Did you see this sanitizer error when running global_record.c? https://lab.llvm.org/buildbot/#/builders/5/builds/20765/steps/13/logs/stdio Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.l

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Haowei Wu via Phabricator via cfe-commits
haowei added a comment. In D119479#3387880 , @zixuw wrote: > @haowei I got a quick fix of completely purging the generator output in the > test case. Could you take a look to have a sanity check before I land the fix > on main? > > diff --git a/clang/

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. @haowei Fix landed in 3840082ab509490f16766cd8c155a1cf4b606fec Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. @haowei I got a quick fix of completely purging the generator output in the test case. Could you take a look to have a sanity check before I land the fix on main? diff --git a/clang/test/SymbolGraph/global_record.c b/clang/test/SymbolGraph/global_record.c index ba4bf

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D119479#3387872 , @haowei wrote: > We are seeing test failures after this patch is landed: > > Clang :: SymbolGraph/global_record.c > Script: > -- > : 'RUN: at line 1'; rm -rf > /b/s/w/ir/x/w/staging/llvm_build/tools/c

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Haowei Wu via Phabricator via cfe-commits
haowei added a comment. We are seeing test failures after this patch is landed: Clang :: SymbolGraph/global_record.c Script: -- : 'RUN: at line 1'; rm -rf /b/s/w/ir/x/w/staging/llvm_build/tools/clang/test/SymbolGraph/Output/global_record.c.tmp : 'RUN: at line 2'; split-file /b/s/w

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Fixing bot failure right now Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Zixu Wang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5aab45f43066: [clang][extract-api] Add global record support (authored by zixuw). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Landing this in a moment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 415974. zixuw added a comment. Using `SmallString`/`SmallVectorImpl` to pass `USR` into the `add*` APIs still feel weird and unintuitive. And it's still not clear to the caller that `Name` won't be copied but `USR` will. Trying out another approach: still pass b

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-16 Thread Daniel Grumberg via Phabricator via cfe-commits
dang accepted this revision. dang added a comment. This revision is now accepted and ready to land. Looks mostly good now. Comment at: clang/include/clang/SymbolGraph/API.h:99 + + GlobalRecord *addGlobal(GVKind Kind, StringRef Name, SmallString<128> &USR, +

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-15 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 415658. zixuw added a comment. - Address reviews - Add and handle unconditionally unavailable - Delete the default constructor of `APIRecord` - Make `APIRecord` abstract for LLVM RTTI - Improve `getFormattedText` and `getFormattedLines` - Fix wordings

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-15 Thread Daniel Grumberg via Phabricator via cfe-commits
dang added inline comments. Comment at: clang/lib/SymbolGraph/Serialization.cpp:237 +case GVKind::Variable: + Kind["identifier"] = (getLanguageName(LangOpts) + ".variable").str(); + Kind["displayName"] = "Variable"; dang wrote: > ".variable" ".var"

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-15 Thread Daniel Grumberg via Phabricator via cfe-commits
dang requested changes to this revision. dang added a comment. This revision now requires changes to proceed. You should fix the test to take into account the serializer feedback I left behind Comment at: clang/include/clang/SymbolGraph/API.h:33 + +struct APIRecord { + String

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-09 Thread Juergen Ributzka via Phabricator via cfe-commits
ributzka added inline comments. Comment at: clang/include/clang/SymbolGraph/AvailabilityInfo.h:31 + bool Unavailable{false}; + bool UnconditionallyDeprecated{false}; + We also need unconditionally unavailable. Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-08 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 413992. zixuw added a comment. Plug clangSymbolGraph into clangFrontendTools Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 Files: clang/include/clang/AST/RawComment

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-08 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 413967. zixuw added a comment. Fix reference to vtable of ExtractAPIAction from clang/FrontendTools/ExecuteCompilerInstance Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-08 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Wait that's just a current linking issue on `main`, I suppose not specific to shared lib builds. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 ___

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-08 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. I've moved things around to resolve the cycle, but sadly it seems that shared lib builds are already broken and I could not test it: Linking CXX shared library lib/libLLVMTransformUtils.dylib FAILED: lib/libLLVMTransformUtils.dylib : Undefined symbols for arc

[PATCH] D119479: [clang][extract-api] Add global record support

2022-03-08 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 413947. zixuw added a comment. Herald added a project: All. Move ExtractAPIConsumer which references clangIndex USR generation methods out of clangFrontend to resolve a cycle between clangFrontend and clangIndex when building shared libs. Repository: rG LL

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-23 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. In D119479#3339220 , @MaskRay wrote: > There is a circular dependency if you use `-DBUILD_SHARED_LIBS=on`: > > CMake Error: The inter-target dependency graph contains the following > strongly connected component (cycle): > "c

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-22 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. There is a circular dependency if you use `-DBUILD_SHARED_LIBS=on`: CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle): "clangFrontend" of type SHARED_LIBRARY depends on "clangIndex" (weak) "clangInd

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-22 Thread Zixu Wang via Phabricator via cfe-commits
zixuw added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-17 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 409783. zixuw added a comment. Use `%/t` for path substitution to normalize path separators for file URI Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 Files: clang/

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-14 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 408673. zixuw added a comment. Convert file path to forward slashes for the URI scheme Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 Files: clang/include/clang/AST/

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-11 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 408027. zixuw added a comment. Fix a test failure on Windows where diff doesn't recognize the "-a" option. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 Files: clan

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-11 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 407967. zixuw added a comment. Fix a test failure on Windows where the ':' delimiter for sed was taken by the Windows path convention. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.ll

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-10 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 407716. zixuw added a comment. Fix a Windows build failure where designated initializers are not available Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 Files: clan

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-10 Thread Zixu Wang via Phabricator via cfe-commits
zixuw updated this revision to Diff 407695. zixuw added a comment. Apply clang-format changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119479/new/ https://reviews.llvm.org/D119479 Files: clang/include/clang/AST/RawCommentList.h clang/incl

[PATCH] D119479: [clang][extract-api] Add global record support

2022-02-10 Thread Zixu Wang via Phabricator via cfe-commits
zixuw created this revision. Herald added a subscriber: mgorny. zixuw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add facilities for extract-api: - Structs/classes to hold collected API information: `APIRecord`, `API` - Structs/classes