This patch uses castAs instead of getAs which will assert if the type doesn't match and adds nullptr check if needed.
Details
Diff Detail
Event Timeline
clang/lib/Analysis/ThreadSafety.cpp | ||
---|---|---|
505–509 | Can't we just take I.getData() instead of doing a lookup? After all we're iterating over the same map. |
clang/lib/Analysis/ThreadSafety.cpp | ||
---|---|---|
505–509 | Thank you @aaronpuchert for review and comment.
Makes sense to me! I have updated patch |
clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | ||
---|---|---|
3368 | This is unnecessary, getCanonicalDecl() can never return a null pointer (it will return this, at the very least) |
clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | ||
---|---|---|
3368 | Thank you @aaron.ballman for reviews! I agree with you. My previous analysis was wrong. I have removed this change. |
Can't we just take I.getData() instead of doing a lookup? After all we're iterating over the same map.