diff options
author | Chris Lattner <sabre@nondot.org> | 2004-07-26 23:21:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-07-26 23:21:34 +0000 |
commit | b0fef64dc98d32b90782360aa9480417b7ca34fd (patch) | |
tree | ea9d0d546c9eadef891aa47fcdb9b6db896672dc /utils/TableGen/Record.h | |
parent | a60ff2e14485aa3baec2088f5663d3e25cb74992 (diff) | |
download | external_llvm-b0fef64dc98d32b90782360aa9480417b7ca34fd.zip external_llvm-b0fef64dc98d32b90782360aa9480417b7ca34fd.tar.gz external_llvm-b0fef64dc98d32b90782360aa9480417b7ca34fd.tar.bz2 |
Add initial support for list slices. This currently allows you to do stuff
like this:
def B {
list<int> X = [10, 20, 30, 4, 1, 1231, 20] [2-4,2,2,0-6];
}
... which isn't particularly useful, but more is to come.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15247 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/Record.h')
-rw-r--r-- | utils/TableGen/Record.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h index 95c50ae..a9ccf404 100644 --- a/utils/TableGen/Record.h +++ b/utils/TableGen/Record.h @@ -304,6 +304,15 @@ struct Init { return 0; } + /// convertInitListSlice - This method is used to implement the list slice + /// selection operator. Given an initializer, it selects the specified list + /// elements, returning them as a new init of list type. If it is not legal + /// to take a slice of this, return null. + /// + virtual Init *convertInitListSlice(const std::vector<unsigned> &Elements) { + return 0; + } + /// getFieldType - This method is used to implement the FieldInit class. /// Implementors of this method should return the type of the named field if /// they are of record type. @@ -466,6 +475,8 @@ public: return Values[i]; } + Init *convertInitListSlice(const std::vector<unsigned> &Elements); + virtual Init *convertInitializerTo(RecTy *Ty) { return Ty->convertValue(this); } |