<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64196>64196</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MLIR] Compilation error of LLVMIR Dialect: undefined identifier 'MetadataOp'
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
KazApps
</td>
</tr>
</table>
<pre>
`"cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lldb;lld;polly;cross-project-tests;bolt;compiler-rt;libc ;libclc;mlir;openmp;pstl;flang" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"`,
The following error message appears, indicating that the build of MLIR's LLVMIR Dialect has failed.
`[8448/11115] Building CXX object tools...IRLLVMDialect.dir/IR/LLVMDialect.cpp.o FAILED: tools/mlir/lib/Dialect/LLVMIR/CMakeFiles/obj.MLIRLLVMDialect.dir/IR/LLVMDialect.cpp.o /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=1 -DMLIR_ROCM_CONVERSIONS_ENABLED=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/kazapps/repos/llvm-project/build/tools/mlir/lib/Dialect/LLVMIR -I/home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR -I/home/kazapps/repos/llvm-project/build/include -I/home/kazapps/repos/llvm-project/llvm/include -I/home/kazapps/repos/llvm-project/mlir/include -I/home/kazapps/repos/llvm-project/build/tools/mlir/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG -fno-exceptions -funwind-tables -fno-rtti -std=c++17 -MD -MT tools/mlir/lib/Dialect/LLVMIR/CMakeFiles/obj.MLIRLLVMDialect.dir/IR/LLVMDialect.cpp.o -MF tools/mlir/lib/Dialect/LLVMIR/CMakeFiles/obj.MLIRLLVMDialect.dir/IR/LLVMDialect.cpp.o.d -o tools/mlir/lib/Dialect/LLVMIR/CMakeFiles/obj.MLIRLLVMDialect.dir/IR/LLVMDialect.cpp.o -c /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2793:6: error: use of undeclared identifier 'MetadataOp'; did you mean 'llvm::Metadata'? void MetadataOp::build(OpBuilder &builder, OperationState &result, ^~~~~~~~~~ llvm::Metadata /home/kazapps/repos/llvm-project/llvm/include/llvm/Bitcode/BitcodeReader.h:35:7: note: 'llvm::Metadata' declared here class Metadata; ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2793:18: error: out-of-line definition of 'build' does not match any declaration in 'llvm::Metadata' void MetadataOp::build(OpBuilder &builder, OperationState &result, ^~~~~ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2796:23: error: use of undeclared identifier 'getSymNameAttrName' result.addAttribute(getSymNameAttrName(result.name), ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2804:13: error: use of undeclared identifier 'MetadataOp'; did you mean 'llvm::Metadata'? ParseResult MetadataOp::parse(OpAsmParser &parser, OperationState &result) { ^~~~~~~~~~ llvm::Metadata /home/kazapps/repos/llvm-project/llvm/include/llvm/Bitcode/BitcodeReader.h:35:7: note: 'llvm::Metadata' declared here class Metadata; ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2804:25: error: out-of-line definition of 'parse' does not match any declaration in 'llvm::Metadata' ParseResult MetadataOp::parse(OpAsmParser &parser, OperationState &result) { ^~~~~ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2806:39: error: use of undeclared identifier 'getSymNameAttrName' if (parser.parseSymbolName(symName, getSymNameAttrName(result.name), ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2823:6: error: use of undeclared identifier 'MetadataOp'; did you mean 'llvm::Metadata'? void MetadataOp::print(OpAsmPrinter &printer) { ^~~~~~~~~~ llvm::Metadata /home/kazapps/repos/llvm-project/llvm/include/llvm/Bitcode/BitcodeReader.h:35:7: note: 'llvm::Metadata' declared here class Metadata; ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2823:18: error: out-of-line definition of 'print' does not match any declaration in 'llvm::Metadata' void MetadataOp::print(OpAsmPrinter &printer) { ^~~~~ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2825:27: error: use of undeclared identifier 'getSymName'; did you mean 'getTypeName'? printer.printSymbolName(getSymName()); ^~~~~~~~~~ getTypeName /home/kazapps/repos/llvm-project/llvm/include/llvm/Support/TypeName.h:27:18: note: 'getTypeName' declared here inline StringRef getTypeName() { ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2825:27: error: no matching function for call to 'getTypeName' printer.printSymbolName(getSymName()); ^~~~~~~~~~ /home/kazapps/repos/llvm-project/llvm/include/llvm/Support/TypeName.h:27:18: note: candidate template ignored: couldn't infer template argument 'DesiredTypeName' inline StringRef getTypeName() { ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2826:51: error: member reference type 'llvm::Metadata' is not a pointer; did you mean to use '.'? printer.printOptionalAttrDictWithKeyword((*this)->getAttrs(), ~~~~~~~^~ . /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2826:53: error: no member named 'getAttrs' in 'llvm::Metadata' printer.printOptionalAttrDictWithKeyword((*this)->getAttrs(), ~~~~~~~ ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2827:45: error: use of undeclared identifier 'getSymNameAttrName'; did you mean 'mlir::SymbolTable::getSymbolAttrName'? {getSymNameAttrName().getValue()}); ^~~~~~~~~~~~~~~~~~ mlir::SymbolTable::getSymbolAttrName /home/kazapps/repos/llvm-project/mlir/include/mlir/IR/SymbolTable.h:59:20: note: 'mlir::SymbolTable::getSymbolAttrName' declared here static StringRef getSymbolAttrName() { return "sym_name"; } ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2827:66: error: no member named 'getValue' in 'llvm::StringRef' {getSymNameAttrName().getValue()}); ~~~~~~~~~~~~~~~~~~~~ ^ /home/kazapps/repos/llvm-project/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2829:23: error: use of undeclared identifier 'getBody' printer.printRegion(getBody()); ^ 15 errors generated. [8457/11115] Building CXX object tools...ansforms.dir/TilingInterfaceImpl.cpp.o ninja: build stopped: subcommand failed.`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWV932rj2_TTKi5ZYIAcMD3kADP3xmxC6gE56n1iydWzUkSVfSU6GPtzPfpdkJyH_epu0ZeZhurpiLB0d-eyzz5ZsMWtFoQAuUH-C-skZq91em4vf2NdxVdmzVPPDBRp0EaVZyf4ATDZYypsSkwlOayE5Jh_wlVBfGCbJ5eXvy93sajy5nO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