Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix operand names conflicting with local variables in the generated functions #74

Merged
merged 8 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions bindings/wrap.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,43 @@ show_c_function_prototype = false
printer_blacklist = [
"MAKE_MLIR_PYTHON_QUALNAME",
]
output_ignorelist = [
"MlirTypeID",
"MlirTypeIDAllocator",
"MlirLlvmThreadPool",
"MlirStringRef",
"MlirLogicalResult",
"MlirContext",
"MlirDialect",
"MlirDialectHandle",
"MlirDialectRegistry",
"MlirOperation",
"MlirOpOperand",
"MlirOpPrintingFlags",
"MlirBlock",
"MlirRegion",
"MlirSymbolTable",
"MlirAttribute",
"MlirIdentifier",
"MlirLocation",
"MlirModule",
"MlirType",
"MlirValue",
"MlirNamedAttribute",
"MlirOperationState",
"MlirAffineExpr",
"MlirAffineMap",
"MlirPass",
"MlirExternalPass",
"MlirPassManager",
"MlirOpPassManager",
"MlirExternalPassCallbacks",
"MlirDiagnostic",
"MlirExecutionEngine",
"MlirIntegerSet",
"MlirAsmState",
"MlirBytecodeWriterConfig",
]

[codegen]
use_julia_bool = true
Expand Down
6 changes: 5 additions & 1 deletion deps/tblgen/jl-generators.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ namespace
}
// check if name colides with Julia keywords, generated module name, or "location":
// https://docs.julialang.org/en/v1/base/base/#Keywords
std::vector<std::string> reservedKeywords = {"include", "location", "baremodule", "begin", "break", "catch", "const", "continue", "do", "else", "elseif", "end", "export", "false", "finally", "for", "function", "global", "if", "import", "let", "local", "macro", "module", "public", "quote", "return", "struct", "true", "try", "using", "while"};
// aditionally check that name doesn't conflict with local variables defined in the function (results, operands, owned_regions, successors, attributes)
std::vector<std::string> reservedKeywords = {
"results", "operands", "owned_regions", "successors", "attributes",
"include", "location", "baremodule", "begin", "break", "catch", "const", "continue", "do", "else", "elseif", "end", "export", "false", "finally", "for", "function", "global", "if", "import", "let", "local", "macro", "module", "public", "quote", "return", "struct", "true", "try", "using", "while"
};
if (modulename.has_value()) {
reservedKeywords.push_back(modulename.value());
}
Expand Down
Loading
Loading