mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
remove parser support for the obsolete "multiple return values" syntax, which
was replaced with return of a "first class aggregate". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133245 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3079,9 +3079,7 @@ bool LLParser::ParseCmpPredicate(unsigned &P, unsigned Opc) {
|
||||
/// ParseRet - Parse a return instruction.
|
||||
/// ::= 'ret' void (',' !dbg, !1)*
|
||||
/// ::= 'ret' TypeAndValue (',' !dbg, !1)*
|
||||
/// ::= 'ret' TypeAndValue (',' TypeAndValue)+ (',' !dbg, !1)*
|
||||
/// [[obsolete: LLVM 3.0]]
|
||||
int LLParser::ParseRet(Instruction *&Inst, BasicBlock *BB,
|
||||
bool LLParser::ParseRet(Instruction *&Inst, BasicBlock *BB,
|
||||
PerFunctionState &PFS) {
|
||||
PATypeHolder Ty(Type::getVoidTy(Context));
|
||||
if (ParseType(Ty, true /*void allowed*/)) return true;
|
||||
@@ -3094,38 +3092,8 @@ int LLParser::ParseRet(Instruction *&Inst, BasicBlock *BB,
|
||||
Value *RV;
|
||||
if (ParseValue(Ty, RV, PFS)) return true;
|
||||
|
||||
bool ExtraComma = false;
|
||||
if (EatIfPresent(lltok::comma)) {
|
||||
// Parse optional custom metadata, e.g. !dbg
|
||||
if (Lex.getKind() == lltok::MetadataVar) {
|
||||
ExtraComma = true;
|
||||
} else {
|
||||
// The normal case is one return value.
|
||||
// FIXME: LLVM 3.0 remove MRV support for 'ret i32 1, i32 2', requiring
|
||||
// use of 'ret {i32,i32} {i32 1, i32 2}'
|
||||
SmallVector<Value*, 8> RVs;
|
||||
RVs.push_back(RV);
|
||||
|
||||
do {
|
||||
// If optional custom metadata, e.g. !dbg is seen then this is the
|
||||
// end of MRV.
|
||||
if (Lex.getKind() == lltok::MetadataVar)
|
||||
break;
|
||||
if (ParseTypeAndValue(RV, PFS)) return true;
|
||||
RVs.push_back(RV);
|
||||
} while (EatIfPresent(lltok::comma));
|
||||
|
||||
RV = UndefValue::get(PFS.getFunction().getReturnType());
|
||||
for (unsigned i = 0, e = RVs.size(); i != e; ++i) {
|
||||
Instruction *I = InsertValueInst::Create(RV, RVs[i], i, "mrv");
|
||||
BB->getInstList().push_back(I);
|
||||
RV = I;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Inst = ReturnInst::Create(Context, RV);
|
||||
return ExtraComma ? InstExtraComma : InstNormal;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -340,7 +340,7 @@ namespace llvm {
|
||||
PerFunctionState &PFS);
|
||||
bool ParseCmpPredicate(unsigned &Pred, unsigned Opc);
|
||||
|
||||
int ParseRet(Instruction *&Inst, BasicBlock *BB, PerFunctionState &PFS);
|
||||
bool ParseRet(Instruction *&Inst, BasicBlock *BB, PerFunctionState &PFS);
|
||||
bool ParseBr(Instruction *&Inst, PerFunctionState &PFS);
|
||||
bool ParseSwitch(Instruction *&Inst, PerFunctionState &PFS);
|
||||
bool ParseIndirectBr(Instruction *&Inst, PerFunctionState &PFS);
|
||||
|
Reference in New Issue
Block a user