summaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenMapTable.cpp
AgeCommit message (Collapse)Author
2025-05-19[LLVM][TableGen] Rename `ListInit::getValues()` to `getElements()` (#140289)Rahul Joshi
Rename `ListInit::getValues()` to `getElements()` to better match with other `ListInit` members like `getElement`. Keep `getValues()` for existing downstream code but mark it deprecated.
2025-05-12[NFC][TableGen] Use StringRef::str() instead of casting (#139332)Rahul Joshi
- Also eliminate unneeded std::string() around some literal strings.
2025-02-07[NFC][TableGen] Code cleanup in CodeGenMapTable `EmitMapTable` (#126157)Rahul Joshi
- Emit C++17 nested namespaces. - Shorten the binary search table name to just `Table` since its declared in the scope of each search function. - Use `using namespace XXX` in the search function to avoid emitting the Target Inst Namespace prefix in the table entries. - Add short-cut handling of `TableSize` == 0 case (verified in Hexagon target). - Use `SetVector` in `ColFieldValueMap` to get automatic deduplication and eliminate manual deduplication code. - Use range for loops.
2024-10-29[TableGen] [NFC] Refine TableGen code to comply with `clang-tidy` checks ↵Jerry Sun
(#113318) Code cleanups for TableGen files, changes includes function names, variable names and unused imports. --------- Co-authored-by: Matt Arsenault <Matthew.Arsenault@amd.com>
2024-10-18[LLVM][TableGen] Change all `Init` pointers to const (#112705)Rahul Joshi
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-18[LLVM][TableGen] Change CodeGenMapTable to use const RecordKeeper (#109034)Rahul Joshi
Change CodeGenMapTable 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-11[TableGen] Change CodeGenInstruction record members to const (#107921)Rahul Joshi
Change CodeGenInstruction::{TheDef, InfereredFrom} to const pointers. 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-03-25[RFC][TableGen] Restructure TableGen Source (#80847)Pierre van Houtryve
Refactor of the llvm-tblgen source into: - a "Basic" library, which contains the bare minimum utilities to build `llvm-min-tablegen` - a "Common" library which contains all of the helpers for TableGen backends. Such helpers can be shared by more than one backend, and even unit tested (e.g. CodeExpander is, maybe we can add more over time) Fixes #80647
2024-02-09[NFC] clang-format utils/TableGen (#80973)Pierre van Houtryve
``` find llvm/utils/TableGen -iname "*.h" -o -iname "*.cpp" | xargs clang-format-16 -i ``` Split from #80847
2023-02-17llvm-tblgen: Apply IWYU partiallyNAKAMURA Takumi
2022-03-11Cleanup include: TableGenserge-sans-paille
This also includes a few cleanup from Support. Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D121331
2021-10-25[TableGen] Fix codgen of InstrMapping with multiple columns and valuesJyun-Yan You
This patch fixes invalid syntax of generated code for InstrMapping that has multiple columns and values. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D111962
2021-08-31[NFC] Correct typo in CodeGenMapTable.cpp, patch by JordiShivam Gupta
CodeGenMapTable.cpp refers to TableGen as TabelGen in the comments. This appears to be a typo. This patch fixes the typo. Differential Revision: https://reviews.llvm.org/D76343
2021-04-16[TableGen] CodeGenMapTable - use for-range loop. NFCI.Simon Pilgrim
2021-01-12[llvm] Remove redundant string initialization (NFC)Kazu Hirata
Identified with readability-redundant-string-init.
2020-12-17[TableGen] Return const std::string& in InstrMap getName()/getFilterClass() ↵Simon Pilgrim
methods. NFCI. Avoid temp std::string instances - we're never keeping these around, just printing them to streams, converting to StringRef etc.
2020-12-17[TableGen] Make InstrMap::getFilterClass() const. NFCI.Simon Pilgrim
Reported by cppcheck. I've run clang-format across all the InstrMap accessors as well.
2020-11-06[TableGen] Indentation and whitespace fixes in generated code. NFC.Jay Foad
Some of these were found by running clang-format over the generated code, although that complains about far more issues than I have fixed here. Differential Revision: https://reviews.llvm.org/D90937
2020-01-28Make llvm::StringRef to std::string conversions explicit.Benjamin Kramer
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here. This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies. This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2019-09-17[TableGen] CodeGenMapTable - Don't dereference a dyn_cast result. NFCI.Simon Pilgrim
The static analyzer is warning about potential null dereferences of dyn_cast<> results - in these cases we can safely use cast<> directly as we know that these cases should all be the correct type, which is why its working atm and anyway cast<> will assert if they aren't. llvm-svn: 372146
2019-08-25[TableGen] Correct comments for end of namespace. NFCBjorn Pettersson
Summary: Update end-of-namespace comments generated by tablegen emitters to fulfill the rules setup by clang-tidy's llvm-namespace-comment checker. Fixed a few end-of-namespace comments in the tablegen source code as well. Reviewers: craig.topper Reviewed By: craig.topper Subscribers: craig.topper, stoklund, dschuff, sbc100, jgravelle-google, aheejin, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66396 llvm-svn: 369865
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-01-08[mips] Improve diagnostics for instruction mappingAleksandar Beserminji
This patch improves diagnostic for case when mapped instruction does not contain a field listed under RowFields. Differential Revision: https://reviews.llvm.org/D41778 llvm-svn: 322004
2017-07-07[TableGen] Use StringRef instead of std::string for CodeGenInstruction ↵Craig Topper
namespace. NFC llvm-svn: 307362
2017-03-27[TableGen] Make CodeGenMapTable understand the namespace field of an instructionKarl-Johan Karlsson
Do not force the backends to use target name as namespace. Original patch by Mattias Eriksson Reviewers: stoklund, craig.topper Reviewed By: stoklund Subscribers: materi, llvm-commits Differential Revision: https://reviews.llvm.org/D31322 llvm-svn: 298834
2016-12-01[tablegen] Delete duplicates from a vector without skipping elementsVedant Kumar
Tablegen's -gen-instr-info pass has a bug in its emitEnums() routine. The function intends for values in a vector to be deduplicated, but it accidentally skips over elements after performing a deletion. I think there are smarter ways of doing this deduplication, but we can do that in a follow-up commit if there's interest. See the thread: [PATCH] TableGen InstrMapping Bug fix. Patch by Tyler Kenney! llvm-svn: 288408
2016-03-10[TableGen] more helpful error message in MapTableEmitterNicolai Haehnle
Differential Revision: http://reviews.llvm.org/D17275 llvm-svn: 263148
2016-02-11[TableGen] Use range-based for loops. NFCCraig Topper
llvm-svn: 260502
2016-02-01[TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead ↵Craig Topper
of accidentally copying to a vector. llvm-svn: 259336
2015-09-24TableGen: Add LLVM_READONLY to generated InstrMapping functionsMatt Arsenault
These just read from a generated table. llvm-svn: 248473
2015-06-02[TableGen] Rename ListInit::getSize to just 'size' to be more consistent.Craig Topper
llvm-svn: 238806
2015-06-02[TableGen] Use range-based for loops. NFC.Craig Topper
llvm-svn: 238805
2015-05-14[TableGen] Replace some calls to ListInit::getSize() with ListInit::empty() ↵Craig Topper
if it was just comparing to 0. NFC. llvm-svn: 237340
2015-01-15Replace size method call of containers to empty method where appropriateAlexander Kornienko
This patch was generated by a clang tidy checker that is being open sourced. The documentation of that checker is the following: /// The emptiness of a container should be checked using the empty method /// instead of the size method. It is not guaranteed that size is a /// constant-time function, and it is generally more efficient and also shows /// clearer intent to use empty. Furthermore some containers may implement the /// empty method but not implement the size method. Using empty whenever /// possible makes it easier to switch to another container in the future. Patch by Gábor Horváth! llvm-svn: 226161
2014-04-15[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper
instead of comparing to nullptr. llvm-svn: 206254
2014-03-03Unbreak the C++11 build.Benjamin Kramer
llvm-svn: 202714
2013-12-05Correct word hyphenationsAlp Toker
This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
2013-10-01Remove several unused variables.Rafael Espindola
Patch by Alp Toker. llvm-svn: 191757
2013-02-14Fix for bug 15246 -- out-of-bound error in the TableGen backend, ↵Jyotsna Verma
CodeGenMapTable.cpp. llvm-svn: 175185
2012-10-25Remove exception handling usage from tblgen.Joerg Sonnenberger
Most places can use PrintFatalError as the unwinding mechanism was not used for anything other than printing the error. The single exception was CodeGenDAGPatterns.cpp, where intermediate errors during type resolution were ignored to simplify incremental platform development. This use is replaced by an error flag in TreePattern and bailout earlier in various places if it is set. llvm-svn: 166712
2012-10-25Remove unused member & unnecessary semicolon.David Blaikie
llvm-svn: 166694
2012-10-25add TableGen support to create relationship maps between instructionsSebastian Pop
Relationship maps are represented as InstrMapping records which are parsed by TableGen and the information is used to construct mapping tables to represent appropriate relations between instructions. These tables are emitted into XXXGenInstrInfo.inc file along with the functions to query them. Patch by Jyotsna Verma <jverma@codeaurora.org>. llvm-svn: 166685