Paul C. Anagnostopoulos
4820af99dd
[TableGen] Fix bug in !interleave operator
...
I forgot to account for unresolved elements of the list.
Differential Revision: https://reviews.llvm.org/D93814
2020-12-28 12:17:24 -05:00
Paul C. Anagnostopoulos
e122a71a0a
[TableGen] Add the !substr() bang operator
...
Update the documentation and add a test.
Build failed: Change SIZE_MAX to std::numeric_limits<int64_t>::max().
Differential Revision: https://reviews.llvm.org/D93419
2020-12-23 10:59:33 -05:00
Paul C. Anagnostopoulos
554eb1f6dc
Revert "[TableGen] Add the !substr() bang operator"
...
This reverts commit 3a675c777d
.
2020-12-21 10:46:25 -05:00
Paul C. Anagnostopoulos
3a675c777d
[TableGen] Add the !substr() bang operator
...
Update the documentation and add a test.
Differential Revision: https://reviews.llvm.org/D93419
2020-12-21 09:41:59 -05:00
Simon Pilgrim
6c8ded0d8c
[TableGen] Don't dereference from dyn_cast<> - use cast<> instead. NFCI.
...
dyn_cast<> can return null if the cast fails, resulting in null dereferences and static analyzer warnings. We should use cast<> instead.
2020-12-14 12:12:08 +00:00
Paul C. Anagnostopoulos
6266f36226
[TableGen] Cache the vectors of records returned by getAllDerivedDefinitions().
...
Differential Revision: https://reviews.llvm.org/D92674
2020-12-09 10:54:04 -05:00
Fangrui Song
a2f922140f
[TableGen] Delete 11 unused declarations
2020-12-06 13:21:07 -08:00
Paul C. Anagnostopoulos
415fab6f67
[TableGen] Eliminate the 'code' type
...
Update the documentation.
Rework various backends that relied on the code type.
Differential Revision: https://reviews.llvm.org/D92269
2020-12-03 10:19:11 -05:00
Paul C. Anagnostopoulos
b23e84ffcf
[TableGen] Eliminte source location from CodeInit
...
Step 1 in eliminating the 'code' type.
Differential Revision: https://reviews.llvm.org/D91932
2020-11-23 11:30:13 -05:00
Paul C. Anagnostopoulos
9671790b4f
[TableGen] Fix missing braces in if statement
2020-11-14 12:38:44 -05:00
Nico Weber
237dcfe2e6
Fix build after 54f9ee334
2020-11-14 10:23:22 -05:00
Paul C. Anagnostopoulos
54f9ee3341
[TableGen] Add frontend/backend phase timing capability.
...
Describe in the BackEnd Developer's Guide. Instrument a few backends.
Remove an old unused timing facility. Add a null backend for timing
the parser.
Differential Revision: https://reviews.llvm.org/D91388
2020-11-14 10:10:29 -05:00
Paul C. Anagnostopoulos
641428f928
[TableGen] Enhance the six comparison bang operators.
...
Update the Programmer's Reference.
Differential Revision: https://reviews.llvm.org/D91036
2020-11-13 09:57:27 -05:00
serge-sans-paille
9218ff50f9
llvmbuildectomy - replace llvm-build by plain cmake
...
No longer rely on an external tool to build the llvm component layout.
Instead, leverage the existing `add_llvm_componentlibrary` cmake function and
introduce `add_llvm_component_group` to accurately describe component behavior.
These function store extra properties in the created targets. These properties
are processed once all components are defined to resolve library dependencies
and produce the header expected by llvm-config.
Differential Revision: https://reviews.llvm.org/D90848
2020-11-13 10:35:24 +01:00
Paul C. Anagnostopoulos
91d2e5c81a
[TableGen] Add the !filter bang operator.
...
Add a test. Update the Programmer's Reference.
Use it in some TableGen files.
Differential Revision: https://reviews.llvm.org/D91008
2020-11-09 10:56:55 -05:00
Paul C. Anagnostopoulos
ae2cb4f427
[TableGen] Add true and false literals to represent booleans
...
Update the Programmer's Reference document.
Add a test. Update a couple of tests with an improved error message.
Differential Revision: https://reviews.llvm.org/D90635
2020-11-05 09:07:21 -05:00
Paul C. Anagnostopoulos
d56cd4291e
[TableGen] Add !interleave operator to concatenate a list of values with delimiters
...
Add a test. Use it in some TableGen files.
Differential Revision: https://reviews.llvm.org/D90469
2020-11-04 09:23:54 -05:00
Paul C. Anagnostopoulos
473f8ae699
[TableGen] Fix a couple of minor issues regarding the paste operator.
...
Update the documentation to fully describe it.
Differential Revision: https://reviews.llvm.org/D90617
2020-11-02 12:21:54 -05:00
Paul C. Anagnostopoulos
9d72065cf6
[TableGen] [AMDGPU] Add !sub operator for subtraction
...
Use it in the AMDGPU target to eliminate !add(value1, !mul(value2, -1))
Differential Revision: https://reviews.llvm.org/D90107
2020-10-28 12:27:53 -04:00
Paul C. Anagnostopoulos
876af264c1
[TableGen] Change !getop and !setop to !getdagop and !setdagop.
...
Differential Revision: https://reviews.llvm.org/D89814
2020-10-23 10:36:05 -04:00
Paul C. Anagnostopoulos
dc5d6632b0
[TableGen] Enhance !empty and !size to handle strings and DAGs.
...
Fix bug in the type checking for !empty, !head, !size, !tail.
2020-10-19 09:22:20 -04:00
Paul C. Anagnostopoulos
4767bb2c0c
[TableGen] Add the !not and !xor operators.
...
Update the TableGen Programmer's Reference.
2020-10-15 10:12:59 -04:00
Paul C. Anagnostopoulos
350fafabe9
[TableGen] Add overload of RecordKeeper::getAllDerivedDefinitions()
...
and use in PseudoLowering backend.
Now the two getAllDerivedDefinitions() use StringRef and Arrayref.
Use all_of() in getAllDerivedDefinitions().
2020-10-12 16:40:09 -04:00
Paul C. Anagnostopoulos
0c1bb4f885
[TableGen] New backend to print detailed records.
...
Pertinent lints are fixed.
2020-10-02 10:22:13 -04:00
Paul C. Anagnostopoulos
c372809f5a
[TableGen] Improved messages in PseudoLoweringEmitter.
2020-09-28 10:18:22 -04:00
John Demme
76419525fb
Common code preparation for tblgen-types patch
...
Cleanup and add methods which https://reviews.llvm.org/D86904 requires. Breaking up to lower review load.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D88267
2020-09-26 02:47:48 +00:00
Paul C. Anagnostopoulos
b3931188fd
Enhance TableGen so that backends can produce better error messages.
...
Modify SearchableTableEmitter.cpp to take advantage.
Clean up formatting and capitalization issues.
2020-09-23 13:35:32 -04:00
Paul C. Anagnostopoulos
21f5f509c8
Two patches to fix the broken build.
...
One to fix a C++ compiler warning.
One to allow Sphinx to find a new document.
2020-09-22 16:00:31 -04:00
Paul C. Anagnostopoulos
848d66fafd
Version 0.5 of the new "TableGen Backend Developer's Guide."
...
Files modified to take comments into account.
MLIR documentation updated for new TableGen documentation files.
2020-09-22 14:01:52 -04:00
Paul C. Anagnostopoulos
bd55d5b2a1
Change comments about order of classes in superclass list.
2020-09-21 10:25:44 -04:00
Paul C. Anagnostopoulos
04cebd900f
Change name of Record::TheInit to CorrespondingDefInit to make code clearer.
...
Differential Revision: https://reviews.llvm.org/D87919
2020-09-19 09:18:44 -04:00
Paul C. Anagnostopoulos
8ce75e2778
TableGen: change a couple of member names to clarify their use.
2020-09-12 12:21:36 -04:00
Paul C. Anagnostopoulos
196e6f9f18
Replace TableGen range piece punctuator with '...'
...
The TableGen range piece punctuator is currently '-' (e.g., {0-9}),
which interacts oddly with the fact that an integer literal's sign
is part of the literal. This patch replaces the '-' with the new
punctuator '...'. The '-' punctuator is deprecated.
Differential Revision: https://reviews.llvm.org/D85585
Change-Id: I3d53d14e23f878b142d8f84590dd465a0fb6c09c
2020-08-21 23:33:57 +02:00
Nicolai Hähnle
17cd34409a
Fix two bugs in TGParser::ParseValue
...
TGParser::ParseValue contains two recursive calls, one to parse the RHS of a list paste operator and one to parse the RHS of a paste operator in a class/def name. Both of these calls neglect to check the return value to see if it is null (because of some error). This causes a crash in the next line of code, which uses the return value. The code now checks for null returns.
Differential Revision: https://reviews.llvm.org/D85852
2020-08-21 23:19:36 +02:00
Jon Roelofs
88ce9f9b44
[TableGen][CGS] Print better errors on overlapping InstRW
...
Differential Revision: https://reviews.llvm.org/D83588
2020-07-27 09:41:10 -06:00
Stanislav Mekhanoshin
3f0c9c1634
Fix ubsan error in tblgen with signed left shift
...
UBSAN complains when tblgen performs SHL of a negative
value.
Differential Revision: https://reviews.llvm.org/D81952
2020-06-16 11:15:09 -07:00
Daniel Grumberg
4bf1124eda
[TableGen] Make behavior of getValueAsListOfStrings consistent with getValueAsString
2020-06-12 19:16:48 +01:00
Fangrui Song
8ba36497dd
[TableGen] Simplify with TGParser::consume()
2020-04-26 15:26:49 -07:00
Fangrui Song
9caac56a65
[TableGen] Delete unused Record::resolveReferencesTo() after D44478. NFC
2020-04-26 01:21:41 -07:00
Fangrui Song
e69605bfb6
[TableGen] Add TGParser::consume()
2020-04-25 21:58:54 -07:00
Fangrui Song
59ec55fa19
[TableGen] Drop deprecated leading # when parsing a SimpleValue
2020-04-25 16:27:40 -07:00
Alex Brachet
69dad324db
[TableGen] [NFC] Make argv0 const
...
`argv0` was never being modified. No changes made except to the type.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D78840
2020-04-25 16:42:38 -04:00
Simon Pilgrim
1811061c38
TGLexer.h - add missing <vector> include.
...
Looks like we are implicitly depending on <vector> but not all machines will include it.
2020-04-21 11:57:10 +01:00
Simon Pilgrim
df91a0f79a
TGParser.h - cleanup includes and forward declarations. NFC.
...
Replace Twine.h/SourceMgr.h includes with forward declarations and include in TGParser.cpp
Remove forward declarations we already have to include in Record.h
2020-04-21 11:32:58 +01:00
Simon Pilgrim
0caaf40258
TGLexer.h - cleanup includes and forward declarations. NFC.
...
Replace ArrayRef.h with a forward declaration and include in ArrayRef.cpp
Remove SMLoc forward declaration as we already have to include SMLoc.h
2020-04-21 11:32:58 +01:00
Joerg Sonnenberger
eb812efa12
Explicitly include <cassert> when using assert
...
Depending on the OS used, a module-enabled build can fail due to the
special handling <cassert> gets as textual header.
2020-03-02 22:45:28 +01:00
Daniel Sanders
2c8ee5329b
Fix assertion on `!eq(?, 0)`
...
Instead of asserting, emit a proper error message
2020-02-18 14:05:55 -08:00
River Riddle
52086f802e
[llvm][TableGen] Define FieldInit::isConcrete overload
...
Summary:
There are a few field init values that are concrete but not complete/foldable (e.g. `?`). This allows for using those values as initializers without erroring out.
Example:
```
class A {
string value = ?;
}
class B<A impl> : A {
let value = impl.value; // This currently emits an error.
let value = ?; // This doesn't emit an error.
}
```
Differential Revision: https://reviews.llvm.org/D74360
2020-02-10 18:04:58 -08:00
Bill Wendling
c55cf4afa9
Revert "Remove redundant "std::move"s in return statements"
...
The build failed with
error: call to deleted constructor of 'llvm::Error'
errors.
This reverts commit 1c2241a793
.
2020-02-10 07:07:40 -08:00
Bill Wendling
1c2241a793
Remove redundant "std::move"s in return statements
2020-02-10 06:39:44 -08:00