Richard - this seems like a very direct approach (which might be right, or it's just a hack without knowing the depth to implement other solutions). Did/do you have other ideas/approaches in mind? http://reviews.llvm.org/D1038