aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land.
LGTM! ================ Comment at: clang-tools-extra/clang-tidy/performance/NoIntToPtrCheck.cpp:21 + Finder->addMatcher(castExpr(hasCastKind(CK_IntegralToPointer), + unless(hasSourceExpression(integerLiteral()))) + .bind("x"), ---------------- aaron.ballman wrote: > Do we also want to exclude the case where the destination is a `volatile` > pointer on the assumption that something out of the ordinary is going on. > e.g., > ``` > intptr_t addr; > if (something) { > addr = SOME_CONSTANT; > } else { > addr = SOME_OTHER_CONSTANT; > } > volatile int *register_bank = (volatile int *)addr; > ``` On reflection, I think we can make an adjustment here if there's user feedback that it's a frequent false positive. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91055/new/ https://reviews.llvm.org/D91055 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits