Closed gerazo closed 6 years ago
Well, the point is to make sure that a declaration is in the body of a function. I don't know how to do this without comparing ranges, but maybe there is a way. My other problem is that how robust is this solution. The record can come from a macro, the function can also come from that... It seems that getFileLoc is used for such thing at many places and inside it, it follows the expansion until it finds an isFileID loc. Still there may be better get***Loc functions for this.
There is one other think which is not entirely clean. How was this connected to "total ordering"?
The total ordering problem is a different bug currently here: https://github.com/Ericsson/clang/issues/428 probably needs rephrasing. There is no connection. In fact, the total ordering problem comes only late when all the checkers found problems and those are about to be reported. So if you have any crash earlier, than the crash supresses the total ordering problem.
Check this out now @balazske and @martong . Tests are running perfectly, tmux and redis gives the exact same result. I would say, it is identical to the previous solution.
LGTM, just could you please squash the first two commits into one? (I think it is still worth to preserve the source range version in a commit).
@martong There are 4 commits, the first 2 should be squashed? The history will have the newer state anyway, no? Probably I don't get the purpose.
@gerazo, Doesn't really matter, just would be good to preserve the SourceRange based version somehow in the history.
Actually, the first commit out of the four commits keep the SourceLocation based version. So, let's just squash the last 3 commit into one. Does it make sense?
Ok, I did it.
Thanks Zozo, nice work! :)
Thanks. Can I start the upstreaming?
Of course :)
Review is open: https://reviews.llvm.org/D49792
Fixes: https://github.com/Ericsson/clang/issues/416 On tmux, there errors are fixed and tmux is checked without a problem. On redis, the errors are all turned into "not a total ordering" problems. This change definitely allows more things to be imported, so there is a chance that more problems will come, still, it raises coverage.