AsmWriter: Avoid O(N^2) processing of metadata