summaryrefslogtreecommitdiff
path: root/llvm/lib/TableGen/JSONBackend.cpp
AgeCommit message (Collapse)Author
2025-06-04[llvm] Remove unused includes (NFC) (#142733)Kazu Hirata
These are identified by misc-include-cleaner. I've filtered out those that break builds. Also, I'm staying away from llvm-config.h, config.h, and Compiler.h, which likely cause platform- or compiler-specific build failures.
2025-04-24[TableGen] Only store direct superclasses in Record (#123072)Jay Foad
In Record only store the direct superclasses instead of all superclasses. getSuperClasses recurses to find all superclasses when necessary. This gives a small reduction in memory usage. On lib/Target/X86/X86.td I measured about 2.0% reduction in total bytes allocated (measured by valgrind) and 1.3% reduction in peak memory usage (measured by /usr/bin/time -v). --------- Co-authored-by: Min-Yih Hsu <min@myhsu.dev>
2024-08-26[NFC][TableGen] Refactor JSON and detailed record emitter (#105770)Rahul Joshi
- Fix JSON and detailed record emitters to use const reference and pointers. - Fix code to use C++ structured bindings and range-based loops, including reverse() range for locations. - Eliminate `NL` define for "\n". - Change JSON emitter to populate `instance_list` in an earlier loop over superclasses instead of a separate loop. - Rename variables in JSON emitter to conform to LLVM naming conventions. - Eliminate unused headers in detailed record emitter.
2024-01-24[TableGen] Include source location in JSON dump (#79028)ostannard
This adds a '!loc' field to each record containing the file name and line number of the record declaration.
2023-12-07[TableGen] Remove unnecessary includes (NFC)Kazu Hirata
Identified with clangd.
2022-08-28[llvm] Qualify auto in range-based for loops (NFC)Kazu Hirata
2022-07-23[TableGen] Drop an unnecessary const from a return type (NFC)Kazu Hirata
This patch also drops "&" that binds to a temporary. Identified with readability-const-return-type.
2022-01-28Cleanup include dependencies for LLVMTableGenserge-sans-paille
Based on the output of include-what-you-use. No other library seems affected by the new forward declaration. $ clang++ -E -Iinclude -I../llvm/include ../llvm/lib/TableGen/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l before: 795231 after: 750654 Related Discourse thread: https://llvm.discourse.group/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D118374
2021-01-07[TableGen] Add field kind to the RecordVal class.Paul C. Anagnostopoulos
Differential Revision: https://reviews.llvm.org/D93969
2020-12-06[TableGen] Delete 11 unused declarationsFangrui Song
2020-12-03[TableGen] Eliminate the 'code' typePaul C. Anagnostopoulos
Update the documentation. Rework various backends that relied on the code type. Differential Revision: https://reviews.llvm.org/D92269
2020-02-10Revert "Remove redundant "std::move"s in return statements"Bill Wendling
The build failed with error: call to deleted constructor of 'llvm::Error' errors. This reverts commit 1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2.
2020-02-10Remove redundant "std::move"s in return statementsBill Wendling
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-07-11[TableGen] Add missing std::moves to fix build failure.Simon Tatham
gcc 4.7 seems to disagree with gcc 5.3 about whether you need to say 'return std::move(thing)' instead of just 'return thing'. All the json::Arrays and json::Objects that I was implicitly turning into json::Values by returning them from functions now have explicit std::move wrappers, so hopefully 4.7 will be happy now. llvm-svn: 336772
2018-07-11[TableGen] Add a general-purpose JSON backend.Simon Tatham
The aim of this backend is to output everything TableGen knows about the record set, similarly to the default -print-records backend. But where -print-records produces output in TableGen's input syntax (convenient for humans to read), this backend produces it as structured JSON data, which is convenient for loading into standard scripting languages such as Python, in order to extract information from the data set in an automated way. The output data contains a JSON representation of the variable definitions in output 'def' records, and a few pieces of metadata such as which of those definitions are tagged with the 'field' prefix and which defs are derived from which classes. It doesn't dump out absolutely every piece of knowledge it _could_ produce, such as type information and complicated arithmetic operator nodes in abstract superclasses; the main aim is to allow consumers of this JSON dump to essentially act as new backends, and backends don't generally need to depend on that kind of data. The new backend is implemented as an EmitJSON() function similar to all of llvm-tblgen's other EmitFoo functions, except that it lives in lib/TableGen instead of utils/TableGen on the basis that I'm expecting to add it to clang-tblgen too in a future patch. To test it, I've written a Python script that loads the JSON output and tests properties of it based on comments in the .td source - more or less like FileCheck, except that the CHECK: lines have Python expressions after them instead of textual pattern matches. Reviewers: nhaehnle Reviewed By: nhaehnle Subscribers: arichardson, labath, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D46054 llvm-svn: 336771