summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/AsmWriterInst.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [tablegen] Add locations to many PrintFatalError() callsDaniel Sanders2019-02-121-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: While working on the GISel Combiner, I noticed I was producing location-less error messages fairly often and set about fixing this. In the process, I noticed quite a few places elsewhere in TableGen that also neglected to include a relevant location. This patch adds locations to errors that relate to a specific record (or a field within it) and also have easy access to the relevant location. This is particularly useful when multiclasses are involved as many of these errors refer to the full name of a record and it's difficult to guess which substring is grep-able. Unfortunately, tablegen currently only supports Record granularity so it's not currently possible to point at a specific Init so these sometimes point at the record that caused the error rather than the precise origin of the error. Reviewers: bogner, aditya_nandakumar, volkan, aemerson, paquette, nhaehnle Reviewed By: nhaehnle Subscribers: jdoerfert, nhaehnle, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58077 llvm-svn: 353862
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* [TableGen] Remove the CGIOpNo from AsmWriterOperand as its not used for ↵Craig Topper2016-01-221-2/+2
| | | | | | anything. NFC llvm-svn: 258488
* [TableGen] Use a StringRef instead of creating a new std::string. It gets ↵Craig Topper2016-01-171-3/+2
| | | | | | passed to a function that takes a StringRef anyway. NFC llvm-svn: 258007
* [TableGen] Changes to AsmWriterEmitter to remove the CodeGenInstruction to ↵Craig Topper2016-01-171-2/+3
| | | | | | | | AsmWriterInst map. NFC Adds the corresponding CodeGenInstruction number to each AsmWriterInst. Then write all the operand uniqueing loops using the AsmWriterInst array and indices. Then use the CodeGenInstruction index to fill out the OpCodeInfo array. llvm-svn: 258005
* [TableGen] Pass PassSubtarget flag into getCode instead of storing a copy of ↵Craig Topper2016-01-141-7/+4
| | | | | | the flag in every AsmWriterOperand. NFC llvm-svn: 257743
* [TableGen] Remove a few spaces from AsmMatcher output. NFCCraig Topper2016-01-111-3/+3
| | | | llvm-svn: 257308
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-10/+5
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* [MCInstPrinter] Enable MCInstPrinter to change its behavior based on theAkira Hatanaka2015-03-271-3/+8
| | | | | | | | | | | | | | | | | | | | per-function subtarget. Currently, code-gen passes the default or generic subtarget to the constructors of MCInstPrinter subclasses (see LLVMTargetMachine::addPassesToEmitFile), which enables some targets (AArch64, ARM, and X86) to change their instprinter's behavior based on the subtarget feature bits. Since the backend can now use different subtargets for each function, instprinter has to be changed to use the per-function subtarget rather than the default subtarget. This patch takes the first step towards enabling instprinter to change its behavior based on the per-function subtarget. It adds a bit "PassSubtarget" to AsmWriter which tells table-gen to pass a reference to MCSubtargetInfo to the various print methods table-gen auto-generates. I will follow up with changes to instprinters of AArch64, ARM, and X86. llvm-svn: 233411
* Remove dead code.Craig Topper2014-11-251-3/+1
| | | | llvm-svn: 222781
* Remove dead code.Rafael Espindola2013-12-021-33/+2
| | | | llvm-svn: 196066
* Remove 'else' after 'return'. No functional change.Craig Topper2013-07-231-2/+1
| | | | llvm-svn: 186929
* Remove trailing whitespace.Craig Topper2013-07-231-26/+26
| | | | llvm-svn: 186928
* Remove exception handling usage from tblgen.Joerg Sonnenberger2012-10-251-11/+12
| | | | | | | | | | | 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
* Move TableGen's parser and entry point into a libraryPeter Collingbourne2011-10-011-1/+1
| | | | | | This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951
* factor the operand list (and related fields/operations) out of Chris Lattner2010-11-011-2/+2
| | | | | | CodeGenInstruction into its own helper class. No functionality change. llvm-svn: 117893
* move FlattenVariants out of AsmMatcherEmitter into a sharedChris Lattner2010-11-011-70/+38
| | | | | | | | CodeGenInstruction::FlattenAsmStringVariants method. Use it to simplify the code in AsmWriterInst, which now no longer needs to worry about variants. llvm-svn: 117886
* change a ton of code to not implicitly use the "O" raw_ostreamChris Lattner2010-04-041-0/+1
| | | | | | member of AsmPrinter. Instead, pass it in explicitly. llvm-svn: 100306
* Changed AsmWriterOperand to also include the index of theSean Callanan2010-02-101-2/+7
| | | | | | | operand into the CodeGenInstruction's list of operands, which is useful for EDEmitter. (Still working on PR6219) llvm-svn: 95759
* Fixed some indentation in the AsmWriterInstSean Callanan2010-02-091-12/+12
| | | | | | | | implementation. Also changed the constructor so that it does not require a Record, making it usable by the EDEmitter. llvm-svn: 95715
* Per PR 6219, factored AsmWriterInst and AsmWriterOperandSean Callanan2010-02-091-0/+259
out of the AsmWriterEmitter. This patch does the physical code movement, but leaves the implementation unchanged. I'll make any changes necessary to generalize the code in a separate patch. llvm-svn: 95697
OpenPOWER on IntegriCloud