summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in tablegen error messagesMatt Arsenault2014-05-311-3/+3
| | | | llvm-svn: 209968
* [modules] Add module maps for LLVM. These are not quite ready for prime-timeRichard Smith2014-05-211-0/+1
| | | | | | | yet, but only a few more Clang patches need to land. (I have 'ninja check' passing locally.) llvm-svn: 209269
* Use a vector of unique_ptrs to fix a memory leak introduced in r208179.Daniel Sanders2014-05-081-2/+2
| | | | | | | | | | | Also removed an inaccurate comment that stated that a DenseMap was used as storage for the ListInit*'s. It's currently using a FoldingSet. I expect there's a better way to fix this but I haven't found it yet. FoldingSet is incompatible with the Pool template and I'm not sure if FoldingSet can be safely replaced with a DenseMap of computed FoldingSetID's to ListInit*'s. llvm-svn: 208293
* [tablegen] Add !listconcat operator with the similar semantics as !strconcatDaniel Sanders2014-05-074-2/+36
| | | | | | | | | | | | | | | | | | | | Summary: It concatenates two or more lists. In addition to the !strconcat semantics the lists must have the same element type. My overall aim is to make it easy to append to Instruction.Predicates rather than override it. This can be done by concatenating lists passed as arguments, or by concatenating lists passed in additional fields. Reviewers: dsanders Reviewed By: dsanders Subscribers: hfinkel, llvm-commits Differential Revision: http://reviews.llvm.org/D3506 llvm-svn: 208183
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-291-0/+1
| | | | | | necessary. llvm-svn: 207593
* [C++] Use 'nullptr'.Craig Topper2014-04-282-7/+7
| | | | llvm-svn: 207394
* [C++11] Make use of 'nullptr' in TableGen library.Craig Topper2014-04-093-282/+275
| | | | llvm-svn: 205830
* tblgen: Twinify PrintFatalError.Benjamin Kramer2014-03-292-22/+22
| | | | | | No functionality change. llvm-svn: 205110
* remove a bunch of unused private methodsNuno Lopes2014-03-232-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | found with a smarter version of -Wunused-member-function that I'm playwing with. Appologies in advance if I removed someone's WIP code. include/llvm/CodeGen/MachineSSAUpdater.h | 1 include/llvm/IR/DebugInfo.h | 3 lib/CodeGen/MachineSSAUpdater.cpp | 10 -- lib/CodeGen/PostRASchedulerList.cpp | 1 lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 10 -- lib/IR/DebugInfo.cpp | 12 -- lib/MC/MCAsmStreamer.cpp | 2 lib/Support/YAMLParser.cpp | 39 --------- lib/TableGen/TGParser.cpp | 16 --- lib/TableGen/TGParser.h | 1 lib/Target/AArch64/AArch64TargetTransformInfo.cpp | 9 -- lib/Target/ARM/ARMCodeEmitter.cpp | 12 -- lib/Target/ARM/ARMFastISel.cpp | 84 -------------------- lib/Target/Mips/MipsCodeEmitter.cpp | 11 -- lib/Target/Mips/MipsConstantIslandPass.cpp | 12 -- lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp | 21 ----- lib/Target/NVPTX/NVPTXISelDAGToDAG.h | 2 lib/Target/PowerPC/PPCFastISel.cpp | 1 lib/Transforms/Instrumentation/AddressSanitizer.cpp | 2 lib/Transforms/Instrumentation/BoundsChecking.cpp | 2 lib/Transforms/Instrumentation/MemorySanitizer.cpp | 1 lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 8 - lib/Transforms/Scalar/SCCP.cpp | 1 utils/TableGen/CodeEmitterGen.cpp | 2 24 files changed, 2 insertions(+), 261 deletions(-) llvm-svn: 204560
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-2/+1
| | | | | | | | | | 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-1/+1
| | | | llvm-svn: 202957
* Fix odd indentation.Craig Topper2014-02-271-1/+1
| | | | llvm-svn: 202342
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-2/+2
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
* Don't make F_None the default.Rafael Espindola2014-02-241-2/+2
| | | | | | This will make it easier to switch the default to being binary files. llvm-svn: 202042
* [TableGen] Correctly generate implicit anonymous prototype defs in multiclassesHal Finkel2014-01-021-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | Even within a multiclass, we had been generating concrete implicit anonymous defs when parsing values (generally in value lists). This behavior was incorrect, and led to errors when multiclass parameters were used in the parameter list of the implicit anonymous def. If we had some multiclass: multiclass mc<string n> { ... : SomeClass<SomeOtherClass<n> > The capture of the multiclass parameter 'n' would not work correctly, and depending on how the implicit SomeOtherClass was used, either TableGen would ignore something it shouldn't, or would crash. To fix this problem, when inside a multiclass, we generate prototype anonymous defs for implicit anonymous defs (just as we do for explicit anonymous defs). Within the multiclass, the current record prototype is populated with a node that is essentially: !cast<SomeOtherClass>(!strconcat(NAME, anon_value_name)). This is then resolved to the correct concrete anonymous def, in the usual way, when NAME is resolved during multiclass instantiation. llvm-svn: 198348
* [TableGen] Use the same anonymous name as the prefix on all multiclass defsHal Finkel2014-01-022-2/+2
| | | | | | | | | | | | | | | | TableGen had been generating a different name for an anonymous multiclass's NAME for every def in the multiclass. This had an unfortunate side effect: it was impossible to reference one def within the multiclass from another (in the parameter list, for example). By making sure we only generate an anonymous name once per multiclass (which, as it turns out, requires only changing the name parameter to reference type), we can now concatenate NAME within the multiclass with a def name in order to generate a reference to that def. This does not matter so much, in and of itself, but is necessary for a follow-up commit that will fix variable capturing in implicit anonymous multiclass defs (and that is important). llvm-svn: 198340
* TableGen: Generate valid identifiers for anonymous recordsAlp Toker2013-12-212-9/+11
| | | | | | | | | | Backends like OptParserEmitter assume that record names can be used as valid identifiers. The period '.' in generated anonymous names broke that assumption, causing a build-time error and in practice forcing all records to be named. llvm-svn: 197869
* Fix most memory leaks in tablegen.Rafael Espindola2013-10-311-11/+20
| | | | | | Found by the valgrind bot. llvm-svn: 193736
* Add an error check for a typo I accidentally made in a td file that caused ↵Craig Topper2013-08-201-0/+3
| | | | | | an assert to fire. llvm-svn: 188742
* Remove some std stream usage from Support and TableGenReid Kleckner2013-08-061-4/+5
| | | | | | | | | | 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
* keep only the StringRef version of getFileOrSTDIN.Rafael Espindola2013-06-251-1/+1
| | | | llvm-svn: 184826
* Allow TableGen DAG arguments to be just a name.Jakob Stoklund Olesen2013-03-241-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | DAG arguments can optionally be named: (dag node, node:$name) With this change, the node is also optional: (dag node, node:$name, $name) The missing node is treated as an UnsetInit, so the above is equivalent to: (dag node, node:$name, ?:$name) This syntax is useful in output patterns where we currently require the types of variables to be repeated: def : Pat<(subc i32:$b, i32:$c), (SUBCCrr i32:$b, i32:$c)>; This is preferable: def : Pat<(subc i32:$b, i32:$c), (SUBCCrr $b, $c)>; llvm-svn: 177843
* Make sure TableGen exits with an error code after printing errors.Jakob Stoklund Olesen2013-03-202-2/+11
| | | | | | | | | | 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
* [TableGen] Fix ICE on MSVC 2012 Release builds.Michael J. Spencer2013-02-261-1/+2
| | | | llvm-svn: 176125
* Make helpers static. Add missing include so LLVMInitializeObjCARCOpts gets C ↵Benjamin Kramer2013-02-151-5/+3
| | | | | | linkage. llvm-svn: 175264
* tblgen: Diagnose duplicate includes.Sean Silva2013-02-074-10/+23
| | | | | | | | | | | | | | | A double inclusion will pretty much always be an error in TableGen, so there's no point going on just to die with "def already defined" or whatnot. I'm not too thrilled about the "public: ... private: ..." to expose the DependenciesMapTy, but I really didn't see a better way to keep that type centralized. It's a smell that indicates that some refactoring is needed to make this code more loosely coupled. This should avoid all bugs of the same nature as PR15189. llvm-svn: 174582
* A bugfix for tblgen, in the function ‘emitSourceFileHeader’.Nadav Rotem2013-01-281-6/+25
| | | | | | | | | When the first parameter (‘Desc’) is more than 80 characters long, it will result the header line that contains the description to be more Than (4GB!) long. Not only it takes forever to produce, the output file cannot be open, since its ginormous. Patch by Elior Malul. llvm-svn: 173672
* Add an addition operator to TableGenHal Finkel2013-01-254-1/+9
| | | | | | | This adds an !add(a, b) operator to tablegen; this will be used to cleanup the PPC register definitions. llvm-svn: 173445
* TableGen: Keep track of superclass reference ranges.Jordan Rose2013-01-102-34/+46
| | | | | | | | | | def foo : bar; ~~~ This allows us to produce more precise diagnostics about a certain superclass, and even provide fixits. llvm-svn: 172085
* TableGen: record anonymous instantiations of classes.Jordan Rose2013-01-101-6/+16
| | | | llvm-svn: 172084
* tblgen: use an early return to reduce indentation.Sean Silva2013-01-091-18/+18
| | | | llvm-svn: 171954
* tblgen: Factor out common code.Sean Silva2013-01-092-17/+18
| | | | llvm-svn: 171951
* Inline this into its only caller.Sean Silva2013-01-092-12/+5
| | | | | | | | | | | It's clearer and additionally this gets rid of the usage of `DefmID`, which doesn't really correspond to anything in the language (it was just used in the name of this parsing function which parsed a `MultiClassID` and returned that multiclass's record). This area of the code still needs a lot of work. llvm-svn: 171938
* tblgen: Reuse function that is 2 lines above.Sean Silva2013-01-091-11/+2
| | | | llvm-svn: 171937
* fix copy-paste-oSean Silva2013-01-091-2/+2
| | | | llvm-svn: 171936
* docs: Bring TableGen syntax a bit closer to reality.Sean Silva2013-01-091-1/+6
| | | | | | | | | It's not just def's but actually a limited subset of Object's that are allowed inside a multiclass. Spotted by Joel Jones. llvm-svn: 171935
* Revert r171140. We don't actually need to support #NAME. Because NAME by ↵Craig Topper2013-01-071-5/+1
| | | | | | itself is interpreted just fine. llvm-svn: 171695
* Simplify TableGen type-compatibility checks.Sean Silva2013-01-071-7/+38
| | | | | | Patch by Elior Malul! llvm-svn: 171684
* Update tablegen parser to allow defm names to start with #NAME.Craig Topper2012-12-271-1/+5
| | | | llvm-svn: 171140
* Sort includes for all of the .h files under the 'lib' tree. These wereChandler Carruth2012-12-042-3/+3
| | | | | | | | | | missed in the first pass because the script didn't yet handle include guards. Note that the script is now able to handle all of these headers without manual edits. =] llvm-svn: 169224
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-034-15/+13
| | | | | | | | | | | | | | | | | 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
* Remove exception handling usage from tblgen.Joerg Sonnenberger2012-10-255-134/+113
| | | | | | | | | | | 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
* In preparation for removing exception handling in tablegen, addJoerg Sonnenberger2012-10-251-0/+12
| | | | | | PrintFatalError, which combines PrintError with exit(1). llvm-svn: 166690
* tblgen: Compile TableGen without RTTI.Sean Silva2012-10-102-4/+0
| | | | | | TableGen no longer needs RTTI! llvm-svn: 165651
* tblgen: Use semantically correct RTTI functions.Sean Silva2012-10-102-36/+21
| | | | | | Also, some minor cleanup. llvm-svn: 165647
* tblgen: Mechanically move dynamic_cast<> to dyn_cast<>.Sean Silva2012-10-102-94/+94
| | | | | | | | | | Some of these dyn_cast<>'s would be better phrased as isa<> or cast<>. That will happen in a future patch. There are also two dyn_cast_or_null<>'s slipped in instead of dyn_cast<>'s, since they were causing crashes with just dyn_cast<>. llvm-svn: 165646
* tblgen: Rename handleDependencies -> createDependencyFileSean Silva2012-10-091-2/+2
| | | | llvm-svn: 165544
* tblgen: Move dependency file output to a separate function.Sean Silva2012-10-091-21/+31
| | | | | | This keeps it out of the main flow of TableGenMain. llvm-svn: 165542
* tblgen: Remove pointless method call.Sean Silva2012-10-091-1/+0
| | | | llvm-svn: 165511
* tblgen: Use appropriate LLVM-style RTTI functions.Sean Silva2012-10-051-21/+9
| | | | | | | Use isa<> or cast<> when semantically that is what is happening. Also some trivial "style" cleanups at fix sites. llvm-svn: 165292
OpenPOWER on IntegriCloud