aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--support/tools/TableGen/FileParser.y21
-rw-r--r--utils/TableGen/FileParser.y21
2 files changed, 28 insertions, 14 deletions
diff --git a/support/tools/TableGen/FileParser.y b/support/tools/TableGen/FileParser.y
index ab1819c554..b0161f2317 100644
--- a/support/tools/TableGen/FileParser.y
+++ b/support/tools/TableGen/FileParser.y
@@ -438,13 +438,20 @@ DefInst : DEF ObjectBody {
Object : ClassInst | DefInst;
-// Support Set commands wrapping objects...
-Object : SET ID OptBitList '=' Value IN {
- SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
- delete $2;
- } '{' ObjectList '}' {
- delete SetStack.back().first.second; // Delete OptBitList
- SetStack.pop_back();
+// SETCommand - A 'SET' statement start...
+SETCommand : SET ID OptBitList '=' Value IN {
+ SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
+ delete $2;
+};
+
+// Support Set commands wrapping objects... both with and without braces.
+Object : SETCommand '{' ObjectList '}' {
+ delete SetStack.back().first.second; // Delete OptBitList
+ SetStack.pop_back();
+ }
+ | SETCommand Object {
+ delete SetStack.back().first.second; // Delete OptBitList
+ SetStack.pop_back();
};
ObjectList : Object {} | ObjectList Object {};
diff --git a/utils/TableGen/FileParser.y b/utils/TableGen/FileParser.y
index ab1819c554..b0161f2317 100644
--- a/utils/TableGen/FileParser.y
+++ b/utils/TableGen/FileParser.y
@@ -438,13 +438,20 @@ DefInst : DEF ObjectBody {
Object : ClassInst | DefInst;
-// Support Set commands wrapping objects...
-Object : SET ID OptBitList '=' Value IN {
- SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
- delete $2;
- } '{' ObjectList '}' {
- delete SetStack.back().first.second; // Delete OptBitList
- SetStack.pop_back();
+// SETCommand - A 'SET' statement start...
+SETCommand : SET ID OptBitList '=' Value IN {
+ SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
+ delete $2;
+};
+
+// Support Set commands wrapping objects... both with and without braces.
+Object : SETCommand '{' ObjectList '}' {
+ delete SetStack.back().first.second; // Delete OptBitList
+ SetStack.pop_back();
+ }
+ | SETCommand Object {
+ delete SetStack.back().first.second; // Delete OptBitList
+ SetStack.pop_back();
};
ObjectList : Object {} | ObjectList Object {};