mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 04:33:40 +00:00
Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89582 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2214dc0764
commit
21870411d9
@ -284,7 +284,8 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) {
|
||||
RecordRecTy *RecTy1 = dynamic_cast<RecordRecTy*>(T1);
|
||||
if (RecTy1) {
|
||||
// See if T2 inherits from a type T1 also inherits from
|
||||
const std::vector<Record *> &T1SuperClasses = RecTy1->getRecord()->getSuperClasses();
|
||||
const std::vector<Record *> &T1SuperClasses =
|
||||
RecTy1->getRecord()->getSuperClasses();
|
||||
for(std::vector<Record *>::const_iterator i = T1SuperClasses.begin(),
|
||||
iend = T1SuperClasses.end();
|
||||
i != iend;
|
||||
@ -302,7 +303,8 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) {
|
||||
RecordRecTy *RecTy2 = dynamic_cast<RecordRecTy*>(T2);
|
||||
if (RecTy2) {
|
||||
// See if T1 inherits from a type T2 also inherits from
|
||||
const std::vector<Record *> &T2SuperClasses = RecTy2->getRecord()->getSuperClasses();
|
||||
const std::vector<Record *> &T2SuperClasses =
|
||||
RecTy2->getRecord()->getSuperClasses();
|
||||
for (std::vector<Record *>::const_iterator i = T2SuperClasses.begin(),
|
||||
iend = T2SuperClasses.end();
|
||||
i != iend;
|
||||
@ -549,8 +551,7 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) {
|
||||
if (LHSd) {
|
||||
return new StringInit(LHSd->getDef()->getName());
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
StringInit *LHSs = dynamic_cast<StringInit*>(LHS);
|
||||
if (LHSs) {
|
||||
std::string Name = LHSs->getValue();
|
||||
@ -619,7 +620,8 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) {
|
||||
assert(0 && "Empty list in cdr");
|
||||
return 0;
|
||||
}
|
||||
ListInit *Result = new ListInit(LHSl->begin()+1, LHSl->end(), LHSl->getType());
|
||||
ListInit *Result = new ListInit(LHSl->begin()+1, LHSl->end(),
|
||||
LHSl->getType());
|
||||
return Result;
|
||||
}
|
||||
break;
|
||||
@ -629,8 +631,7 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) {
|
||||
if (LHSl) {
|
||||
if (LHSl->getSize() == 0) {
|
||||
return new IntInit(1);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return new IntInit(0);
|
||||
}
|
||||
}
|
||||
@ -638,8 +639,7 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) {
|
||||
if (LHSs) {
|
||||
if (LHSs->getValue().empty()) {
|
||||
return new IntInit(1);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return new IntInit(0);
|
||||
}
|
||||
}
|
||||
@ -840,8 +840,7 @@ static Init *EvaluateOperation(OpInit *RHSo, Init *LHS, Init *Arg,
|
||||
CurRec, CurMultiClass);
|
||||
if (Result != 0) {
|
||||
return Result;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -854,15 +853,12 @@ static Init *EvaluateOperation(OpInit *RHSo, Init *LHS, Init *Arg,
|
||||
Type, CurRec, CurMultiClass);
|
||||
if (Result != 0) {
|
||||
NewOperands.push_back(Result);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
NewOperands.push_back(Arg);
|
||||
}
|
||||
}
|
||||
else if (LHS->getAsString() == RHSo->getOperand(i)->getAsString()) {
|
||||
} else if (LHS->getAsString() == RHSo->getOperand(i)->getAsString()) {
|
||||
NewOperands.push_back(Arg);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
NewOperands.push_back(RHSo->getOperand(i));
|
||||
}
|
||||
}
|
||||
@ -942,8 +938,7 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type,
|
||||
// First, replace the foreach variable with the list item
|
||||
if (LHS->getAsString() == RHSo->getOperand(i)->getAsString()) {
|
||||
NewOperands.push_back(Item);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
NewOperands.push_back(RHSo->getOperand(i));
|
||||
}
|
||||
}
|
||||
@ -1026,8 +1021,7 @@ Init *TernOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) {
|
||||
if (LHSi) {
|
||||
if (LHSi->getValue()) {
|
||||
return MHS;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return RHS;
|
||||
}
|
||||
}
|
||||
@ -1047,11 +1041,12 @@ Init *TernOpInit::resolveReferences(Record &R, const RecordVal *RV) {
|
||||
// Short-circuit
|
||||
if (Value->getValue()) {
|
||||
Init *mhs = MHS->resolveReferences(R, RV);
|
||||
return (new TernOpInit(getOpcode(), lhs, mhs, RHS, getType()))->Fold(&R, 0);
|
||||
}
|
||||
else {
|
||||
return (new TernOpInit(getOpcode(), lhs, mhs,
|
||||
RHS, getType()))->Fold(&R, 0);
|
||||
} else {
|
||||
Init *rhs = RHS->resolveReferences(R, RV);
|
||||
return (new TernOpInit(getOpcode(), lhs, MHS, rhs, getType()))->Fold(&R, 0);
|
||||
return (new TernOpInit(getOpcode(), lhs, MHS,
|
||||
rhs, getType()))->Fold(&R, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -869,8 +869,7 @@ public:
|
||||
assert((i == 0 || i == 1) && "Invalid operand id for binary operator");
|
||||
if (i == 0) {
|
||||
return getLHS();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return getRHS();
|
||||
}
|
||||
}
|
||||
@ -915,11 +914,9 @@ public:
|
||||
"Invalid operand id for ternary operator");
|
||||
if (i == 0) {
|
||||
return getLHS();
|
||||
}
|
||||
else if (i == 1) {
|
||||
} else if (i == 1) {
|
||||
return getMHS();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return getRHS();
|
||||
}
|
||||
}
|
||||
@ -1118,8 +1115,8 @@ public:
|
||||
}
|
||||
DagInit(Init *V, std::string VN, const std::vector<Init*> &args,
|
||||
const std::vector<std::string> &argNames)
|
||||
: TypedInit(new DagRecTy), Val(V), ValName(VN), Args(args), ArgNames(argNames) {
|
||||
}
|
||||
: TypedInit(new DagRecTy), Val(V), ValName(VN), Args(args),
|
||||
ArgNames(argNames) { }
|
||||
|
||||
virtual Init *convertInitializerTo(RecTy *Ty) {
|
||||
return Ty->convertValue(this);
|
||||
@ -1180,7 +1177,6 @@ public:
|
||||
assert(0 && "Illegal element reference off dag");
|
||||
return 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@ -1490,7 +1486,6 @@ extern RecordKeeper Records;
|
||||
|
||||
void PrintError(SMLoc ErrorLoc, const std::string &Msg);
|
||||
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
#endif
|
||||
|
@ -366,7 +366,6 @@ Record *TGParser::ParseDefmID() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// ParseSubClassReference - Parse a reference to a subclass or to a templated
|
||||
/// subclass. This returns a SubClassRefTy with a null Record* on error.
|
||||
///
|
||||
@ -762,12 +761,10 @@ Init *TGParser::ParseOperation(Record *CurRec) {
|
||||
}
|
||||
if (Code == UnOpInit::CAR) {
|
||||
Type = Itemt->getType();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Type = new ListRecTy(Itemt->getType());
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
assert(LHSt && "expected list type argument in unary operator");
|
||||
ListRecTy *LType = dynamic_cast<ListRecTy*>(LHSt->getType());
|
||||
if (LType == 0) {
|
||||
@ -776,8 +773,7 @@ Init *TGParser::ParseOperation(Record *CurRec) {
|
||||
}
|
||||
if (Code == UnOpInit::CAR) {
|
||||
Type = LType->getElementType();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Type = LType;
|
||||
}
|
||||
}
|
||||
@ -933,11 +929,9 @@ Init *TGParser::ParseOperation(Record *CurRec) {
|
||||
}
|
||||
if (MHSt->getType()->typeIsConvertibleTo(RHSt->getType())) {
|
||||
Type = RHSt->getType();
|
||||
}
|
||||
else if (RHSt->getType()->typeIsConvertibleTo(MHSt->getType())) {
|
||||
} else if (RHSt->getType()->typeIsConvertibleTo(MHSt->getType())) {
|
||||
Type = MHSt->getType();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
TokError("inconsistent types for !if");
|
||||
return 0;
|
||||
}
|
||||
@ -962,7 +956,8 @@ Init *TGParser::ParseOperation(Record *CurRec) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (new TernOpInit(Code, LHS, MHS, RHS, Type))->Fold(CurRec, CurMultiClass);
|
||||
return (new TernOpInit(Code, LHS, MHS, RHS, Type))->Fold(CurRec,
|
||||
CurMultiClass);
|
||||
}
|
||||
}
|
||||
TokError("could not parse operation");
|
||||
@ -1130,7 +1125,8 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType) {
|
||||
}
|
||||
|
||||
if (Lex.getCode() != tgtok::r_square) {
|
||||
Vals = ParseValueList(CurRec, 0, GivenListTy ? GivenListTy->getElementType() : 0);
|
||||
Vals = ParseValueList(CurRec, 0,
|
||||
GivenListTy ? GivenListTy->getElementType() : 0);
|
||||
if (Vals.empty()) return 0;
|
||||
}
|
||||
if (Lex.getCode() != tgtok::r_square) {
|
||||
@ -1173,8 +1169,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType) {
|
||||
TokError("Incompatible types in list elements");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
EltTy = TArg->getType();
|
||||
}
|
||||
}
|
||||
@ -1196,8 +1191,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType) {
|
||||
return 0;
|
||||
}
|
||||
DeducedEltTy = GivenListTy->getElementType();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Make sure the deduced type is compatible with the given type
|
||||
if (GivenListTy) {
|
||||
if (!EltTy->typeIsConvertibleTo(GivenListTy->getElementType())) {
|
||||
@ -1223,8 +1217,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType) {
|
||||
if (Lex.getCode() == tgtok::Id) {
|
||||
Operator = ParseIDValue(CurRec);
|
||||
if (Operator == 0) return 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Operator = ParseOperation(CurRec);
|
||||
if (Operator == 0) return 0;
|
||||
}
|
||||
@ -1390,7 +1383,8 @@ TGParser::ParseDagArgList(Record *CurRec) {
|
||||
///
|
||||
/// ValueList ::= Value (',' Value)
|
||||
///
|
||||
std::vector<Init*> TGParser::ParseValueList(Record *CurRec, Record *ArgsRec, RecTy *EltTy) {
|
||||
std::vector<Init*> TGParser::ParseValueList(Record *CurRec, Record *ArgsRec,
|
||||
RecTy *EltTy) {
|
||||
std::vector<Init*> Result;
|
||||
RecTy *ItemType = EltTy;
|
||||
unsigned int ArgN = 0;
|
||||
@ -1426,7 +1420,6 @@ std::vector<Init*> TGParser::ParseValueList(Record *CurRec, Record *ArgsRec, Rec
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// ParseDeclaration - Read a declaration, returning the name of field ID, or an
|
||||
/// empty string on error. This can happen in a number of different context's,
|
||||
/// including within a def or in the template args for a def (which which case
|
||||
@ -1877,13 +1870,11 @@ bool TGParser::ParseMultiClass() {
|
||||
if (Lex.getCode() != tgtok::l_brace) {
|
||||
if (!inherits)
|
||||
return TokError("expected '{' in multiclass definition");
|
||||
else
|
||||
if (Lex.getCode() != tgtok::semi)
|
||||
else if (Lex.getCode() != tgtok::semi)
|
||||
return TokError("expected ';' in multiclass definition");
|
||||
else
|
||||
Lex.Lex(); // eat the ';'.
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (Lex.Lex() == tgtok::r_brace) // eat the '{'.
|
||||
return TokError("multiclass must contain at least one def");
|
||||
|
||||
@ -1943,8 +1934,7 @@ bool TGParser::ParseDefm() {
|
||||
std::string::size_type idx = DefName.find("#NAME#");
|
||||
if (idx != std::string::npos) {
|
||||
DefName.replace(idx, 6, DefmPrefix);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Add the suffix to the defm name to get the new name.
|
||||
DefName = DefmPrefix + DefName;
|
||||
}
|
||||
@ -2040,7 +2030,6 @@ bool TGParser::ParseObjectList() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool TGParser::ParseFile() {
|
||||
Lex.Lex(); // Prime the lexer.
|
||||
if (ParseObjectList()) return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user