Fix compilation failures resulting from the llvm Metadata refactor.

Patch by Duncan P. N. Exon Smith