This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Separate protobuf-related functions to a dedicated file.
ClosedPublic

Authored by hokein on Jan 31 2020, 5:47 AM.

Diff Detail

Event Timeline

hokein created this revision.Jan 31 2020, 5:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2020, 5:47 AM

LG. I might be missing some context though, what's the reasoning behind? Because, I think it is not necessary to treat protobufs differently.

It might be sensible to have a more generic isSymbolFromGeneratedFile filter, but also for this one I don't see any developments in the near future.

clang-tools-extra/clangd/Protobuf.cpp
24 ↗(On Diff #241705)

maybe move this comment down below, right before the line if (!SM.getBufferData(FID).startswith(PROTO_HEADER_COMMENT))

clang-tools-extra/clangd/index/SymbolCollector.cpp
81

looks like this fixme got dropped

Unit tests: fail. 62288 tests passed, 8 failed and 837 were skipped.

failed: LLVM.CodeGen/AMDGPU/branch-relaxation.ll
failed: LLVM.CodeGen/AMDGPU/cf-loop-on-constant.ll
failed: LLVM.CodeGen/AMDGPU/infinite-loop.ll
failed: LLVM.CodeGen/AMDGPU/optimize-negated-cond.ll
failed: LLVM.CodeGen/AMDGPU/uniform-cfg.ll
failed: LLVM.CodeGen/AMDGPU/update-phi.ll
failed: LLVM.CodeGen/AMDGPU/vgpr-descriptor-waterfall-loop-idom-update.ll
failed: LLVM.Transforms/LoopStrengthReduce/AMDGPU/different-addrspace-crash.ll

clang-tidy: fail. clang-tidy found 0 errors and 3 warnings. 3 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

hokein updated this revision to Diff 241734.Jan 31 2020, 7:59 AM
hokein marked 3 inline comments as done.

update, and address comments.

LG. I might be missing some context though, what's the reasoning behind? Because, I think it is not necessary to treat protobufs differently.

It might be sensible to have a more generic isSymbolFromGeneratedFile filter, but also for this one I don't see any developments in the near future.

the motivation of this change is that we will blacklist the proto symbols for rename, we need a place to put protobuf-related functions (and we might improve clangd on better supporting protobuf symbol navigation this year) , I think it is sensible to lift them into a separate file.

clang-tools-extra/clangd/index/SymbolCollector.cpp
81

oops..

hokein updated this revision to Diff 241735.Jan 31 2020, 8:00 AM

add trailing blank line

Unit tests: fail. 62288 tests passed, 8 failed and 837 were skipped.

failed: LLVM.CodeGen/AMDGPU/branch-relaxation.ll
failed: LLVM.CodeGen/AMDGPU/cf-loop-on-constant.ll
failed: LLVM.CodeGen/AMDGPU/infinite-loop.ll
failed: LLVM.CodeGen/AMDGPU/optimize-negated-cond.ll
failed: LLVM.CodeGen/AMDGPU/uniform-cfg.ll
failed: LLVM.CodeGen/AMDGPU/update-phi.ll
failed: LLVM.CodeGen/AMDGPU/vgpr-descriptor-waterfall-loop-idom-update.ll
failed: LLVM.Transforms/LoopStrengthReduce/AMDGPU/different-addrspace-crash.ll

clang-tidy: fail. clang-tidy found 0 errors and 2 warnings. 2 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

Unit tests: fail. 62288 tests passed, 8 failed and 837 were skipped.

failed: LLVM.CodeGen/AMDGPU/branch-relaxation.ll
failed: LLVM.CodeGen/AMDGPU/cf-loop-on-constant.ll
failed: LLVM.CodeGen/AMDGPU/infinite-loop.ll
failed: LLVM.CodeGen/AMDGPU/optimize-negated-cond.ll
failed: LLVM.CodeGen/AMDGPU/uniform-cfg.ll
failed: LLVM.CodeGen/AMDGPU/update-phi.ll
failed: LLVM.CodeGen/AMDGPU/vgpr-descriptor-waterfall-loop-idom-update.ll
failed: LLVM.Transforms/LoopStrengthReduce/AMDGPU/different-addrspace-crash.ll

clang-tidy: fail. clang-tidy found 0 errors and 2 warnings. 2 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

LG. I might be missing some context though, what's the reasoning behind? Because, I think it is not necessary to treat protobufs differently.

It might be sensible to have a more generic isSymbolFromGeneratedFile filter, but also for this one I don't see any developments in the near future.

the motivation of this change is that we will blacklist the proto symbols for rename, we need a place to put protobuf-related functions (and we might improve clangd on better supporting protobuf symbol navigation this year) , I think it is sensible to lift them into a separate file.

if that's the case, I would still go with having a more generic isGeneratedSymbol, that only supports filtering protobuf-related symbols for now. and would rather put it into AST.h

hokein updated this revision to Diff 242536.Feb 5 2020, 2:06 AM

update based on the offline discussion.

Unit tests: unknown.

clang-tidy: unknown.

clang-format: unknown.

Build artifacts: console-log.txt

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

kadircet accepted this revision.Feb 5 2020, 2:37 AM

LGTM, thanks!

clang-tools-extra/clangd/SourceCode.cpp
1139

nit: just return SM.getBufferData(FID).startswith(PROTO_HEADER_COMMENT);

This revision is now accepted and ready to land.Feb 5 2020, 2:37 AM
hokein updated this revision to Diff 242543.Feb 5 2020, 2:54 AM

address a final comment.

Unit tests: unknown.

clang-tidy: unknown.

clang-format: unknown.

Build artifacts: console-log.txt

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

This revision was automatically updated to reflect the committed changes.