1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[TableGen] Fold variable declaration/initialization into if condition for a couple short lived variables. NFC

llvm-svn: 239207
This commit is contained in:
Craig Topper 2015-06-06 01:33:58 +00:00
parent 3ea261726d
commit a19f3db07c

View File

@ -927,9 +927,8 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type,
DagInit *MHSd = dyn_cast<DagInit>(MHS); DagInit *MHSd = dyn_cast<DagInit>(MHS);
if (MHSd && isa<DagRecTy>(Type)) { if (MHSd && isa<DagRecTy>(Type)) {
Init *Val = MHSd->getOperator(); Init *Val = MHSd->getOperator();
Init *Result = EvaluateOperation(RHSo, LHS, Val, if (Init *Result = EvaluateOperation(RHSo, LHS, Val,
Type, CurRec, CurMultiClass); Type, CurRec, CurMultiClass))
if (Result)
Val = Result; Val = Result;
std::vector<std::pair<Init *, std::string> > args; std::vector<std::pair<Init *, std::string> > args;
@ -938,9 +937,8 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type,
std::string ArgName = MHSd->getArgName(i); std::string ArgName = MHSd->getArgName(i);
// Process args // Process args
Init *Result = EvaluateOperation(RHSo, LHS, Arg, Type, if (Init *Result = EvaluateOperation(RHSo, LHS, Arg, Type,
CurRec, CurMultiClass); CurRec, CurMultiClass))
if (Result)
Arg = Result; Arg = Result;
// TODO: Process arg names // TODO: Process arg names
@ -1351,8 +1349,8 @@ Init *VarListElementInit:: resolveListElementReference(Record &R,
unsigned Elt) const { unsigned Elt) const {
if (Init *Result = TI->resolveListElementReference(R, RV, Element)) { if (Init *Result = TI->resolveListElementReference(R, RV, Element)) {
if (TypedInit *TInit = dyn_cast<TypedInit>(Result)) { if (TypedInit *TInit = dyn_cast<TypedInit>(Result)) {
Init *Result2 = TInit->resolveListElementReference(R, RV, Elt); if (Init *Result2 = TInit->resolveListElementReference(R, RV, Elt))
if (Result2) return Result2; return Result2;
return VarListElementInit::get(TInit, Elt); return VarListElementInit::get(TInit, Elt);
} }
return Result; return Result;