Skip to content

Commit a154451

Browse files
author
Thomas Symalla
committed
Fix namespace issue in isDialectOp
This is using the `cppNamespace`. Use the IR-level namespace instead.
1 parent bdfb113 commit a154451

File tree

9 files changed

+160
-158
lines changed

9 files changed

+160
-158
lines changed

example/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ set(EXAMPLE_TABLEGEN_EXE llvm-dialects-tblgen)
2323
set(EXAMPLE_TABLEGEN_TARGET llvm-dialects-tblgen)
2424
set(LLVM_TARGET_DEFINITIONS ExampleDialect.td)
2525

26-
tablegen(EXAMPLE ExampleDialect.h.inc -gen-dialect-decls --dialect xd
26+
tablegen(EXAMPLE ExampleDialect.h.inc -gen-dialect-decls --dialect xd.ir
2727
EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../include)
28-
tablegen(EXAMPLE ExampleDialect.cpp.inc -gen-dialect-defs --dialect xd
28+
tablegen(EXAMPLE ExampleDialect.cpp.inc -gen-dialect-defs --dialect xd.ir
2929
EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../include)
3030
add_public_tablegen_target(ExampleDialectTableGen)
3131

example/ExampleDialect.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
include "llvm-dialects/Dialect/Dialect.td"
2727

2828
def ExampleDialect : Dialect {
29-
let name = "xd";
29+
let name = "xd.ir";
3030
let cppNamespace = "xd";
3131
}
3232

lib/TableGen/GenDialect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void llvm_dialects::genDialectDefs(raw_ostream& out, RecordKeeper& records) {
316316
}
317317
318318
bool $Dialect::isDialectOp(::llvm::StringRef funcName) {
319-
return funcName.starts_with("$namespace.");
319+
return funcName.starts_with("$dialect.");
320320
}
321321
322322
::llvm_dialects::Dialect* $Dialect::make(::llvm::LLVMContext& context) {

0 commit comments

Comments
 (0)