summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
Commit message (Collapse)AuthorAgeFilesLines
...
* [TableGen] Merge the SuperClass Record and SMRange vector into a single ↵Craig Topper2016-01-183-19/+18
| | | | | | vector. This removes the state needed to manage the extra vector thus reducing the size of the Record class. NFC llvm-svn: 258065
* [TableGen] Allocate the Init pointer array for BitsInit/ListInit after the ↵Craig Topper2016-01-181-8/+14
| | | | | | BitsInit/ListInit object itself. Saves a bit of memory. NFC llvm-svn: 258063
* [TableGen] Use some free space in Init to store the opcode for ↵Craig Topper2016-01-041-4/+4
| | | | | | UnOpInit/BinOpInit/TernOpInit allowing those types to be a little smaller. NFC llvm-svn: 256733
* [TableGen] Change TGParser::SetValue to take an ArrayRef instead of ↵Craig Topper2016-01-042-15/+10
| | | | | | std::vector reference. Use None in many places where a default constructed vector was being passed. NFC llvm-svn: 256726
* [TableGen] Fix a bug that caused the wrong name for a record built from a ↵Craig Topper2016-01-042-7/+12
| | | | | | | | | | | | multiclass containing a defm called NAME that references another multiclass that contains a defm that uses NAME concatenated with other strings. It would end up doing the concatenations from the second multiclass twice. This occured because SetValue detected a self assignment when trying to set the value of NAME to a VarInit called NAME. NAME is special here and it will get cleaned up later. So add a flag to suppress the self assignment check for this case. Strangely the self-assignment error was returning false indicating it wasn't an error, but it wasn't doing the right thing. So this also changes it to report an error. This fixes the names of some AVX512 FMA instructions that showed this double expansion. llvm-svn: 256725
* [TblGen] ArrayRefize TGParser. No functional change intended.Benjamin Kramer2015-10-243-28/+20
| | | | llvm-svn: 251186
* TableGen: Support folding casts from bits to intMatt Arsenault2015-07-311-0/+8
| | | | | | | | | | | | | | | This is to fix an incorrect error when trying to initialize DwarfNumbers with a !cast<int> of a bits initializer. getValuesAsListOfInts("DwarfNumbers") would not see an IntInit and instead the cast, so would give up. It seems likely that this could be generalized to attempt the convertInitializerTo for any type. I'm not really sure why the existing code seems to special case the string cast cases when convertInitializerTo seems like it should generally handle this sort of thing. llvm-svn: 243722
* [TableGen] Emit the correct error message.Davide Italiano2015-07-271-1/+1
| | | | llvm-svn: 243284
* [TableGen] Change a couple methods to return an ArrayRef instead of a const ↵Craig Topper2015-07-063-3/+3
| | | | | | std::vector reference. NFC llvm-svn: 241430
* [TableGen] Restore the use of the TheInit field in Record to cache the ↵Craig Topper2015-06-241-7/+3
| | | | | | Record's DefInit. I broke this when I fixed memory leaks recently. Remove the DenseMap that mapped Record's to DefInit. llvm-svn: 240524
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* [TableGen] Change OpInit::getNumOperands and getOperand to use unsigned ↵Craig Topper2015-06-061-2/+2
| | | | | | integers. NFC llvm-svn: 239210
* [TableGen] Remove trailing whitespace, add space between 'if' and paren, ↵Craig Topper2015-06-061-16/+16
| | | | | | other formatting fixes. NFC llvm-svn: 239209
* [TableGen] Remove unnecessary temporary. NFCCraig Topper2015-06-061-2/+1
| | | | llvm-svn: 239208
* [TableGen] Fold variable declaration/initialization into if condition for a ↵Craig Topper2015-06-061-8/+6
| | | | | | couple short lived variables. NFC llvm-svn: 239207
* [TableGen] Remove unnecessary outer 'if' and merge it's conditions into the ↵Craig Topper2015-06-061-42/+41
| | | | | | inner 'if's. NFC llvm-svn: 239206
* [TableGen] Fold variable declarations with their assignments. NFCCraig Topper2015-06-061-4/+2
| | | | llvm-svn: 239205
* [TableGen] Use range-based for loops. NFCCraig Topper2015-06-041-12/+13
| | | | llvm-svn: 239022
* [TableGen] Merge single prefix bit in RecordVal into PointerIntPair with ↵Craig Topper2015-06-041-5/+5
| | | | | | Name to reduce memory usage. llvm-svn: 239021
* [TableGen] Use range-based for loops. NFCCraig Topper2015-06-021-12/+10
| | | | llvm-svn: 238808
* [TableGen] Rename ListInit::getSize to just 'size' to be more consistent.Craig Topper2015-06-022-6/+6
| | | | llvm-svn: 238806
* [TableGen] Use range-based for loops. NFC.Craig Topper2015-06-021-11/+10
| | | | llvm-svn: 238805
* [TableGen] Move a couple virtual methods out of line so vtable anchors can ↵Craig Topper2015-06-011-3/+7
| | | | | | be removed. NFC llvm-svn: 238727
* [TableGen] Merge RecTy::typeIsConvertibleTo and RecTy::baseClassOf. NFCCraig Topper2015-05-301-16/+14
| | | | | | typeIsConvertibleTo was just calling baseClassOf(this) on the argument passed to it, but there weren't different signatures for baseClassOf so passing 'this' didn't really do anything interesting. typeIsConvertibleTo could have just been a non-virtual method in RecTy. But since that would be kind of a silly method, I instead re-distributed the logic from baseClassOf into typeIsConvertibleTo. llvm-svn: 238648
* [TableGen] Remove all the variations of RecTy::convertValue and just handle ↵Craig Topper2015-05-301-173/+217
| | | | | | the conversions in convertInitializerTo directly. This saves a bunch of vtable entries. NFC llvm-svn: 238646
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-2/+2
| | | | | | | | | | | | | | | | | | | | 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
* [TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and ↵Craig Topper2015-05-291-48/+0
| | | | | | | | TernOpInit as they weren't able to be called. I don't think converting the inputs to the Ops was the right behavior anyway. llvm-svn: 238543
* Don't call utostr in Twine/raw_ostream contexts.Benjamin Kramer2015-05-281-10/+7
| | | | | | Creating temporary std::strings there is unnecessary. llvm-svn: 238412
* [TableGen] Use DefInit::getAsString instead of getDef()->getName(). NFCCraig Topper2015-05-281-1/+1
| | | | llvm-svn: 238399
* [TableGen] Don't convert types to strings to query what they are. Just use 'isa'Craig Topper2015-05-281-2/+2
| | | | llvm-svn: 238398
* [TableGen] Fix line wrapping logic for the autogenerated header to use math ↵Craig Topper2015-05-261-7/+6
| | | | | | | | that makes more sense (at least to me). The old code had a bug if the description was between 75 and 85 characters or so as it substracted PSLen from Desc.size() instead of MAX_LINE_LEN in the compare. It also calculated odd values for PosE on the last split and just let StringRef::slice take care of it being larger than the description string. llvm-svn: 238187
* [TableGen] Rewrite an assert to not do a bunch unsigned math and then try to ↵Craig Topper2015-05-261-3/+3
| | | | | | | | ensure the result is a positive number. I think the fact that it was explicitly excluding 0 kept this from being a tautology. The exclusion of 0 for the old math was also a bug that's easily hit if the description gets split into multiple lines. llvm-svn: 238186
* [TableGen] Put a space between '*' and description in the autogenerated ↵Craig Topper2015-05-261-7/+6
| | | | | | tablegen header. Minor cleanup in surrounding code. llvm-svn: 238185
* [TableGen] Fix indentation. NFCCraig Topper2015-05-261-1/+1
| | | | llvm-svn: 238181
* [TableGen] Include header for each cpp file first. NFCCraig Topper2015-05-263-4/+3
| | | | llvm-svn: 238180
* [TableGen] Remove unneeded namespace around a function. Just put llvm:: on ↵Craig Topper2015-05-261-5/+1
| | | | | | the definition since it's already declared in a header file. llvm-svn: 238178
* [TableGen] Use 'static' instead of an anonymous namespace.Craig Topper2015-05-261-18/+16
| | | | llvm-svn: 238177
* [TableGen] Resolve complex def names inside multiclassesHal Finkel2015-05-212-6/+44
| | | | | | | | | We had not been trying hard enough to resolve def names inside multiclasses that had complex concatenations, etc. Now we'll try harder. Patch by Amaury Sechet! llvm-svn: 237877
* [TableGen] Make some variable names consistent with their type names and ↵Craig Topper2015-05-201-23/+23
| | | | | | just generally consistent across all of the overloads. llvm-svn: 237775
* [TableGen] Fix a memory leak.Craig Topper2015-05-201-2/+2
| | | | llvm-svn: 237774
* [TableGen] Change 'car' to 'head' and 'cdr' to 'tail' in assert comments. ↵Craig Topper2015-05-161-2/+2
| | | | | | These were the old names for these operations long ago. NFC llvm-svn: 237514
* [TableGen] Remove !! that I can't really explain why I wrote. Also remove ↵Craig Topper2015-05-161-6/+4
| | | | | | some unnecessary curly braces from the same area. llvm-svn: 237513
* [TableGen] Restructure a loop to make it exit early instead of skipping a ↵Craig Topper2015-05-161-5/+6
| | | | | | portion of the body based on what will also be the terminating condition. NFC llvm-svn: 237511
* TableGen: Avoid undefined behaviour by doing this shift in int64Justin Bogner2015-05-141-1/+1
| | | | | | | | Found by ubsan. This was taking a bool and left shifting by 32 - the result is 64 bit, so we should really do the math in a type it fits in. llvm-svn: 237345
* [TableGen] Remove an unnecessary outer 'if' around 3 separate inner ifs. No ↵Craig Topper2015-05-141-29/+25
| | | | | | | | functional change intended. The outer if had 3 separate conditions ORed together and then the inner ifs detected which of the three conditions it was by using only a portion of the specific condition. Just put the whole condition in each inner if and remove the outer if. llvm-svn: 237343
* [TableGen] Simplify some code. NFCCraig Topper2015-05-141-9/+4
| | | | llvm-svn: 237342
* [TableGen] Replace some calls to ListInit::getSize() with ListInit::empty() ↵Craig Topper2015-05-142-4/+4
| | | | | | if it was just comparing to 0. NFC. llvm-svn: 237340
* Use ArrayRef::slice instead of manually constructing an ArrayRef from ↵Craig Topper2015-05-131-6/+1
| | | | | | ArrayRef iterators. NFC llvm-svn: 237231
* Remove unnecessary variables by folding calls into for loop header. NFC.Craig Topper2015-05-121-4/+2
| | | | llvm-svn: 237090
OpenPOWER on IntegriCloud