Details
- Reviewers
ioeric
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 24889 Build 24888: arc lint + arc unit
Event Timeline
clangd/index/SymbolCollector.cpp | ||
---|---|---|
576 | Should we use getTokenLocation like what we do below? | |
634 | IIUC, if D is declared in d.h that is filtered out and defined in d.cc that is not filtered, this would only create a basic symbol with definition? I think what we want is a full symbol with declaration, definition, includes etc. This is one assumption we make in order for the merging in auto-index to work. |
clangd/index/SymbolCollector.cpp | ||
---|---|---|
576 | getTokenLocation doesn't return a SourceLocation, it returns a SymbolLocation. |
clangd/index/SymbolCollector.cpp | ||
---|---|---|
217 | nit: this is very easily confused with the callback with the same name on the call sites. | |
220 | This is following the implementation detail of how location is generated in addDeclaration/addDefinition. I think we could put the filtering into addDeclaration/addDeclaration to avoid the duplicate here (i.e. return nullptr if decl is filtered like what you did in the previous revision?). | |
391 | OriginalDecl.getCanonicalDecl() might not be the one we prefer. I think we should check all redecls and pick the preferred one? | |
unittests/clangd/SymbolCollectorTests.cpp | ||
533 | It's not trivial to tell what are the cases we are testing here. Maybe add some comments? There are a few cases that are interesting. For examples:
It might be clearer to split them into multiple cases. |
clangd/index/SymbolCollector.cpp | ||
---|---|---|
217 | removed it. | |
220 | as discussed, we decide to move the filter logic out of addDeclaration/addDefinition, and also move out the findNameLoc logic. | |
391 | As discussed, canonicalDecl is always the decl we preferred here. If the definition decl is preferred, it will be handled in above isPreferredDeclaration code. | |
unittests/clangd/SymbolCollectorTests.cpp | ||
533 | Added comments. |
clangd/index/SymbolCollector.cpp | ||
---|---|---|
386 | shouldIndexLoc seems more accurate? | |
392 | DeclSLoc is a bit confusing (SLoc is used somewhere else). Maybe DeclSymLoc or simply DeclLoc? | |
397 | We would be doing redundant work if OriginalDecl == ND? | |
409 | Could you document here why we are also checking !BasicSymbol here? | |
571 | nit: s/DeclSLoc/DeclLoc? and maybe add documentation about why we need this? | |
unittests/clangd/SymbolCollectorTests.cpp | ||
598 | I think making RefsInFile take a single file and using it in combination with anyOf/allOf would be more straightforward. |
nit: this is very easily confused with the callback with the same name on the call sites.