Use getAs<> where appropriate on QualTypes instead of using dyn_cast.