Skip to content

Commit

Permalink
Fix namespace issue in isDialectOp
Browse files Browse the repository at this point in the history
This is using the `cppNamespace`. Use the IR-level namespace instead.
  • Loading branch information
Thomas Symalla committed Oct 2, 2024
1 parent bdfb113 commit 6338bda
Show file tree
Hide file tree
Showing 9 changed files with 160 additions and 158 deletions.
4 changes: 2 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ set(EXAMPLE_TABLEGEN_EXE llvm-dialects-tblgen)
set(EXAMPLE_TABLEGEN_TARGET llvm-dialects-tblgen)
set(LLVM_TARGET_DEFINITIONS ExampleDialect.td)

tablegen(EXAMPLE ExampleDialect.h.inc -gen-dialect-decls --dialect xd
tablegen(EXAMPLE ExampleDialect.h.inc -gen-dialect-decls --dialect xd.ir
EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../include)
tablegen(EXAMPLE ExampleDialect.cpp.inc -gen-dialect-defs --dialect xd
tablegen(EXAMPLE ExampleDialect.cpp.inc -gen-dialect-defs --dialect xd.ir
EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../include)
add_public_tablegen_target(ExampleDialectTableGen)

Expand Down
2 changes: 1 addition & 1 deletion example/ExampleDialect.td
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
include "llvm-dialects/Dialect/Dialect.td"

def ExampleDialect : Dialect {
let name = "xd";
let name = "xd.ir";
let cppNamespace = "xd";
}

Expand Down
2 changes: 1 addition & 1 deletion lib/TableGen/GenDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void llvm_dialects::genDialectDefs(raw_ostream& out, RecordKeeper& records) {
}
bool $Dialect::isDialectOp(::llvm::StringRef funcName) {
return funcName.starts_with("$namespace.");
return funcName.starts_with("$dialect.");
}
::llvm_dialects::Dialect* $Dialect::make(::llvm::LLVMContext& context) {
Expand Down
Loading

0 comments on commit 6338bda

Please sign in to comment.