Use range-based for loops and const-correct a few things.
Use unique_ptr to fix some memory leaks in Tablegen AsmMatcherEmitter.