aboutsummaryrefslogtreecommitdiff
path: root/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-06-17 06:49:41 +0000
committerChris Lattner <sabre@nondot.org>2011-06-17 06:49:41 +0000
commit437544f25c1a6f6a00a2ed245c935088dbf9963d (patch)
tree128d4e702259e02f491291b55558c2409b1f319d /lib/AsmParser/LLParser.cpp
parent6b7c89ee096146aefebc245c7d8741b69786655a (diff)
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
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r--lib/AsmParser/LLParser.cpp36
1 files changed, 2 insertions, 34 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index f778193f15..024d013b81 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -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;
}