summaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestTableGen.cpp
AgeCommit message (Collapse)Author
2025-08-31[clang-format] Fix TableGen nested DAGArg format (#155837)Hirofumi Nakamura
Fixes https://github.com/llvm/llvm-project/issues/154634. Allow inserting space before DAGArg's opener paren when nested.
2025-04-10[clang-format] Recognize TableGen paste operator on separate line (#133722)sstwcw
Formatting this piece of code made the program crash. ``` class TypedVecListRegOperand<RegisterClass Reg, int lanes, string eltsize> : RegisterOperand<Reg, "printTypedVectorList<" # lanes # ", '" # eltsize # "'>">; ``` The line starting with the `#` was treated as a separate preprocessor directive line. Then the code dereferenced a null pointer when it tried to continue parsing the first line that did not end in a semicolon. Now the 2 problems are fixed.
2025-01-25[clang-format] Fix a TableGen crash on comment after l_paren (#124380)Owen Pan
Fixes #124248.
2024-05-20[clang-format][NFC] Remove redundnat llvm::, clang::, etc.Owen Pan
2024-04-09[clang-format] Remove trailing newlines in TableGen formatting test. (#87983)Hirofumi Nakamura
2024-04-08[clang-format] Added unittest of TableGen formatting w.r.t. block type ↵Hirofumi Nakamura
calculation. (#87924)
2024-03-22[clang-format] Added AlignConsecutiveTableGenBreakingDAGArgColons option. ↵Hirofumi Nakamura
(#86150) The option to specify the style of alignment of the colons inside TableGen's DAGArg.
2024-03-19[clang-format] Add Options to break inside the TableGen DAGArg. (#83149)Hirofumi Nakamura
Add two options to control the line break inside TableGen DAGArg. - TableGenBreakInsideDAGArg - TableGenBreakingDAGArgOperators
2024-02-27[clang-format] Add AlignConsecutiveTableGenDefinitions option. (#83008)Hirofumi Nakamura
To align TableGen consecutive definitions.
2024-02-26[clang-format] Add AlignConsecutiveTableGenCondOperatorColons option. (#82878)Hirofumi Nakamura
To align colons inside TableGen !cond operators.
2024-02-16[clang-format] Support of TableGen basic format restrictions. (#81611)Hirofumi Nakamura
- Allow/force to break the line or not. - Allow/force to insert space or not.
2023-10-27[clang-format][NFC] Remove more extraneous newlines in unit testsOwen Pan
Also removed a duplicate test case.
2019-03-01[clang-format][TableGen] Don't add spaces around items in square braces.Jordan Rupprecht
Summary: clang-formatting wants to add spaces around items in square braces, e.g. [1, 2] -> [ 1, 2 ]. Based on a quick check [1], it seems like most cases are using the [1, 2] format, so make that the consistent one. [1] in llvm `.td` files, the regex `\[[^ ]` (bracket followed by not-a-space) shows up ~400 times, but `\[\s[^ ]` (bracket followed by one space and one not-a-space) shows up ~40 times => ~90% uses this format. Reviewers: djasper, krasimir, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: MyDeveloperDay, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D55964 llvm-svn: 355158
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-11-12[clang-format] Support breaking consecutive string literals for TableGenJordan Rupprecht
Summary: clang-format can get confused by string literals in TableGen: it knows that strings can be broken up, but doesn't seem to understand how that can be indented across line breaks, and arranges them in a weird triangular pattern. Take this output example from `clang-format tools/llvm-objcopy/ObjcopyOpts.td` (which has now been formatted in rL345896 with this patch applied): ``` defm keep_global_symbols : Eq< "keep-global-symbols", "Reads a list of symbols from <filename> and " "runs as if " "--keep-global-symbol=<symbol> " "is set for each one. " "<filename> " "contains one " "symbol per line " "and may contain " "comments " "beginning " "with" " '#'" ". " "Lead" "ing " ``` Reviewers: alexshap, MaskRay, djasper Reviewed By: MaskRay Subscribers: krasimir, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D53952 llvm-svn: 346687