mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Make IntInits and ListInits typed. This helps deduce types of !if and
other operators. For the rare cases where a list type cannot be deduced, provide a []<type> syntax, where <type> is the list element type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73078 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2007,9 +2007,28 @@ void CodeGenDAGPatterns::ParsePatterns() {
|
||||
Pattern = new TreePattern(Patterns[i], Tree, true, *this);
|
||||
else {
|
||||
std::vector<Init*> Values;
|
||||
for (unsigned j = 0, ee = Tree->getNumArgs(); j != ee; ++j)
|
||||
RecTy *ListTy = 0;
|
||||
for (unsigned j = 0, ee = Tree->getNumArgs(); j != ee; ++j) {
|
||||
Values.push_back(Tree->getArg(j));
|
||||
ListInit *LI = new ListInit(Values);
|
||||
TypedInit *TArg = dynamic_cast<TypedInit*>(Tree->getArg(j));
|
||||
if (TArg == 0) {
|
||||
cerr << "In dag: " << Tree->getAsString();
|
||||
cerr << " -- Untyped argument in pattern\n";
|
||||
assert(0 && "Untyped argument in pattern");
|
||||
}
|
||||
if (ListTy != 0) {
|
||||
ListTy = resolveTypes(ListTy, TArg->getType());
|
||||
if (ListTy == 0) {
|
||||
cerr << "In dag: " << Tree->getAsString();
|
||||
cerr << " -- Incompatible types in pattern arguments\n";
|
||||
assert(0 && "Incompatible types in pattern arguments");
|
||||
}
|
||||
}
|
||||
else {
|
||||
ListTy - TArg->getType();
|
||||
}
|
||||
}
|
||||
ListInit *LI = new ListInit(Values, new ListRecTy(ListTy));
|
||||
Pattern = new TreePattern(Patterns[i], LI, true, *this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user