summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorwpmed92 <ahmedharmouche92@gmail.com>2023-02-27 12:51:28 -0800
committerRiver Riddle <riddleriver@gmail.com>2023-02-27 14:53:59 -0800
commit964997a143cfa0356d1cd21eb3e6d2170c975c38 (patch)
tree881d2cf21f9f30c7ea174e284dd1225b7f13d473 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent3a51eed94846bee4b1e0ad1f160e1de6d5a7a9d0 (diff)
[mlir][core] Fix ValueRange printing in AsmPrinter
The ValueRange printing behaviour of `OpAsmPrinter` and `AsmPrinter` is different, as reported [[ https://github.com/llvm/llvm-project/issues/59334 | here ]] ``` static void testPrint(AsmPrinter &p, Operation *op, ValueRange operands) { p << '(' << operands << ')'; } ``` Although the base `AsmPrinter` is passed as the first parameter (and not `OpAsmPrinter`), the code compiles fine. However, instead of the SSA values, the types for the operands will be printed. This is a violation of the Liskov Substitution Principle. The desired behaviour would be that the above code does not compile. The reason it compiles, is that for the above code, the `TypeRange` version will be selected for the `<<` operator, since `ValueRange` is implicitly converted to `TypeRange`: ``` template <typename AsmPrinterT> inline std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> operator<<(AsmPrinterT &p, const TypeRange &types) { llvm::interleaveComma(types, p); return p; } ```
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions