[mlir][llvm] Improve error messages during LLVM IR import.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Tue, 10 Jan 2023 16:13:33 +0000 (17:13 +0100)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Tue, 10 Jan 2023 16:14:04 +0000 (17:14 +0100)
commit3589885d82b6a835a783304111400ec3bb167a6b
tree84329fbabfa02391dd662727268f02850c1c219f
parentdbee2030a5651d76b543f2b3275489c3e049df05
[mlir][llvm] Improve error messages during LLVM IR import.

Use the module location instead of unknown location if the imported
LLVM IR module does not have more precise debug information.
Additionally, use the diagMD function to print the metadata instead
of just the metadata kind if the import fails.

Reviewed By: definelicht

Differential Revision: https://reviews.llvm.org/D141357
mlir/lib/Target/LLVMIR/DebugImporter.cpp
mlir/lib/Target/LLVMIR/DebugImporter.h
mlir/lib/Target/LLVMIR/ModuleImport.cpp
mlir/test/Target/LLVMIR/Import/basic.ll
mlir/test/Target/LLVMIR/Import/debug-info.ll
mlir/test/Target/LLVMIR/Import/import-failure.ll