Changes in directory llvm/utils/TableGen:
FileParser.y updated: 1.46 -> 1.47 --- Log message: Add support for let expressions around an mdef. This implements a new part of Regression/TableGen/MultiClass.td. --- Diffs of the changes: (+10 -2) FileParser.y | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm/utils/TableGen/FileParser.y diff -u llvm/utils/TableGen/FileParser.y:1.46 llvm/utils/TableGen/FileParser.y:1.47 --- llvm/utils/TableGen/FileParser.y:1.46 Sat Oct 7 02:14:48 2006 +++ llvm/utils/TableGen/FileParser.y Wed Oct 11 13:12:44 2006 @@ -624,9 +624,9 @@ // Delete the template arg values for the class delete (*$1)[i].second; } - delete $1; // Delete the class list... + delete $1; // Delete the class list. - // Process any variables on the set stack... + // Process any variables on the let stack. for (unsigned i = 0, e = LetStack.size(); i != e; ++i) for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j) setValue(LetStack[i][j].Name, @@ -743,6 +743,14 @@ } } + // If the mdef is inside a 'let' expression, add to each def. + for (unsigned i = 0, e = LetStack.size(); i != e; ++i) + for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j) + setValue(LetStack[i][j].Name, + LetStack[i][j].HasBits ? &LetStack[i][j].Bits : 0, + LetStack[i][j].Value); + + // Ensure redefinition doesn't happen. if (Records.getDef(CurRec->getName())) { err() << "def '" << CurRec->getName() << "' already defined, " _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits