[llvm-commits] CVS: llvm/utils/TableGen/FileParser.y Record.cpp Record.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Jan 30 22:02:47 PST 2006
Changes in directory llvm/utils/TableGen:
FileParser.y updated: 1.39 -> 1.40
Record.cpp updated: 1.49 -> 1.50
Record.h updated: 1.54 -> 1.55
---
Log message:
implement test/Regression/TableGen/DagIntSubst.ll
---
Diffs of the changes: (+19 -2)
FileParser.y | 2 +-
Record.cpp | 11 +++++++++++
Record.h | 8 +++++++-
3 files changed, 19 insertions(+), 2 deletions(-)
Index: llvm/utils/TableGen/FileParser.y
diff -u llvm/utils/TableGen/FileParser.y:1.39 llvm/utils/TableGen/FileParser.y:1.40
--- llvm/utils/TableGen/FileParser.y:1.39 Thu Sep 29 23:53:04 2005
+++ llvm/utils/TableGen/FileParser.y Tue Jan 31 00:02:35 2006
@@ -68,7 +68,7 @@
}
static void setValue(const std::string &ValName,
- std::vector<unsigned> *BitList, Init *V) {
+ std::vector<unsigned> *BitList, Init *V) {
if (!V) return;
RecordVal *RV = CurRec->getValue(ValName);
Index: llvm/utils/TableGen/Record.cpp
diff -u llvm/utils/TableGen/Record.cpp:1.49 llvm/utils/TableGen/Record.cpp:1.50
--- llvm/utils/TableGen/Record.cpp:1.49 Sun Dec 25 23:08:55 2005
+++ llvm/utils/TableGen/Record.cpp Tue Jan 31 00:02:35 2006
@@ -554,6 +554,17 @@
return this;
}
+Init *DagInit::resolveReferences(Record &R, const RecordVal *RV) {
+ std::vector<Init*> NewArgs;
+ for (unsigned i = 0, e = Args.size(); i != e; ++i)
+ NewArgs.push_back(Args[i]->resolveReferences(R, RV));
+
+ if (Args != NewArgs)
+ return new DagInit(NodeTypeDef, NewArgs, ArgNames);
+
+ return this;
+}
+
void DagInit::print(std::ostream &OS) const {
OS << "(" << NodeTypeDef->getName();
Index: llvm/utils/TableGen/Record.h
diff -u llvm/utils/TableGen/Record.h:1.54 llvm/utils/TableGen/Record.h:1.55
--- llvm/utils/TableGen/Record.h:1.54 Fri Oct 28 17:49:02 2005
+++ llvm/utils/TableGen/Record.h Tue Jan 31 00:02:35 2006
@@ -826,7 +826,11 @@
ArgNames.push_back(args[i].second);
}
}
-
+ DagInit(Record *D, const std::vector<Init*> &args,
+ const std::vector<std::string> &argNames)
+ : NodeTypeDef(D), Args(args), ArgNames(argNames) {
+ }
+
virtual Init *convertInitializerTo(RecTy *Ty) {
return Ty->convertValue(this);
}
@@ -847,6 +851,8 @@
assert(Num < Args.size() && "Arg number out of range!");
Args[Num] = I;
}
+
+ virtual Init *resolveReferences(Record &R, const RecordVal *RV);
virtual void print(std::ostream &OS) const;
};
More information about the llvm-commits
mailing list