Oh bother. Sorry about that. And very sorry for taking so long to reply too. I think this looks reasonable. A bit fragile, but mostly on the testing code path, so we can work around it if there ever is a problem. Cheers. Tim. http://reviews.llvm.org/D4710