summaryrefslogtreecommitdiff
path: root/clang/utils/TableGen/ClangSyntaxEmitter.cpp
AgeCommit message (Collapse)Author
2024-11-17[NFC][Clang][TableGen] Fix file header comments (#116491)Rahul Joshi
2024-11-13[NFC][Clang] Use StringRef and range for loops in SA/Syntax Emitters (#115972)Rahul Joshi
Use StringRef and range for loops in Clang SACheckers and Syntax emitters.
2024-09-16[LLVM][CLange] Rename NodeType::Record to NodeType::Rec (#108826)Rahul Joshi
Fixes build failure by avoiding conflicting with `Record` class name.
2024-09-16[NFC][clang][TableGen] Remove redundant llvm:: namespace qualifier (#108627)Rahul Joshi
Remove llvm:: from .cpp files, and add "using namespace llvm" if needed.
2024-09-13[clang][TableGen] Change SyntaxEmitter to use const RecordKeeper (#108478)Rahul Joshi
Change SyntaxEmitter to use const RecordKeeper. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-05[TableGen] Add const variants of accessors for backend (#106658)Rahul Joshi
Split RecordKeeper `getAllDerivedDefinitions` family of functions into two variants: (a) non-const ones that return vectors of `Record *` and (b) const ones, that return vector/ArrayRef of `const Record *`. This will help gradual migration of TableGen backends to use `const RecordKeeper` and by implication change code to work with const pointers and better const correctness. Existing backends are not yet compatible with the const family of functions, so change them to use a non-constant `RecordKeeper` reference, till they are migrated.
2023-09-26[llvm][tblgen] Add `Source Filename` for `emitSourceFileHeader` (#65744)Shao-Ce SUN
I think this is very helpful for reading generated `.inc` files.
2020-11-11[Syntax] Tablegen Sequence classes. NFCSam McCall
Similar to the previous patch, this doesn't convert *all* the classes that could be converted. It also doesn't enforce any new invariants etc. It *does* include some data we don't use yet: specific token types that are allowed and optional/required status of sequence items. (Similar to Dmitri's prototype). I think these are easier to add as we go than later, and serve a useful documentation purpose. Differential Revision: https://reviews.llvm.org/D90659
2020-11-11[Syntax] Start to move trivial Node class definitions to TableGen. NFCSam McCall
This defines two node archetypes with trivial class definitions: - Alternatives: the generated abstract classes are trivial as all functionality is via LLVM RTTI - Unconstrained: this is a placeholder, I think all of these are going to be Lists but today they have no special accessors etc, so we just say "could contain anything", and migrate them one-by-one to Sequence later. Compared to Dmitri's prototype, Nodes.td looks more like a class hierarchy and less like a grammar. (E.g. variants list the Alternatives parent rather than vice versa). The main reasons for this: - the hierarchy is an important part of the API we want direct control over. - e.g. we may introduce abstract bases like "loop" that the grammar doesn't care about in order to model is-a concepts that might make refactorings more expressive. This is less natural in a grammar-like idiom. - e.g. we're likely to have to model some alternatives as variants and others as class hierarchies, the choice will probably be based on natural is-a relationships. - it reduces the cognitive load of switching from editing *.td to working with code that uses the generated classes Differential Revision: https://reviews.llvm.org/D90543
2020-11-11Reland [Syntax] Add minimal TableGen for syntax nodes. NFCSam McCall
This reverts commit 09c6259d6d0eb51b282f6c3a28052a8146bc095b. (Fixed side-effecting code being buried in an assert)
2020-11-09Revert "[Syntax] Add minimal TableGen for syntax nodes. NFC"Sam McCall
This reverts commit 55120f74ca12faea0e90fe552c85c14485f1fd91. Segfaults during build: http://lab.llvm.org:8011/#/builders/36/builds/1310
2020-11-09[Syntax] Add minimal TableGen for syntax nodes. NFCSam McCall
So far, only used to generate Kind and implement classof(). My plan is to have this general-purpose Nodes.inc in the style of AST DeclNodes.inc etc, and additionally a special-purpose backend generating the actual class definitions. But baby steps... Differential Revision: https://reviews.llvm.org/D90540