[mlir][llvm] Modernize the import of LLVM IR globals.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 4 Jan 2023 16:04:14 +0000 (17:04 +0100)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 4 Jan 2023 16:13:54 +0000 (17:13 +0100)
commit0fde03cb7fdc29bedf2068e5702c36fd600c64cc
tree9ae6c3a5fbbfe4c734158a03a45d9a722245383f
parentd3d7ba12033f20dfbc8eb6c60954478cff0d0182
[mlir][llvm] Modernize the import of LLVM IR globals.

Return failure if the import of a global variable fails and add a
test case to check the emitted error message. Additionally, convert
the globals in iteration order and do not process them recursively
when translating a constant expression referencing it. Additionally,
use the module location rather unknown location.

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D140966
mlir/include/mlir/Target/LLVMIR/ModuleImport.h
mlir/lib/Target/LLVMIR/ModuleImport.cpp
mlir/test/Target/LLVMIR/Import/global-variables.ll
mlir/test/Target/LLVMIR/Import/import-failure.ll