mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
[TableGen] Rename ListInit::getSize to just 'size' to be more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238806 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -603,7 +603,6 @@ public:
|
|||||||
|
|
||||||
void Profile(FoldingSetNodeID &ID) const;
|
void Profile(FoldingSetNodeID &ID) const;
|
||||||
|
|
||||||
unsigned getSize() const { return Values.size(); }
|
|
||||||
Init *getElement(unsigned i) const {
|
Init *getElement(unsigned i) const {
|
||||||
assert(i < Values.size() && "List element index out of range!");
|
assert(i < Values.size() && "List element index out of range!");
|
||||||
return Values[i];
|
return Values[i];
|
||||||
@ -627,10 +626,11 @@ public:
|
|||||||
|
|
||||||
ArrayRef<Init*> getValues() const { return Values; }
|
ArrayRef<Init*> getValues() const { return Values; }
|
||||||
|
|
||||||
inline const_iterator begin() const { return Values.begin(); }
|
const_iterator begin() const { return Values.begin(); }
|
||||||
inline const_iterator end () const { return Values.end(); }
|
const_iterator end () const { return Values.end(); }
|
||||||
|
|
||||||
inline bool empty() const { return Values.empty(); }
|
size_t size () const { return Values.size(); }
|
||||||
|
bool empty() const { return Values.empty(); }
|
||||||
|
|
||||||
/// resolveListElementReference - This method is used to implement
|
/// resolveListElementReference - This method is used to implement
|
||||||
/// VarListElementInit::resolveReferences. If the list element is resolvable
|
/// VarListElementInit::resolveReferences. If the list element is resolvable
|
||||||
|
@ -521,7 +521,7 @@ Init *
|
|||||||
ListInit::convertInitListSlice(const std::vector<unsigned> &Elements) const {
|
ListInit::convertInitListSlice(const std::vector<unsigned> &Elements) const {
|
||||||
std::vector<Init*> Vals;
|
std::vector<Init*> Vals;
|
||||||
for (unsigned i = 0, e = Elements.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Elements.size(); i != e; ++i) {
|
||||||
if (Elements[i] >= getSize())
|
if (Elements[i] >= size())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
Vals.push_back(getElement(Elements[i]));
|
Vals.push_back(getElement(Elements[i]));
|
||||||
}
|
}
|
||||||
@ -538,7 +538,7 @@ Record *ListInit::getElementAsRecord(unsigned i) const {
|
|||||||
|
|
||||||
Init *ListInit::resolveReferences(Record &R, const RecordVal *RV) const {
|
Init *ListInit::resolveReferences(Record &R, const RecordVal *RV) const {
|
||||||
std::vector<Init*> Resolved;
|
std::vector<Init*> Resolved;
|
||||||
Resolved.reserve(getSize());
|
Resolved.reserve(size());
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
|
||||||
for (Init *CurElt : getValues()) {
|
for (Init *CurElt : getValues()) {
|
||||||
@ -559,7 +559,7 @@ Init *ListInit::resolveReferences(Record &R, const RecordVal *RV) const {
|
|||||||
|
|
||||||
Init *ListInit::resolveListElementReference(Record &R, const RecordVal *IRV,
|
Init *ListInit::resolveListElementReference(Record &R, const RecordVal *IRV,
|
||||||
unsigned Elt) const {
|
unsigned Elt) const {
|
||||||
if (Elt >= getSize())
|
if (Elt >= size())
|
||||||
return nullptr; // Out of range reference.
|
return nullptr; // Out of range reference.
|
||||||
Init *E = getElement(Elt);
|
Init *E = getElement(Elt);
|
||||||
// If the element is set to some value, or if we are resolving a reference
|
// If the element is set to some value, or if we are resolving a reference
|
||||||
@ -1243,7 +1243,7 @@ Init *VarInit::resolveListElementReference(Record &R,
|
|||||||
if (!LI)
|
if (!LI)
|
||||||
return VarListElementInit::get(cast<TypedInit>(RV->getValue()), Elt);
|
return VarListElementInit::get(cast<TypedInit>(RV->getValue()), Elt);
|
||||||
|
|
||||||
if (Elt >= LI->getSize())
|
if (Elt >= LI->size())
|
||||||
return nullptr; // Out of range reference.
|
return nullptr; // Out of range reference.
|
||||||
Init *E = LI->getElement(Elt);
|
Init *E = LI->getElement(Elt);
|
||||||
// If the element is set to some value, or if we are resolving a reference
|
// If the element is set to some value, or if we are resolving a reference
|
||||||
@ -1412,7 +1412,7 @@ Init *FieldInit::resolveListElementReference(Record &R, const RecordVal *RV,
|
|||||||
unsigned Elt) const {
|
unsigned Elt) const {
|
||||||
if (Init *ListVal = Rec->getFieldInit(R, RV, FieldName))
|
if (Init *ListVal = Rec->getFieldInit(R, RV, FieldName))
|
||||||
if (ListInit *LI = dyn_cast<ListInit>(ListVal)) {
|
if (ListInit *LI = dyn_cast<ListInit>(ListVal)) {
|
||||||
if (Elt >= LI->getSize()) return nullptr;
|
if (Elt >= LI->size()) return nullptr;
|
||||||
Init *E = LI->getElement(Elt);
|
Init *E = LI->getElement(Elt);
|
||||||
|
|
||||||
// If the element is set to some value, or if we are resolving a
|
// If the element is set to some value, or if we are resolving a
|
||||||
|
@ -309,7 +309,7 @@ bool TGParser::ProcessForeachDefs(Record *CurRec, SMLoc Loc, IterSet &IterVals){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process each value.
|
// Process each value.
|
||||||
for (int64_t i = 0; i < List->getSize(); ++i) {
|
for (unsigned i = 0; i < List->size(); ++i) {
|
||||||
Init *ItemVal = List->resolveListElementReference(*CurRec, nullptr, i);
|
Init *ItemVal = List->resolveListElementReference(*CurRec, nullptr, i);
|
||||||
IterVals.push_back(IterRecord(CurLoop.IterVar, ItemVal));
|
IterVals.push_back(IterRecord(CurLoop.IterVar, ItemVal));
|
||||||
if (ProcessForeachDefs(CurRec, Loc, IterVals))
|
if (ProcessForeachDefs(CurRec, Loc, IterVals))
|
||||||
|
@ -69,7 +69,7 @@ void CallingConvEmitter::EmitCallingConv(Record *CC, raw_ostream &O) {
|
|||||||
<< std::string(CC->getName().size()+13, ' ')
|
<< std::string(CC->getName().size()+13, ' ')
|
||||||
<< "ISD::ArgFlagsTy ArgFlags, CCState &State) {\n";
|
<< "ISD::ArgFlagsTy ArgFlags, CCState &State) {\n";
|
||||||
// Emit all of the actions, in order.
|
// Emit all of the actions, in order.
|
||||||
for (unsigned i = 0, e = CCActions->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = CCActions->size(); i != e; ++i) {
|
||||||
O << "\n";
|
O << "\n";
|
||||||
EmitAction(CCActions->getElementAsRecord(i), 2, O);
|
EmitAction(CCActions->getElementAsRecord(i), 2, O);
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
|||||||
|
|
||||||
if (Action->isSubClassOf("CCIfType")) {
|
if (Action->isSubClassOf("CCIfType")) {
|
||||||
ListInit *VTs = Action->getValueAsListInit("VTs");
|
ListInit *VTs = Action->getValueAsListInit("VTs");
|
||||||
for (unsigned i = 0, e = VTs->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = VTs->size(); i != e; ++i) {
|
||||||
Record *VT = VTs->getElementAsRecord(i);
|
Record *VT = VTs->getElementAsRecord(i);
|
||||||
if (i != 0) O << " ||\n " << IndentStr;
|
if (i != 0) O << " ||\n " << IndentStr;
|
||||||
O << "LocVT == " << getEnumName(getValueType(VT));
|
O << "LocVT == " << getEnumName(getValueType(VT));
|
||||||
@ -111,14 +111,14 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
|||||||
<< IndentStr << " return false;\n";
|
<< IndentStr << " return false;\n";
|
||||||
} else if (Action->isSubClassOf("CCAssignToReg")) {
|
} else if (Action->isSubClassOf("CCAssignToReg")) {
|
||||||
ListInit *RegList = Action->getValueAsListInit("RegList");
|
ListInit *RegList = Action->getValueAsListInit("RegList");
|
||||||
if (RegList->getSize() == 1) {
|
if (RegList->size() == 1) {
|
||||||
O << IndentStr << "if (unsigned Reg = State.AllocateReg(";
|
O << IndentStr << "if (unsigned Reg = State.AllocateReg(";
|
||||||
O << getQualifiedName(RegList->getElementAsRecord(0)) << ")) {\n";
|
O << getQualifiedName(RegList->getElementAsRecord(0)) << ")) {\n";
|
||||||
} else {
|
} else {
|
||||||
O << IndentStr << "static const MCPhysReg RegList" << ++Counter
|
O << IndentStr << "static const MCPhysReg RegList" << ++Counter
|
||||||
<< "[] = {\n";
|
<< "[] = {\n";
|
||||||
O << IndentStr << " ";
|
O << IndentStr << " ";
|
||||||
for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = RegList->size(); i != e; ++i) {
|
||||||
if (i != 0) O << ", ";
|
if (i != 0) O << ", ";
|
||||||
O << getQualifiedName(RegList->getElementAsRecord(i));
|
O << getQualifiedName(RegList->getElementAsRecord(i));
|
||||||
}
|
}
|
||||||
@ -133,11 +133,10 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
|||||||
} else if (Action->isSubClassOf("CCAssignToRegWithShadow")) {
|
} else if (Action->isSubClassOf("CCAssignToRegWithShadow")) {
|
||||||
ListInit *RegList = Action->getValueAsListInit("RegList");
|
ListInit *RegList = Action->getValueAsListInit("RegList");
|
||||||
ListInit *ShadowRegList = Action->getValueAsListInit("ShadowRegList");
|
ListInit *ShadowRegList = Action->getValueAsListInit("ShadowRegList");
|
||||||
if (ShadowRegList->getSize() >0 &&
|
if (!ShadowRegList->empty() && ShadowRegList->size() != RegList->size())
|
||||||
ShadowRegList->getSize() != RegList->getSize())
|
|
||||||
PrintFatalError("Invalid length of list of shadowed registers");
|
PrintFatalError("Invalid length of list of shadowed registers");
|
||||||
|
|
||||||
if (RegList->getSize() == 1) {
|
if (RegList->size() == 1) {
|
||||||
O << IndentStr << "if (unsigned Reg = State.AllocateReg(";
|
O << IndentStr << "if (unsigned Reg = State.AllocateReg(";
|
||||||
O << getQualifiedName(RegList->getElementAsRecord(0));
|
O << getQualifiedName(RegList->getElementAsRecord(0));
|
||||||
O << ", " << getQualifiedName(ShadowRegList->getElementAsRecord(0));
|
O << ", " << getQualifiedName(ShadowRegList->getElementAsRecord(0));
|
||||||
@ -149,7 +148,7 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
|||||||
O << IndentStr << "static const MCPhysReg RegList" << RegListNumber
|
O << IndentStr << "static const MCPhysReg RegList" << RegListNumber
|
||||||
<< "[] = {\n";
|
<< "[] = {\n";
|
||||||
O << IndentStr << " ";
|
O << IndentStr << " ";
|
||||||
for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = RegList->size(); i != e; ++i) {
|
||||||
if (i != 0) O << ", ";
|
if (i != 0) O << ", ";
|
||||||
O << getQualifiedName(RegList->getElementAsRecord(i));
|
O << getQualifiedName(RegList->getElementAsRecord(i));
|
||||||
}
|
}
|
||||||
@ -158,7 +157,7 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
|||||||
O << IndentStr << "static const MCPhysReg RegList"
|
O << IndentStr << "static const MCPhysReg RegList"
|
||||||
<< ShadowRegListNumber << "[] = {\n";
|
<< ShadowRegListNumber << "[] = {\n";
|
||||||
O << IndentStr << " ";
|
O << IndentStr << " ";
|
||||||
for (unsigned i = 0, e = ShadowRegList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = ShadowRegList->size(); i != e; ++i) {
|
||||||
if (i != 0) O << ", ";
|
if (i != 0) O << ", ";
|
||||||
O << getQualifiedName(ShadowRegList->getElementAsRecord(i));
|
O << getQualifiedName(ShadowRegList->getElementAsRecord(i));
|
||||||
}
|
}
|
||||||
@ -206,7 +205,7 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
|||||||
O << IndentStr << "static const MCPhysReg ShadowRegList"
|
O << IndentStr << "static const MCPhysReg ShadowRegList"
|
||||||
<< ShadowRegListNumber << "[] = {\n";
|
<< ShadowRegListNumber << "[] = {\n";
|
||||||
O << IndentStr << " ";
|
O << IndentStr << " ";
|
||||||
for (unsigned i = 0, e = ShadowRegList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = ShadowRegList->size(); i != e; ++i) {
|
||||||
if (i != 0) O << ", ";
|
if (i != 0) O << ", ";
|
||||||
O << getQualifiedName(ShadowRegList->getElementAsRecord(i));
|
O << getQualifiedName(ShadowRegList->getElementAsRecord(i));
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ public:
|
|||||||
|
|
||||||
// Make sure that all the sub-lists in 'ValueCols' have same number of
|
// Make sure that all the sub-lists in 'ValueCols' have same number of
|
||||||
// elements as the fields in 'ColFields'.
|
// elements as the fields in 'ColFields'.
|
||||||
if (ColI->getSize() != ColFields->getSize())
|
if (ColI->size() != ColFields->size())
|
||||||
PrintFatalError(MapRec->getLoc(), "Record `" + MapRec->getName() +
|
PrintFatalError(MapRec->getLoc(), "Record `" + MapRec->getName() +
|
||||||
"', field `ValueCols' entries don't match with " +
|
"', field `ValueCols' entries don't match with " +
|
||||||
" the entries in 'ColFields'!");
|
" the entries in 'ColFields'!");
|
||||||
@ -267,7 +267,7 @@ bool MapTableEmitter::isKeyColInstr(Record* CurInstr) {
|
|||||||
|
|
||||||
// Check if the instruction is a KeyCol instruction.
|
// Check if the instruction is a KeyCol instruction.
|
||||||
bool MatchFound = true;
|
bool MatchFound = true;
|
||||||
for (unsigned j = 0, endCF = ColFields->getSize();
|
for (unsigned j = 0, endCF = ColFields->size();
|
||||||
(j < endCF) && MatchFound; j++) {
|
(j < endCF) && MatchFound; j++) {
|
||||||
RecordVal *ColFieldName = CurInstr->getValue(ColFields->getElement(j));
|
RecordVal *ColFieldName = CurInstr->getValue(ColFields->getElement(j));
|
||||||
std::string CurInstrVal = ColFieldName->getValue()->getAsUnquotedString();
|
std::string CurInstrVal = ColFieldName->getValue()->getAsUnquotedString();
|
||||||
@ -327,7 +327,7 @@ Record *MapTableEmitter::getInstrForColumn(Record *KeyInstr,
|
|||||||
for (unsigned i = 0, e = RelatedInstrVec.size(); i < e; i++) {
|
for (unsigned i = 0, e = RelatedInstrVec.size(); i < e; i++) {
|
||||||
bool MatchFound = true;
|
bool MatchFound = true;
|
||||||
Record *CurInstr = RelatedInstrVec[i];
|
Record *CurInstr = RelatedInstrVec[i];
|
||||||
for (unsigned j = 0, endCF = ColFields->getSize();
|
for (unsigned j = 0, endCF = ColFields->size();
|
||||||
(j < endCF) && MatchFound; j++) {
|
(j < endCF) && MatchFound; j++) {
|
||||||
Init *ColFieldJ = ColFields->getElement(j);
|
Init *ColFieldJ = ColFields->getElement(j);
|
||||||
Init *CurInstrInit = CurInstr->getValue(ColFieldJ)->getValue();
|
Init *CurInstrInit = CurInstr->getValue(ColFieldJ)->getValue();
|
||||||
@ -439,12 +439,12 @@ void MapTableEmitter::emitMapFuncBody(raw_ostream &OS,
|
|||||||
if (ValueCols.size() > 1) {
|
if (ValueCols.size() > 1) {
|
||||||
for (unsigned i = 0, e = ValueCols.size(); i < e; i++) {
|
for (unsigned i = 0, e = ValueCols.size(); i < e; i++) {
|
||||||
ListInit *ColumnI = ValueCols[i];
|
ListInit *ColumnI = ValueCols[i];
|
||||||
for (unsigned j = 0, ColSize = ColumnI->getSize(); j < ColSize; j++) {
|
for (unsigned j = 0, ColSize = ColumnI->size(); j < ColSize; ++j) {
|
||||||
std::string ColName = ColFields->getElement(j)->getAsUnquotedString();
|
std::string ColName = ColFields->getElement(j)->getAsUnquotedString();
|
||||||
OS << " if (in" << ColName;
|
OS << " if (in" << ColName;
|
||||||
OS << " == ";
|
OS << " == ";
|
||||||
OS << ColName << "_" << ColumnI->getElement(j)->getAsUnquotedString();
|
OS << ColName << "_" << ColumnI->getElement(j)->getAsUnquotedString();
|
||||||
if (j < ColumnI->getSize() - 1) OS << " && ";
|
if (j < ColumnI->size() - 1) OS << " && ";
|
||||||
else OS << ")\n";
|
else OS << ")\n";
|
||||||
}
|
}
|
||||||
OS << " return " << InstrMapDesc.getName();
|
OS << " return " << InstrMapDesc.getName();
|
||||||
@ -505,18 +505,18 @@ static void emitEnums(raw_ostream &OS, RecordKeeper &Records) {
|
|||||||
ColFields = CurMap->getValueAsListInit("ColFields");
|
ColFields = CurMap->getValueAsListInit("ColFields");
|
||||||
ListInit *List = CurMap->getValueAsListInit("ValueCols");
|
ListInit *List = CurMap->getValueAsListInit("ValueCols");
|
||||||
std::vector<ListInit*> ValueCols;
|
std::vector<ListInit*> ValueCols;
|
||||||
unsigned ListSize = List->getSize();
|
unsigned ListSize = List->size();
|
||||||
|
|
||||||
for (unsigned j = 0; j < ListSize; j++) {
|
for (unsigned j = 0; j < ListSize; j++) {
|
||||||
ListInit *ListJ = dyn_cast<ListInit>(List->getElement(j));
|
ListInit *ListJ = dyn_cast<ListInit>(List->getElement(j));
|
||||||
|
|
||||||
if (ListJ->getSize() != ColFields->getSize())
|
if (ListJ->size() != ColFields->size())
|
||||||
PrintFatalError("Record `" + CurMap->getName() + "', field "
|
PrintFatalError("Record `" + CurMap->getName() + "', field "
|
||||||
"`ValueCols' entries don't match with the entries in 'ColFields' !");
|
"`ValueCols' entries don't match with the entries in 'ColFields' !");
|
||||||
ValueCols.push_back(ListJ);
|
ValueCols.push_back(ListJ);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned j = 0, endCF = ColFields->getSize(); j < endCF; j++) {
|
for (unsigned j = 0, endCF = ColFields->size(); j < endCF; j++) {
|
||||||
for (unsigned k = 0; k < ListSize; k++){
|
for (unsigned k = 0; k < ListSize; k++){
|
||||||
std::string ColName = ColFields->getElement(j)->getAsUnquotedString();
|
std::string ColName = ColFields->getElement(j)->getAsUnquotedString();
|
||||||
ColFieldValueMap[ColName].push_back((ValueCols[k])->getElement(j));
|
ColFieldValueMap[ColName].push_back((ValueCols[k])->getElement(j));
|
||||||
|
@ -543,7 +543,7 @@ struct TupleExpander : SetTheory::Expander {
|
|||||||
std::vector<Record*> Indices = Def->getValueAsListOfDefs("SubRegIndices");
|
std::vector<Record*> Indices = Def->getValueAsListOfDefs("SubRegIndices");
|
||||||
unsigned Dim = Indices.size();
|
unsigned Dim = Indices.size();
|
||||||
ListInit *SubRegs = Def->getValueAsListInit("SubRegs");
|
ListInit *SubRegs = Def->getValueAsListInit("SubRegs");
|
||||||
if (Dim != SubRegs->getSize())
|
if (Dim != SubRegs->size())
|
||||||
PrintFatalError(Def->getLoc(), "SubRegIndices and SubRegs size mismatch");
|
PrintFatalError(Def->getLoc(), "SubRegIndices and SubRegs size mismatch");
|
||||||
if (Dim < 2)
|
if (Dim < 2)
|
||||||
PrintFatalError(Def->getLoc(),
|
PrintFatalError(Def->getLoc(),
|
||||||
@ -676,7 +676,7 @@ CodeGenRegisterClass::CodeGenRegisterClass(CodeGenRegBank &RegBank, Record *R)
|
|||||||
// Allocation order 0 is the full set. AltOrders provides others.
|
// Allocation order 0 is the full set. AltOrders provides others.
|
||||||
const SetTheory::RecVec *Elements = RegBank.getSets().expand(R);
|
const SetTheory::RecVec *Elements = RegBank.getSets().expand(R);
|
||||||
ListInit *AltOrders = R->getValueAsListInit("AltOrders");
|
ListInit *AltOrders = R->getValueAsListInit("AltOrders");
|
||||||
Orders.resize(1 + AltOrders->getSize());
|
Orders.resize(1 + AltOrders->size());
|
||||||
|
|
||||||
// Default allocation order always contains all registers.
|
// Default allocation order always contains all registers.
|
||||||
for (unsigned i = 0, e = Elements->size(); i != e; ++i) {
|
for (unsigned i = 0, e = Elements->size(); i != e; ++i) {
|
||||||
@ -689,7 +689,7 @@ CodeGenRegisterClass::CodeGenRegisterClass(CodeGenRegBank &RegBank, Record *R)
|
|||||||
|
|
||||||
// Alternative allocation orders may be subsets.
|
// Alternative allocation orders may be subsets.
|
||||||
SetTheory::RecSet Order;
|
SetTheory::RecSet Order;
|
||||||
for (unsigned i = 0, e = AltOrders->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = AltOrders->size(); i != e; ++i) {
|
||||||
RegBank.getSets().evaluate(AltOrders->getElement(i), Order, R->getLoc());
|
RegBank.getSets().evaluate(AltOrders->getElement(i), Order, R->getLoc());
|
||||||
Orders[1 + i].append(Order.begin(), Order.end());
|
Orders[1 + i].append(Order.begin(), Order.end());
|
||||||
// Verify that all altorder members are regclass members.
|
// Verify that all altorder members are regclass members.
|
||||||
|
@ -486,7 +486,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
|
|||||||
// Parse the list of return types.
|
// Parse the list of return types.
|
||||||
std::vector<MVT::SimpleValueType> OverloadedVTs;
|
std::vector<MVT::SimpleValueType> OverloadedVTs;
|
||||||
ListInit *TypeList = R->getValueAsListInit("RetTypes");
|
ListInit *TypeList = R->getValueAsListInit("RetTypes");
|
||||||
for (unsigned i = 0, e = TypeList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = TypeList->size(); i != e; ++i) {
|
||||||
Record *TyEl = TypeList->getElementAsRecord(i);
|
Record *TyEl = TypeList->getElementAsRecord(i);
|
||||||
assert(TyEl->isSubClassOf("LLVMType") && "Expected a type!");
|
assert(TyEl->isSubClassOf("LLVMType") && "Expected a type!");
|
||||||
MVT::SimpleValueType VT;
|
MVT::SimpleValueType VT;
|
||||||
@ -520,7 +520,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
|
|||||||
|
|
||||||
// Parse the list of parameter types.
|
// Parse the list of parameter types.
|
||||||
TypeList = R->getValueAsListInit("ParamTypes");
|
TypeList = R->getValueAsListInit("ParamTypes");
|
||||||
for (unsigned i = 0, e = TypeList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = TypeList->size(); i != e; ++i) {
|
||||||
Record *TyEl = TypeList->getElementAsRecord(i);
|
Record *TyEl = TypeList->getElementAsRecord(i);
|
||||||
assert(TyEl->isSubClassOf("LLVMType") && "Expected a type!");
|
assert(TyEl->isSubClassOf("LLVMType") && "Expected a type!");
|
||||||
MVT::SimpleValueType VT;
|
MVT::SimpleValueType VT;
|
||||||
@ -556,7 +556,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
|
|||||||
|
|
||||||
// Parse the intrinsic properties.
|
// Parse the intrinsic properties.
|
||||||
ListInit *PropList = R->getValueAsListInit("Properties");
|
ListInit *PropList = R->getValueAsListInit("Properties");
|
||||||
for (unsigned i = 0, e = PropList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = PropList->size(); i != e; ++i) {
|
||||||
Record *Property = PropList->getElementAsRecord(i);
|
Record *Property = PropList->getElementAsRecord(i);
|
||||||
assert(Property->isSubClassOf("IntrinsicProperty") &&
|
assert(Property->isSubClassOf("IntrinsicProperty") &&
|
||||||
"Expected a property!");
|
"Expected a property!");
|
||||||
|
@ -1113,7 +1113,7 @@ bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation,
|
|||||||
ListInit *Predicates =
|
ListInit *Predicates =
|
||||||
AllInstructions[Opc]->TheDef->getValueAsListInit("Predicates");
|
AllInstructions[Opc]->TheDef->getValueAsListInit("Predicates");
|
||||||
bool IsFirstEmission = true;
|
bool IsFirstEmission = true;
|
||||||
for (unsigned i = 0; i < Predicates->getSize(); ++i) {
|
for (unsigned i = 0; i < Predicates->size(); ++i) {
|
||||||
Record *Pred = Predicates->getElementAsRecord(i);
|
Record *Pred = Predicates->getElementAsRecord(i);
|
||||||
if (!Pred->getValue("AssemblerMatcherPredicate"))
|
if (!Pred->getValue("AssemblerMatcherPredicate"))
|
||||||
continue;
|
continue;
|
||||||
@ -1136,13 +1136,13 @@ bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation,
|
|||||||
emitSinglePredicateMatch(o, pairs.first, Emitter->PredicateNamespace);
|
emitSinglePredicateMatch(o, pairs.first, Emitter->PredicateNamespace);
|
||||||
IsFirstEmission = false;
|
IsFirstEmission = false;
|
||||||
}
|
}
|
||||||
return Predicates->getSize() > 0;
|
return !Predicates->empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FilterChooser::doesOpcodeNeedPredicate(unsigned Opc) const {
|
bool FilterChooser::doesOpcodeNeedPredicate(unsigned Opc) const {
|
||||||
ListInit *Predicates =
|
ListInit *Predicates =
|
||||||
AllInstructions[Opc]->TheDef->getValueAsListInit("Predicates");
|
AllInstructions[Opc]->TheDef->getValueAsListInit("Predicates");
|
||||||
for (unsigned i = 0; i < Predicates->getSize(); ++i) {
|
for (unsigned i = 0; i < Predicates->size(); ++i) {
|
||||||
Record *Pred = Predicates->getElementAsRecord(i);
|
Record *Pred = Predicates->getElementAsRecord(i);
|
||||||
if (!Pred->getValue("AssemblerMatcherPredicate"))
|
if (!Pred->getValue("AssemblerMatcherPredicate"))
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user