Page MenuHomePhabricator

Add srcloc output to clang-query
Needs ReviewPublic

Authored by steveire on Dec 15 2020, 11:20 AM.

Details

Reviewers
aaron.ballman

Diff Detail

Event Timeline

steveire requested review of this revision.Dec 15 2020, 11:20 AM
steveire created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2020, 11:20 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thank you for this, it looks really useful!

clang-tools-extra/clang-query/Query.cpp
94
97

It should be named Locs per the usual coding conventions.

(I'll hold my nose on the use of auto here, but if it got spelled out since you're touching the line anyway, that would not be a terrible thing.)

99

it -> Iter

106

SourceLocations -> source locations ?

108

CommonLoc and the type should definitely be spelled out.

109

Scout

123

it -> Iter

136

SourceRanges -> source ranges ?

139–140

Same here as above.

Given how common this code seems to be with the first block of code, would it make sense to turn some of this code into a lambda?

152

it -> Iter

165

SourceRange -> source range ?

168–169

More names to correct for conventions. Can you also spell out at least the location datatype?

yuvalmo removed a subscriber: yuvalmo.