This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by craig.topper on Mar 26 2017, 4:21 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Mar 26 2017, 4:21 PM
dblaikie accepted this revision.Mar 26 2017, 6:20 PM
This revision is now accepted and ready to land.Mar 26 2017, 6:20 PM
This revision was automatically updated to reflect the committed changes.