Skip to content

Commit 67d3a33

Browse files
jumerckxmofeing
andauthored
fix operand names conflicting with local variables in the generated functions (#74)
* add local variables used in the generated function to the `reservedKeywords` list * changed API bindings? * updated dialect bindings * ignore structs when generating API wrappers (these are wrapped manually) * newly generated API wrappers * Regenerate bindings * Revert "Regenerate bindings" This reverts commit 752bdd9. * LLVM14 dialect wrappers (had to be generated using Julia 1.9) --------- Co-authored-by: Sergio Sánchez Ramírez <[email protected]>
1 parent b8ab825 commit 67d3a33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+34373
-71325
lines changed

Diff for: bindings/wrap.toml

+37
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,43 @@ show_c_function_prototype = false
1313
printer_blacklist = [
1414
"MAKE_MLIR_PYTHON_QUALNAME",
1515
]
16+
output_ignorelist = [
17+
"MlirTypeID",
18+
"MlirTypeIDAllocator",
19+
"MlirLlvmThreadPool",
20+
"MlirStringRef",
21+
"MlirLogicalResult",
22+
"MlirContext",
23+
"MlirDialect",
24+
"MlirDialectHandle",
25+
"MlirDialectRegistry",
26+
"MlirOperation",
27+
"MlirOpOperand",
28+
"MlirOpPrintingFlags",
29+
"MlirBlock",
30+
"MlirRegion",
31+
"MlirSymbolTable",
32+
"MlirAttribute",
33+
"MlirIdentifier",
34+
"MlirLocation",
35+
"MlirModule",
36+
"MlirType",
37+
"MlirValue",
38+
"MlirNamedAttribute",
39+
"MlirOperationState",
40+
"MlirAffineExpr",
41+
"MlirAffineMap",
42+
"MlirPass",
43+
"MlirExternalPass",
44+
"MlirPassManager",
45+
"MlirOpPassManager",
46+
"MlirExternalPassCallbacks",
47+
"MlirDiagnostic",
48+
"MlirExecutionEngine",
49+
"MlirIntegerSet",
50+
"MlirAsmState",
51+
"MlirBytecodeWriterConfig",
52+
]
1653

1754
[codegen]
1855
use_julia_bool = true

Diff for: deps/tblgen/jl-generators.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ namespace
142142
}
143143
// check if name colides with Julia keywords, generated module name, or "location":
144144
// https://docs.julialang.org/en/v1/base/base/#Keywords
145-
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"};
145+
// aditionally check that name doesn't conflict with local variables defined in the function (results, operands, owned_regions, successors, attributes)
146+
std::vector<std::string> reservedKeywords = {
147+
"results", "operands", "owned_regions", "successors", "attributes",
148+
"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"
149+
};
146150
if (modulename.has_value()) {
147151
reservedKeywords.push_back(modulename.value());
148152
}

0 commit comments

Comments
 (0)