summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/AsmMatcherEmitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix some formatting in tablegen output.Craig Topper2015-01-031-7/+4
| | | | llvm-svn: 225113
* Replace some 'unreachable' comments with llvm_unreachable.Craig Topper2015-01-031-2/+2
| | | | llvm-svn: 225112
* Use iterators rather than indices to make this forwards-compatible with a ↵David Blaikie2014-12-221-4/+5
| | | | | | change to the underlying container (to std::list) llvm-svn: 224734
* unique_ptrify MatchableInfo(const CodeGenInstAlias *Alias)'s parameterDavid Blaikie2014-12-221-14/+11
| | | | llvm-svn: 224733
* [MC] Reset the MCInst in the matcher function before adding opcode/operands.Ahmed Bougacha2014-12-161-0/+1
| | | | | | | | | | | | | | | | | | On X86, the Intel asm parser tries to match all memory operand sizes when none is explicitly specified. For LEA, which doesn't really have a memory operand (just a pointer one), this results in multiple successful matches, one for each memory size. There's no error because it's same opcode, so really, it's just one match. However, the tablegen'd matcher function adds opcode/operands to the passed MCInst, and this results in multiple duplicated operands. This commit clears the MCInst in the tablegen'd matcher function. We sometimes clear it when the match failed, so there's no expectation of keeping the previous content anyway. Differential Revision: http://reviews.llvm.org/D6670 llvm-svn: 224347
* Simplify ownership of RegClasses by using list<CodeGenRegisterClass> instead ↵David Blaikie2014-12-031-11/+11
| | | | | | | | | | of vector<CodeGenRegisterClass*> This complicates a few algorithms due to not having random access, but not by a huge degree I don't think (open to debate/design discussion/etc). llvm-svn: 223261
* Range-for some stuff related to RegClasses, and comment cases where ↵David Blaikie2014-12-031-2/+1
| | | | | | range-for isn't suitable. llvm-svn: 223260
* Remove indirection of vector<T*> in favor of deque<T>David Blaikie2014-11-291-13/+10
| | | | llvm-svn: 222958
* Revert "Simplify some more ownership using forward_list<T> rather than ↵Duncan P. N. Exon Smith2014-11-281-66/+82
| | | | | | | | | | | | vector<unique_ptr<T>>" This reverts commit r222935 and its follow-up r222938 ("Push unique_ptr a bit further through some APIs and simplify some cleanup"), since it causes bot failures (at least on Darwin): http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1391/ llvm-svn: 222943
* Reapply "Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>""David Blaikie2014-11-281-16/+14
| | | | | | | | | Just avoid using std::map::emplace since it's not implemented in libstdc++ 4.7. Reapplies r222937, reverted in r222939. llvm-svn: 222940
* Revert "Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>"David Blaikie2014-11-281-15/+16
| | | | | | | | | Seems libstdc++ on some buildbots is lacking std::map::emplace, which is weird... reverting while I look into it. This reverts commit r222937. llvm-svn: 222939
* Push unique_ptr a bit further through some APIs and simplify some cleanupDavid Blaikie2014-11-281-18/+13
| | | | llvm-svn: 222938
* Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>David Blaikie2014-11-281-16/+15
| | | | | | | | | | | Pointers and references to map elements are never invalidated (except on removal, which isn't used here) so there's no need for the indirection unless there's polymorphism at work. A little const correctness had to be fixed, since the indirection allowed some benign const violations. llvm-svn: 222937
* Simplify some more ownership using forward_list<T> rather than ↵David Blaikie2014-11-281-65/+54
| | | | | | vector<unique_ptr<T>> llvm-svn: 222935
* Forgotten formatting from previous commitDavid Blaikie2014-11-281-2/+2
| | | | llvm-svn: 222934
* Simplify ownership by using forward_list<T> rather than vector<unique_ptr<T>>David Blaikie2014-11-281-42/+42
| | | | | | | | Since the elements were not polymorphic, the unique_ptr was only used to avoid pointer invalidation on container resizes - might as well skip the indirection and use a container with suitable invalidation semantics. llvm-svn: 222931
* Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.Craig Topper2014-11-281-0/+5
| | | | llvm-svn: 222912
* Use unique_ptr to fix some memory leaks in Tablegen AsmMatcherEmitter.Craig Topper2014-11-281-37/+44
| | | | llvm-svn: 222909
* Use range-based for loops and const-correct a few things.Craig Topper2014-11-281-59/+40
| | | | llvm-svn: 222908
* Remove unncessary check for Int_* and *_Int in AsmMatcherEmitter. These are ↵Craig Topper2014-11-251-7/+0
| | | | | | all marked isCodeGenOnly these days. llvm-svn: 222783
* Use range-based for loops.Craig Topper2014-11-251-126/+87
| | | | llvm-svn: 222782
* MCAsmParserExtension has a copy of the MCAsmParser. Use it.Rafael Espindola2014-11-111-1/+1
| | | | | | Base classes were storing a second copy. llvm-svn: 221667
* Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid ↵Craig Topper2014-08-211-6/+6
| | | | | | needing to mention the size. llvm-svn: 216158
* TableGen: allow use of uint64_t for available features mask.Tim Northover2014-08-181-19/+21
| | | | | | | | | | ARM in particular is getting dangerously close to exceeding 32 bits worth of possible subtarget features. When this happens, various parts of MC start to fail inexplicably as masks get truncated to "unsigned". Mostly just refactoring at present, and there's probably no way to test. llvm-svn: 215887
* Revert "Repace SmallPtrSet with SmallPtrSetImpl in function arguments to ↵Craig Topper2014-08-181-6/+6
| | | | | | | | avoid needing to mention the size." Getting a weird buildbot failure that I need to investigate. llvm-svn: 215870
* Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid ↵Craig Topper2014-08-171-6/+6
| | | | | | needing to mention the size. llvm-svn: 215868
* AsmMatchers: Use unique_ptr to manage ownership of MCParsedAsmOperandDavid Blaikie2014-06-081-24/+23
| | | | | | | | | | | | I saw at least a memory leak or two from inspection (on probably untested error paths) and r206991, which was the original inspiration for this change. I ran this idea by Jim Grosbach a few weeks ago & he was OK with it. Since it's a basically mechanical patch that seemed sufficient - usual post-commit review, revert, etc, as needed. llvm-svn: 210427
* [asm matcher] Fix incorrect assertion when there are exactly 32 ↵Daniel Sanders2014-05-211-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | SubtargetFeatures Summary: The minimal type needs to hold a value of '1ULL << 31' but getMinimalTypeForRange() is called with a value of '1ULL << 32'. This patch will also reduce the size of the matcher table when there are 8 or 16 SubtargetFeatures. Also added a dump of the SubtargetFeatures to the -debug output and corrected getMinimalTypeInRange() to consider 0xffffffffull to be a 32-bit value. The testcase is that no existing code is broken and that LLVM still successfully compiles after adding MIPS64r6 CodeGen support. Reviewers: rafael Reviewed By: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D3787 llvm-svn: 209288
* Clean up language and grammar.Eric Christopher2014-05-201-2/+2
| | | | | | | Based on a patch by jfcaron3@gmail.com! PR19806 llvm-svn: 209216
* TableGen/ARM64: print aliases even if they have syntax variants.Tim Northover2014-05-151-1/+2
| | | | | | | To get at least one use of the change (and some actual tests) in with its commit, I've enabled the AArch64 & ARM64 NEON mov aliases. llvm-svn: 208867
* [Modules] Make Support/Debug.h modular. This requires it to not changeChandler Carruth2014-04-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior based on other files defining DEBUG_TYPE, which means it cannot define DEBUG_TYPE at all. This is actually better IMO as it forces folks to define relevant DEBUG_TYPEs for their files. However, it requires all files that currently use DEBUG(...) to define a DEBUG_TYPE if they don't already. I've updated all such files in LLVM and will do the same for other upstream projects. This still leaves one important change in how LLVM uses the DEBUG_TYPE macro going forward: we need to only define the macro *after* header files have been #include-ed. Previously, this wasn't possible because Debug.h required the macro to be pre-defined. This commit removes that. By defining DEBUG_TYPE after the includes two things are fixed: - Header files that need to provide a DEBUG_TYPE for some inline code can do so by defining the macro before their inline code and undef-ing it afterward so the macro does not escape. - We no longer have rampant ODR violations due to including headers with different DEBUG_TYPE definitions. This may be mostly an academic violation today, but with modules these types of violations are easy to check for and potentially very relevant. Where necessary to suppor headers with DEBUG_TYPE, I have moved the definitions below the includes in this commit. I plan to move the rest of the DEBUG_TYPE macros in LLVM in subsequent commits; this one is big enough. The comments in Debug.h, which were hilariously out of date already, have been updated to reflect the recommended practice going forward. llvm-svn: 206822
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-151-6/+6
| | | | | | instead of comparing to nullptr. llvm-svn: 206254
* Retire llvm::array_endof in favor of non-member std::end.Benjamin Kramer2014-04-121-4/+4
| | | | | | While there make array_lengthof constexpr if we have support for it. llvm-svn: 206112
* tblgen: Twinify PrintFatalError.Benjamin Kramer2014-03-291-14/+14
| | | | | | No functionality change. llvm-svn: 205110
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-091-2/+2
| | | | | | class. llvm-svn: 203418
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-4/+3
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-051-3/+3
| | | | llvm-svn: 202957
* Now that we have C++11, turn simple functors into lambdas and remove a ton ↵Benjamin Kramer2014-03-011-10/+1
| | | | | | | | of boilerplate. No intended functionality change. llvm-svn: 202588
* Add missing #include's to cctype when using isdigit/alpha/etc.Will Dietz2013-10-121-0/+1
| | | | llvm-svn: 192519
* Remove several unused variables.Rafael Espindola2013-10-011-9/+0
| | | | | | Patch by Alp Toker. llvm-svn: 191757
* TableGen: fix constness of new comparison function.Tim Northover2013-09-161-1/+1
| | | | | | libc++ didn't seem to like a non-const call operator. llvm-svn: 190797
* TableGen: give asm match classes deterministic order.Tim Northover2013-09-161-23/+46
| | | | | | | | | | | | | | | TableGen was sorting the entries in some of its internal data structures by pointer. This order filtered through to the final matching table and affected the diagnostics produced on bad assembly occasionally. It also turns out STL algorithms are ridiculously easy to misuse on containers with custom order methods. (No bugs before, or now that I know of, but plenty in the middle). This should fix the sanitizer bot, which ends up with weird pointers. llvm-svn: 190793
* AsmMatcher: emit subtarget feature enum in deterministic order.Tim Northover2013-09-161-7/+7
| | | | llvm-svn: 190792
* Add an instruction deprecation feature to TableGen.Joey Gouly2013-09-121-0/+20
| | | | | | | | | | | | | | | | | | | | | | The 'Deprecated' class allows you to specify a SubtargetFeature that the instruction is deprecated on. The 'ComplexDeprecationPredicate' class allows you to define a custom predicate that is called to check for deprecation. For example: ComplexDeprecationPredicate<"MCR"> would mean you would have to define the following function: bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI, std::string &Info) Which returns 'false' for not deprecated, and 'true' for deprecated and store the warning message in 'Info'. The MCTargetAsmParser constructor was chaned to take an extra argument of the MCInstrInfo class, so out-of-tree targets will need to be changed. llvm-svn: 190598
* Move StringToOffsetTable into the TableGen include directory so I can use it ↵Craig Topper2013-08-291-1/+1
| | | | | | in clang. llvm-svn: 189567
* Revert r188164: Stablize MCK_Reg ordering in AsmMatcherEmitterRichard Sandiford2013-08-121-21/+19
| | | | | | Apparently caused a failure on Darwin llvm-svn: 188166
* Stablize MCK_Reg ordering in AsmMatcherEmitterRichard Sandiford2013-08-121-19/+21
| | | | | | | | | | | | | | | clang bootstraps intermittently failed for me due a difference in the MCK_Reg ordering in ARMGenAsmMatcher.inc. E.g. in my latest run the stage 1 and stage 3 versions were the same but the stage 2 one was different (though still functionally correct). This meant that the .o comparison failed. MCK_Regs were assigned by iterating over a std::set< std::set<Record*> >, and since std::set is sorted lexicographically, the order depended on the order of the pointer values. This patch replaces the pointer ordering with LessRecordByID. llvm-svn: 188164
* Remove some std stream usage from Support and TableGenReid Kleckner2013-08-061-1/+2
| | | | | | | | | | LLVM's coding standards recommend raw_ostream and MemoryBuffer for reading and writing text. This has the side effect of allowing clang to compile more of Support and TableGen in the Microsoft C++ ABI. llvm-svn: 187826
* Moving definition of MnemonicContainsDot field from class Instruction to ↵Vladimir Medic2013-08-011-2/+1
| | | | | | class AsmParser as suggested. llvm-svn: 187569
* Split generated asm mnemonic matching table into a separate table for each ↵Craig Topper2013-07-241-38/+71
| | | | | | | | asm variant. This removes the need to store the asm variant in each row of the single table that existed before. Shaves ~16K off the size of X86AsmParser.o. llvm-svn: 187026
OpenPOWER on IntegriCloud