6 Commits

Author SHA1 Message Date
JOE1994
ffc80de864 [mlir] Nits on uses of llvm::raw_string_ostream (NFC)
* Don't call raw_string_ostream::flush(), which is essentially a no-op
* Strip unneeded calls to raw_string_ostream::str(), to avoid excess indirection.
2024-09-15 21:06:32 -04:00
Scott Todd
c304be7cfd [mlir][docgen] Handle Windows line endings in doc generation.
The `printReindented` function searches for Unix style line endings (`\n`), but strings may have Windows style line endings (`\r\n`). Prior to this change, generated document sections could have extra indentation, which some markdown renderers interpret as code blocks rather than paragraphs.

Differential Revision: https://reviews.llvm.org/D153591
2023-06-29 09:56:49 -07:00
Mogball
ca6bd9cd43 [mlir][ods] AttrOrTypeGen uses Class
AttrOrType def generator uses `Class` code gen helper,
instead of naked raw_ostream.

Depends on D113714 and D114807

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D113715
2021-12-01 16:53:23 +00:00
Jacques Pienaar
9b851527d5 Add indented raw_ostream class
Class simplifies keeping track of the indentation while emitting. For every new line the current indentation is simply prefixed (if not at start of line, then it just emits as normal). Add a simple Region helper that makes it easy to have the C++ scope match the emitted scope.

Use this in op doc generator and rewrite generator.

This reverts revert commit be185b6a7355fdfeb1c31df2e1272366fe58b01f addresses shared lib failure by fixing up cmake files.

Differential Revision: https://reviews.llvm.org/D84107
2020-10-03 15:17:38 -07:00
Jacques Pienaar
be185b6a73 Revert "Add indented raw_ostream class"
This reverts commit 78530ce65375fa02bc96019e5cc9d73db8adaca4.

Fails on shared_lib build.
2020-10-03 09:41:35 -07:00
Jacques Pienaar
78530ce653 Add indented raw_ostream class
Class simplifies keeping track of the indentation while emitting. For every new line the current indentation is simply prefixed (if not at start of line, then it just emits as normal). Add a simple Region helper that makes it easy to have the C++ scope match the emitted scope.

Use this in op doc generator and rewrite generator.

Differential Revision: https://reviews.llvm.org/D84107
2020-10-03 08:53:43 -07:00