Continuing the patches from my proposal for how to get rid of debug intrinsics , we would also need to have most instruction insertion routines take an iterator instead of just an instruction pointer -- so that in the future we can communicate more information about debug-info in the iterator class. This patch adds an iterator-taking insertBefore method, and converts a raft of call-sites to using it instead of inserting through instruction-constructors or similar. Again, these are all the call-sites that had to be instrumented to make a stage2clang build identically, plus a couple of other large C++ code bases I have to hand.
I suspect the ultimate outcome of this would be making all the inserter functions take iterators.
Patch is technically NFC and I'm not adding reviewers; this is so that people can take a look at what changes I'm proposing, and have a think about how we can go about testing them.