[Mlir-commits] [flang] [mlir] [mlir][LLVM] Make struct types immutable (PR #116035)
Tobias Gysi
llvmlistbot at llvm.org
Sat Nov 16 03:45:03 PST 2024
Markus =?utf-8?q?Böck?= <markus.boeck02 at gmail.com>,
Markus =?utf-8?q?Böck?= <markus.boeck02 at gmail.com>,
Markus =?utf-8?q?Böck?= <markus.boeck02 at gmail.com>,
Markus =?utf-8?q?Böck?= <markus.boeck02 at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/116035 at github.com>
================
@@ -51,41 +51,6 @@ static StringRef getTypeKeyword(Type type) {
});
}
-/// Prints a structure type. Keeps track of known struct names to handle self-
-/// or mutually-referring structs without falling into infinite recursion.
-static void printStructType(AsmPrinter &printer, LLVMStructType type) {
- FailureOr<AsmPrinter::CyclicPrintReset> cyclicPrint;
-
- printer << "<";
- if (type.isIdentified()) {
- cyclicPrint = printer.tryStartCyclicPrint(type);
-
- printer << '"' << type.getName() << '"';
- // If we are printing a reference to one of the enclosing structs, just
- // print the name and stop to avoid infinitely long output.
- if (failed(cyclicPrint)) {
- printer << '>';
- return;
- }
- printer << ", ";
- }
-
- if (type.isIdentified() && type.isOpaque()) {
- printer << "opaque>";
- return;
- }
-
- if (type.isPacked())
- printer << "packed ";
-
- // Put the current type on stack to avoid infinite recursion.
- printer << '(';
- llvm::interleaveComma(type.getBody(), printer.getStream(),
- [&](Type subtype) { dispatchPrint(printer, subtype); });
- printer << ')';
- printer << '>';
-}
-
/// Prints the given LLVM dialect type recursively. This leverages closedness of
----------------
gysit wrote:
The comment can probably be shorten to:
/// Prints the given LLVM dialect type.
Or similar?
https://github.com/llvm/llvm-project/pull/116035
More information about the Mlir-commits
mailing list