Replace nested switch statements.

Differential Revision: http://llvm-reviews.chandlerc.com/D2501