The latest version of Lightroom now includes a Guided upright feature. In the previous version under lens correction you had the options you see below:
The corrections were Auto, Level, Virtual or Full. Used with care it worked quite well but I don’t think too many people were aware of them as they were hidden in the Lens Correction Panel.
We now have the corrections in there own panel called Transforms with the new guided option. This allows you to select areas of the picture for it to key on correcting the verticals on the areas you select, or horizontals.
As with many of these things corrections can go badly wrong to use with care.