Add support for field exprs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4850 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-12-02 16:43:43 +00:00
parent 28520c4b61
commit 34a7769b0b
2 changed files with 14 additions and 0 deletions

View File

@ -258,6 +258,13 @@ Value : INTVAL {
} | '[' DefList ']' {
$$ = new ListInit(*$2);
delete $2;
} | Value '.' ID {
if (!$1->getFieldType(*$3)) {
err() << "Cannot access field '" << *$3 << "' of value '" << *$1 << "!\n";
abort();
}
$$ = new FieldInit($1, *$3);
delete $3;
};
DefList : /*empty */ {

View File

@ -258,6 +258,13 @@ Value : INTVAL {
} | '[' DefList ']' {
$$ = new ListInit(*$2);
delete $2;
} | Value '.' ID {
if (!$1->getFieldType(*$3)) {
err() << "Cannot access field '" << *$3 << "' of value '" << *$1 << "!\n";
abort();
}
$$ = new FieldInit($1, *$3);
delete $3;
};
DefList : /*empty */ {