History log of /llvm-project-15.0.7/llvm/lib/TableGen/TGLexer.cpp (Results 1 – 25 of 67)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# 63448488 23-Jun-2022 wangpc <[email protected]>

[TableGen] Add new operator !exists

We can cast a string to a record via !cast, but we have no mechanism
to check if it is valid and TableGen will raise an error if failed to
cast. Besides, we have

[TableGen] Add new operator !exists

We can cast a string to a record via !cast, but we have no mechanism
to check if it is valid and TableGen will raise an error if failed to
cast. Besides, we have no semantic null in TableGen (we have `?` but
different backends handle uninitialized value differently), so operator
like `dyn_cast<>` is hard to implement.

In this patch, we add a new operator `!exists<T>(s)` to check whether
a record with type `T` and name `s` exists. Self-references are allowed
just like `!cast`.

By doing these, we can write code like:
```
class dyn_cast_to_record<string name> {
R value = !if(!exists<R>(name), !cast<R>(name), default_value);
}
defvar v = dyn_cast_to_record<"R0">.value; // R0 or default_value.
```

Reviewed By: tra, nhaehnle

Differential Revision: https://reviews.llvm.org/D127948

show more ...


Revision tags: llvmorg-14.0.6, llvmorg-14.0.5
# 3b9707db 05-Jun-2022 Kazu Hirata <[email protected]>

[llvm] Convert for_each to range-based for loops (NFC)


Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# fd7d4064 29-Nov-2021 Kazu Hirata <[email protected]>

[llvm] Use range-based for loops (NFC)


Revision tags: llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1
# fe9101c3 11-May-2021 Paul C. Anagnostopoulos <[email protected]>

[TableGen] Make the NUL character invalid in .td files

Now uses tr instead of sed.

Differential Revision: https://reviews.llvm.org/D102254


# 46402eb1 11-May-2021 Paul C. Anagnostopoulos <[email protected]>

Revert "[TableGen] Make the NUL character invalid in .td files"

At least one build uses a 'sed' that does not understand \x00.

This reverts commit cf9647011c4f05e1eb4423c6637d84e2f26b2042.


# 6ca2bdb0 05-May-2021 Paul C. Anagnostopoulos <[email protected]>

[TableGen] Make the NUL character invalid in .td files

Differential Revision: https://reviews.llvm.org/D101923


# 952c6ddd 26-Apr-2021 Paul C. Anagnostopoulos <[email protected]>

[TableGen] Add the !find bang operator

!find searches a source string for a target string and returns the position.

Differential Revision: https://reviews.llvm.org/D101318


Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3
# dd9a6411 06-Mar-2021 Kazu Hirata <[email protected]>

[TableGen] Use range-based for loops (NFC)


Revision tags: llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2
# 6e2b6351 16-Dec-2020 Paul C. Anagnostopoulos <[email protected]>

[TableGen] Add the assert statement, step 1

Differential Revision: https://reviews.llvm.org/D93911

This first step adds the assert statement and supports it at top level
and in record definitions.

[TableGen] Add the assert statement, step 1

Differential Revision: https://reviews.llvm.org/D93911

This first step adds the assert statement and supports it at top level
and in record definitions. Later steps will support it in class
definitions and multiclasses.

show more ...


# e122a71a 16-Dec-2020 Paul C. Anagnostopoulos <[email protected]>

[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.llv

[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

show more ...


# 554eb1f6 21-Dec-2020 Paul C. Anagnostopoulos <[email protected]>

Revert "[TableGen] Add the !substr() bang operator"

This reverts commit 3a675c777dd5788e2313cb06fb27b01f8a2e7573.


# 3a675c77 16-Dec-2020 Paul C. Anagnostopoulos <[email protected]>

[TableGen] Add the !substr() bang operator

Update the documentation and add a test.

Differential Revision: https://reviews.llvm.org/D93419


Revision tags: llvmorg-11.0.1-rc1
# 415fab6f 24-Nov-2020 Paul C. Anagnostopoulos <[email protected]>

[TableGen] Eliminate the 'code' type

Update the documentation.

Rework various backends that relied on the code type.

Differential Revision: https://reviews.llvm.org/D92269


# 91d2e5c8 05-Nov-2020 Paul C. Anagnostopoulos <[email protected]>

[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


# ae2cb4f4 02-Nov-2020 Paul C. Anagnostopoulos <[email protected]>

[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:

[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

show more ...


# d56cd429 30-Oct-2020 Paul C. Anagnostopoulos <[email protected]>

[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


# 9d72065c 23-Oct-2020 Paul C. Anagnostopoulos <[email protected]>

[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


# 876af264 20-Oct-2020 Paul C. Anagnostopoulos <[email protected]>

[TableGen] Change !getop and !setop to !getdagop and !setdagop.

Differential Revision: https://reviews.llvm.org/D89814


# 4767bb2c 12-Oct-2020 Paul C. Anagnostopoulos <[email protected]>

[TableGen] Add the !not and !xor operators.
Update the TableGen Programmer's Reference.


Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3
# 196e6f9f 21-Aug-2020 Paul C. Anagnostopoulos <[email protected]>

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 t

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

show more ...


Revision tags: llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1
# 0caaf402 20-Apr-2020 Simon Pilgrim <[email protected]>

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 SM

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

show more ...


Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init
# ddbc0b1e 14-Jan-2020 Simon Tatham <[email protected]>

[TableGen] Introduce an if/then/else statement.

Summary:
This allows you to make some of the defs in a multiclass or `foreach`
conditional on an expression computed from the parameters or iteration

[TableGen] Introduce an if/then/else statement.

Summary:
This allows you to make some of the defs in a multiclass or `foreach`
conditional on an expression computed from the parameters or iteration
variables.

It was already possible to simulate an if statement using a `foreach`
with a dummy iteration variable and a list constructed using `!if` so
that it had length 0 or 1 depending on the condition, e.g.

foreach unusedIterationVar = !if(condition, [1], []<int>) in { ... }

But this syntax is nicer to read, and also more convenient because it
allows an else clause.

To avoid upheaval in the implementation, I've implemented `if` as pure
syntactic sugar on the `foreach` implementation: internally, `ParseIf`
actually does construct exactly the kind of foreach shown above (and
another reversed one for the else clause if present).

Reviewers: nhaehnle, hfinkel

Reviewed By: hfinkel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71474

show more ...


# 3388b0f5 14-Jan-2020 Simon Tatham <[email protected]>

[TableGen] Introduce a `defvar` statement.

Summary:
This allows you to define a global or local variable to an arbitrary
value, and refer to it in subsequent definitions.

The main use I anticipate

[TableGen] Introduce a `defvar` statement.

Summary:
This allows you to define a global or local variable to an arbitrary
value, and refer to it in subsequent definitions.

The main use I anticipate for this is if you have to compute some
difficult function of the parameters of a multiclass, and then use it
many times. For example:

multiclass Foo<int i, string s> {
defvar op = !cast<BaseClass>("whatnot_" # s # "_" # i);
def myRecord {
dag a = (op this, (op that, the other), (op x, y, z));
int b = op.subfield;
}
def myOtherRecord<"template params including", op>;
}

There are a couple of ways to do this already, but they're not really
satisfactory. You can replace `defvar x = y` with a loop over a
singleton list, `foreach x = [y] in { ... }` - but that's unintuitive
to someone who hasn't seen that workaround idiom before, and requires
an extra pair of braces that you often didn't really want. Or you can
define a nested pair of multiclasses, with the inner one taking `x` as
a template parameter, and the outer one instantiating it just once
with the desired value of `x` computed from its other parameters - but
that makes it awkward to sequentially compute each value based on the
previous ones. I think `defvar` makes things considerably easier.

You can also use `defvar` at the top level, where it inserts globals
into the same map used by `defset`. That allows you to define global
constants without having to make a dummy record for them to live in:

defvar MAX_BUFSIZE = 512;

// previously:
// def Dummy { int MAX_BUFSIZE = 512; }
// and then refer to Dummy.MAX_BUFSIZE everywhere

Reviewers: nhaehnle, hfinkel

Reviewed By: hfinkel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71407

show more ...


Revision tags: llvmorg-9.0.1, llvmorg-9.0.1-rc3
# 1fed9a0c 11-Dec-2019 Simon Tatham <[email protected]>

[TableGen] Add bang-operators !getop and !setop.

Summary:
These allow you to get and set the operator of a dag node, without
affecting its list of arguments.

`!getop` is slightly fiddly because in

[TableGen] Add bang-operators !getop and !setop.

Summary:
These allow you to get and set the operator of a dag node, without
affecting its list of arguments.

`!getop` is slightly fiddly because in many contexts you need its
return value to have a static type more specific than 'any record'. It
works to say `!cast<BaseClass>(!getop(...))`, but it's cumbersome, so
I made `!getop` take an optional type suffix itself, so that can be
written as the shorter `!getop<BaseClass>(...)`.

Reviewers: hfinkel, nhaehnle

Reviewed By: nhaehnle

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71191

show more ...


Revision tags: llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1
# ee9b49ee 21-Nov-2019 River Riddle <[email protected]>

Tablegen: Remove the error for duplicate include files.

This error was originally added a while(7 years) ago when
including multiple files was basically always an error. Tablegen
now has preprocesso

Tablegen: Remove the error for duplicate include files.

This error was originally added a while(7 years) ago when
including multiple files was basically always an error. Tablegen
now has preprocessor support, which allows for building nice
c/c++ style include guards. With the current error being
reported, we unfortunately need to double guard when including
files:

* In user of MyFile.td

#ifndef MYFILE_TD
include MyFile.td
#endif

* In MyFile.td

#ifndef MYFILE_TD
#define MYFILE_TD
...
#endif

Differential Revision: https://reviews.llvm.org/D70410

show more ...


123