Takes the context into account when re-indenting regions.

Fixes llvm.org/PR14916.