This patch uses castAs instead of getAs which will assert if the type doesn't match and adds nullptr check if needed.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Analysis/ThreadSafety.cpp | ||
---|---|---|
504–506 | 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 | ||
---|---|---|
504–506 | Thank you @aaronpuchert for review and comment.
Makes sense to me! I have updated patch |
clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | ||
---|---|---|
3368 ↗ | (On Diff #531976) | This is unnecessary, getCanonicalDecl() can never return a null pointer (it will return this, at the very least) |
clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | ||
---|---|---|
3368 ↗ | (On Diff #531976) | 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.