summaryrefslogtreecommitdiff
path: root/llvm/lib/TableGen/Error.cpp
AgeCommit message (Collapse)Author
2025-07-02[NFC][TableGen] Adopt `ArrayRef::consume_front()` in `PrintMessage` (#146775)Rahul Joshi
Adopt `ArrayRef::consume_front()` in `PrintMessage`, and convert the loop in that function to a range for loop.
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-10-04[TableGen] Print assert message inline with assert failure (#111184)Rahul Joshi
Print assert message after the "assertion failed" message instead of printing it as a separate note. This makes the assert failure reporting less verbose and also more useful to see the failure message inline with the "assertion failed" message.
2024-10-04[TableGen] Print record location when record asserts fail (#111029)Rahul Joshi
When record assertions fail, print an error message with the record's location, so it's easier to see where the record that caused the assert to fail was instantiated. This is useful when the assert condition in a class depends on a template parameter, so we need to know the context of the definition to determine why the assert failed. Also enhanced the assert.td test to check for these context messages, and also add checks for some assert failures that were missing in the test.
2024-09-07[TableGen] Add PrintError family overload that take a print function (#107333)Rahul Joshi
Add PrintError and family overload that accepts a print function. This avoids constructing potentially long strings for passing into these print functions.
2024-08-19[TableGen] Print Error and not crash on dumping non-string values (#104568)Akshat Oke
Co-authored-by: Akshat Oke <Akshat.Oke@amd.com>
2023-10-19[Tablegen] Add keyword `dump`. (#68793)Francesco Petrogalli
The keyword is intended for debugging purpose. It prints a message to stderr. This patch is based on code originally written by Adam Nemet, and on the feedback received by the reviewers in https://reviews.llvm.org/D157492.
2022-05-11[TableGen] Remove the use of global Record stateRiver Riddle
This commits removes TableGens reliance on managed static global record state by moving the RecordContext into the RecordKeeper. The RecordKeeper is now treated similarly to a (LLVM|MLIR|etc)Context object and is passed to static construction functions. This is an important step forward in removing TableGens reliance on global state, and in a followup will allow for users that parse tablegen to parse multiple tablegen files without worrying about Record lifetime. Differential Revision: https://reviews.llvm.org/D125276
2021-03-29[TableGen] Add support for the 'assert' statement in class definitions.Paul C. Anagnostopoulos
Differential Revision: https://reviews.llvm.org/D99275
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-09-28[TableGen] Improved messages in PseudoLoweringEmitter.Paul C. Anagnostopoulos
2020-09-23Enhance TableGen so that backends can produce better error messages.Paul C. Anagnostopoulos
Modify SearchableTableEmitter.cpp to take advantage. Clean up formatting and capitalization issues.
2020-07-27[TableGen][CGS] Print better errors on overlapping InstRWJon Roelofs
Differential Revision: https://reviews.llvm.org/D83588
2019-10-16[gicombiner] Hoist pure C++ combine into the tablegen definitionDaniel Sanders
Summary: This is just moving the existing C++ code around and will be NFC w.r.t AArch64. Renamed 'CombineBr' to something more descriptive ('ElideByByInvertingCond') at the same time. The remaining combines in AArch64PreLegalizeCombiner require features that aren't implemented at this point and will be hoisted as they are added. Depends on D68424 Reviewers: bogner, volkan Subscribers: kristof.beyls, hiraditya, Petar.Avramovic, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68426 llvm-svn: 375057
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-06-23[TableGen] Use WithColor for printing errors/warningsJonas Devlieghere
Use the WithColor helper from support to print errors and warnings. llvm-svn: 335415
2017-11-01[globalisel][regbank] Warn about MIR ambiguities when register bank/class ↵Daniel Sanders
names clash. llvm-svn: 317132
2015-05-11Fix tablegen's PrintFatalError function to run registered fileJames Y Knight
cleanups. Also, change code in tablegen which printed a message and then called "exit(1)" to use PrintFatalError, instead. This fixes instances where an empty output file was left behind after a failed tablegen invocation, which would confuse subsequent ninja runs into not attempting to rebuild. Differential Revision: http://reviews.llvm.org/D9608 llvm-svn: 237058
2014-03-29tblgen: Twinify PrintFatalError.Benjamin Kramer
No functionality change. llvm-svn: 205110
2013-03-20Make sure TableGen exits with an error code after printing errors.Jakob Stoklund Olesen
This makes it possible to report multiple errors in one invocation. There are already calls to PrintError in CodeGenDAGPatterns.cpp which previously would not cause TableGen to fail. <rdar://problem/13463339> llvm-svn: 177573
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
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-25In preparation for removing exception handling in tablegen, addJoerg Sonnenberger
PrintFatalError, which combines PrintError with exit(1). llvm-svn: 166690
2012-08-22Print out the location of expanded multiclass defs in TableGen errors.Jakob Stoklund Olesen
When reporting an error for a defm, we would previously only report the location of the outer defm, which is not always where the error is. Now we also print the location of the expanded multiclass defs: lib/Target/X86/X86InstrSSE.td:2902:12: error: foo defm ADD : basic_sse12_fp_binop_s<0x58, "add", fadd, SSE_ALU_ITINS_S>, ^ lib/Target/X86/X86InstrSSE.td:2801:11: note: instantiated from multiclass defm PD : sse12_fp_packed<opc, !strconcat(OpcodeStr, "pd"), OpNode, VR128, ^ lib/Target/X86/X86InstrSSE.td:194:5: note: instantiated from multiclass def rm : PI<opc, MRMSrcMem, (outs RC:$dst), (ins RC:$src1, x86memop:$src2), ^ llvm-svn: 162409
2012-04-18Fix copy/paste-o.Jim Grosbach
llvm-svn: 155016
2012-04-18TableGen add warning diagnostic helper functions.Jim Grosbach
llvm-svn: 155012
2011-10-16Make SMDiagnostic a little more sane. Instead of passing around ↵Chris Lattner
note/warning/error as a string, pass it around as an enum. llvm-svn: 142107
2011-10-01Move TableGen's parser and entry point into a libraryPeter Collingbourne
This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951