During the review of https://reviews.llvm.org/D29567 it turned out the caching in CallDescription is not implemented properly. In case an identifier does not exist in a translation unit, repeated identifier lookups will be done which might have bad impact on the performance. This patch guarantees that the lookup is only executed once. Moreover this patch fixes a corner case when the identifier of CallDescription does not exist in the translation unit and the called function does not have an identifier (e.g.: overloaded operator in C++).
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Yep, seems that somebody has missed these issues :)
I guess there's no way to test the operator case, because nobody made a CallDescription with an empty name for us (maybe we should even assert that).
Thank you for the review! :) Unfortunately, I did not get where would you put that assert. But in case you think it is important, I would be happy to review a patch :)
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h | ||
---|---|---|
73 | Maybe assert(FuncName.size() > 0) here? |
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h | ||
---|---|---|
73 | Oh, I see now. Yeah, that would make sense :) Do you want me to commit that or will you? |
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h | ||
---|---|---|
73 | Because C++ checkers are receiving a lot of attention recently, i'd probably be looking into modifying this class to work with qualified names and overloads. You can commit though if you want it sooner :) |
Maybe assert(FuncName.size() > 0) here?