This patch provides an API and Serialization for clang-style diagnostics from within Swift. Libraries can use this API to pop their own custom diagnostics that can be serialized to JSON.