summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
Commit message (Collapse)AuthorAgeFilesLines
* Use print() instead of dump() in codeMatthias Braun2017-01-281-0/+2
| | | | | | | The dump() functions are meant to be used in a debugger, code should typically use something like print(errs()); llvm-svn: 293365
* Cleanup dump() functions.Matthias Braun2017-01-282-1/+11
| | | | | | | | | | | | | | | | | | We had various variants of defining dump() functions in LLVM. Normalize them (this should just consistently implement the things discussed in http://lists.llvm.org/pipermail/cfe-dev/2014-January/034323.html For reference: - Public headers should just declare the dump() method but not use LLVM_DUMP_METHOD or #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) - The definition of a dump method should look like this: #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void MyClass::dump() { // print stuff to dbgs()... } #endif llvm-svn: 293359
* [Hexagon, TableGen] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-01-041-7/+12
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 290925
* [TableGen] Centralize/Unify error handling.Davide Italiano2016-12-051-23/+21
| | | | llvm-svn: 288724
* TableGen: Some more std::string->StringInit* replacementsMatthias Braun2016-12-053-37/+27
| | | | llvm-svn: 288653
* TableGen: TableGenStringKey is no longer necessary as of r288642Matthias Braun2016-12-051-55/+0
| | | | llvm-svn: 288651
* TableGen: Use range based for; reserve vectors where possibleMatthias Braun2016-12-051-18/+23
| | | | llvm-svn: 288650
* TableGen/TGParser: Prefer SmallVector/ArrayRef over std::vectorMatthias Braun2016-12-052-68/+81
| | | | llvm-svn: 288649
* TableGen/Record: Replace std::vector with SmallVector/ArrayRefMatthias Braun2016-12-053-38/+42
| | | | llvm-svn: 288648
* ListInit::convertInitializerTo: avoid foldingset lookup if nothing changedMatthias Braun2016-12-051-4/+13
| | | | llvm-svn: 288647
* TableGen: Use StringInit instead of std::string for DagInit arg namesMatthias Braun2016-12-053-21/+22
| | | | llvm-svn: 288644
* TableGen: Use StringInit instead of std::string for DagInit nameMatthias Braun2016-12-052-10/+10
| | | | llvm-svn: 288643
* TableGen: Use more StringInit instead of StringRefMatthias Braun2016-12-052-27/+25
| | | | | | | | This forces the code to call StringInit::get on the string early and avoids storing duplicates in std::string and sometimes allows pointer comparisons instead of string comparisons. llvm-svn: 288642
* TableGen: Factor out STRCONCAT constructor, add shortcut.Matthias Braun2016-12-051-26/+25
| | | | | | | | Introduce new constructor for STRCONCAT binop with a shortcut that immediately concatenates if the two arguments are StringInits. Makes the QualifyName code more readable and tablegen 2-3% faster. llvm-svn: 288639
* TableGen/Record: Move PointerIntPair to less used field of RecordValMatthias Braun2016-12-051-4/+4
| | | | llvm-svn: 288638
* TableGen: Store Records on a BumpPtrAllocatorMatthias Braun2016-12-041-56/+70
| | | | | | | All these records are internalized and will live until exit. This makes them perfect candidates for a fast BumpPtrAllocator. llvm-svn: 288613
* TableGen: Use StringRef instead of const std::string& in return vals.Matthias Braun2016-12-041-5/+5
| | | | | | | This will allow to switch to a different string storage in an upcoming commit. llvm-svn: 288612
* TableGen: Optimize common string concatenation with SmallStringMatthias Braun2016-12-041-2/+7
| | | | llvm-svn: 288611
* TableGen: Use StringRef instead of const std::string& for parametersMatthias Braun2016-12-043-24/+20
| | | | | | | | This avoid an extra construction of a std::string (and a heap allocation) when the caller only has a StringRef but no std::string at hand. llvm-svn: 288610
* TableGen: Add operator !orMatt Arsenault2016-11-154-2/+9
| | | | llvm-svn: 286936
* Fix some Clang-tidy modernize-use-using and Include What You Use warnings; ↵Eugene Zelenko2016-08-233-33/+34
| | | | | | | | other minor fixes. Differential revision: https://reviews.llvm.org/D23789 llvm-svn: 279535
* Replace a few more "fall through" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-171-1/+1
| | | | | | Follow up to r278902. I had missed "fall through", with a space. llvm-svn: 278970
* Fix a use of LLVM_FALLTHROUGH that wasn't even in a switch.Justin Bogner2016-08-171-1/+0
| | | | | | | I was over-aggressive in my conversions from comments to the fallthrough attribute. llvm-svn: 278903
* Replace "fallthrough" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-172-1/+2
| | | | | | | This is a mechanical change of comments in switches like fallthrough, fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead. llvm-svn: 278902
* [TableGen] Autobrief-ize Record. NFC.Ahmed Bougacha2016-07-141-2/+2
| | | | llvm-svn: 275425
* [TableGen] Cleanup Record comments. NFC.Ahmed Bougacha2016-07-141-65/+1
| | | | | | | LLVM doesn't use exceptions anymore. Also remove the implementation comments. Some of them diverged. llvm-svn: 275424
* TableGen: promote "code" type from syntactic sugar.Tim Northover2016-07-052-2/+27
| | | | | | | It's being immediately converted to a "string", but being able to tell what type the field was originally can be useful in backends. llvm-svn: 274575
* Avoid copies of std::strings and APInt/APFloats where we only read from itBenjamin Kramer2016-06-081-1/+1
| | | | | | | | As suggested by clang-tidy's performance-unnecessary-copy-initialization. This can easily hit lifetime issues, so I audited every change and ran the tests under asan, which came back clean. llvm-svn: 272126
* [NFC] Header cleanupMehdi Amini2016-04-181-2/+0
| | | | | | | | | | | | | | Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
* Update and fix LLVM_ENABLE_MODULES:Richard Smith2016-04-161-1/+0
| | | | | | | | | | | | | | | | 1) We need to add this flag prior to adding any other, in case the user has specified a -fmodule-cache-path= flag in their custom CXXFLAGS. Such a flag causes -Werror builds to fail, and thus all config checks fail, until we add the corresponding -fmodules flag. The modules selfhost bot does this, for instance. 2) Delete module maps that were putting .cpp files into modules. 3) Enable -fmodules-local-submodule-visibility, to get proper module visibility rules applied across submodules of the same module. Disable -fmodules for C builds, since that flag is not available there. llvm-svn: 266502
* [TableGen] Fix typos in comments. NFCCraig Topper2016-02-261-2/+2
| | | | llvm-svn: 261984
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-292-7/+7
| | | | | | | | r259192 post commit comment. clang part in r259232, this is the LLVM part of the patch. llvm-svn: 259240
* Remove autoconf supportChris Bieneman2016-01-261-14/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* [TableGen] Use FoldingSets instead of DenseMaps to unique UnOpInit, ↵Craig Topper2016-01-181-39/+79
| | | | | | BinOpInit and TernOpInit. This remove the memory needed to store the key for the DenseMap. NFC llvm-svn: 258071
* [TableGen] Fix an assert I missed in r258063.Craig Topper2016-01-181-1/+1
| | | | llvm-svn: 258068
* [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
OpenPOWER on IntegriCloud