[PATCH] D38728: [analyzer] Use the signature of the primary template for issue hash calculation
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 10 08:42:41 PDT 2017
martong added inline comments.
================
Comment at: lib/StaticAnalyzer/Core/IssueHash.cpp:39
+ // primary template.
+ if (const FunctionDecl *InstantiatedFrom =
+ Target->getInstantiatedFromMemberFunction())
----------------
Could we use here FunctionDecl::getPrimaryTemplate() ? That seems more general, it handles both specializations and instantiations.
================
Comment at: test/Analysis/bug_hash_test.cpp:61
-// CHECK: <key>diagnostics</key>
+template <typename T>
+T f(T i) {
----------------
We could add a few more test cases:
- a function template in class template
- specializations vs instantiations
- the combination of the above two (?)
================
Comment at: test/Analysis/bug_hash_test.cpp:1363
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
----------------
I am not sure if this is possible, but could we add unit test just for the `GetSignature` function? Instead of these huge plist files?
I am thinking something like this:
https://github.com/martong/friend-stats/blob/ed0c69ea3669c933204c799f59b85cd7b2507c34/ut/FriendFunctionsTest.cpp#L31
Repository:
rL LLVM
https://reviews.llvm.org/D38728
More information about the cfe-commits
mailing list