[PATCH] D31377: [IR] Share implementation of pairs of const and non-const methods in BasicBlock using the const version instead of the non-const version

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 26 18:20:31 PDT 2017


looks good - thanks!

On Sun, Mar 26, 2017 at 4:21 PM Craig Topper via Phabricator <
reviews at reviews.llvm.org> wrote:

> craig.topper created this revision.
>
> During post-commit review of a previous change I made it was pointed out
> that const casting 'this' is technically a bad practice. This patch
> re-implements all of the methods in BasicBlock that do this to use the
> const BasicBlock version and const_cast the return value instead.
>
> I think there are still many other classes that do similar things. I may
> look at more in the future.
>
>
> https://reviews.llvm.org/D31377
>
> Files:
>   include/llvm/IR/BasicBlock.h
>   lib/IR/BasicBlock.cpp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170327/adca031c/attachment.html>


More information about the llvm-commits mailing list