]> granicus.if.org Git - llvm/commit
[IR] Share implementation of pairs of const and non-const methods in BasicBlock using...
authorCraig Topper <craig.topper@gmail.com>
Mon, 27 Mar 2017 02:38:17 +0000 (02:38 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 27 Mar 2017 02:38:17 +0000 (02:38 +0000)
commit170b761d4e793c50079e29b3ea45951ba9d0d446
treecbb3dc2dd810b0c6e1d0cee153670b724b45cf99
parent8a88c236128ecabd4ce72f0f42321417ce40cde1
[IR] Share implementation of pairs of const and non-const methods in BasicBlock using the const version instead of the non-const version

Summary:
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.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31377

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298827 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/BasicBlock.h
lib/IR/BasicBlock.cpp