mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 22:58:50 +00:00
implement test/Regression/TableGen/DagIntSubst.ll
llvm-svn: 25836
This commit is contained in:
parent
e6bed389d4
commit
8d9da62be7
@ -68,7 +68,7 @@ static void addSuperClass(Record *SC) {
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -554,6 +554,17 @@ Init *FieldInit::resolveReferences(Record &R, const RecordVal *RV) {
|
||||
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();
|
||||
|
@ -826,7 +826,11 @@ public:
|
||||
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 @@ public:
|
||||
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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user