llvm.org GIT mirror llvm / e8bc45a
Parse debug info attached with insertvalue and extractvalue instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85921 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 10 years ago
2 changed file(s) with 22 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
11361136 return TokError("expected ',' as start of index list");
11371137
11381138 while (EatIfPresent(lltok::comma)) {
1139 if (Lex.getKind() == lltok::NamedOrCustomMD)
1140 break;
11391141 unsigned Idx;
11401142 if (ParseUInt32(Idx)) return true;
11411143 Indices.push_back(Idx);
21102112 ParseIndexList(Indices) ||
21112113 ParseToken(lltok::rparen, "expected ')' in extractvalue constantexpr"))
21122114 return true;
2115 if (Lex.getKind() == lltok::NamedOrCustomMD)
2116 if (ParseOptionalCustomMetadata()) return true;
2117
21132118 if (!isa(Val->getType()) && !isa(Val->getType()))
21142119 return Error(ID.Loc, "extractvalue operand must be array or struct");
21152120 if (!ExtractValueInst::getIndexedType(Val->getType(), Indices.begin(),
21312136 ParseIndexList(Indices) ||
21322137 ParseToken(lltok::rparen, "expected ')' in insertvalue constantexpr"))
21332138 return true;
2139 if (Lex.getKind() == lltok::NamedOrCustomMD)
2140 if (ParseOptionalCustomMetadata()) return true;
21342141 if (!isa(Val0->getType()) && !isa(Val0->getType()))
21352142 return Error(ID.Loc, "extractvalue operand must be array or struct");
21362143 if (!ExtractValueInst::getIndexedType(Val0->getType(), Indices.begin(),
37363743 if (ParseTypeAndValue(Val, Loc, PFS) ||
37373744 ParseIndexList(Indices))
37383745 return true;
3746 if (Lex.getKind() == lltok::NamedOrCustomMD)
3747 if (ParseOptionalCustomMetadata()) return true;
37393748
37403749 if (!isa(Val->getType()) && !isa(Val->getType()))
37413750 return Error(Loc, "extractvalue operand must be array or struct");
37573766 ParseTypeAndValue(Val1, Loc1, PFS) ||
37583767 ParseIndexList(Indices))
37593768 return true;
3769 if (Lex.getKind() == lltok::NamedOrCustomMD)
3770 if (ParseOptionalCustomMetadata()) return true;
37603771
37613772 if (!isa(Val0->getType()) && !isa(Val0->getType()))
37623773 return Error(Loc0, "extractvalue operand must be array or struct");
0 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
1
2 !0 = metadata !{i32 42}
3
4 define <{i32, i32}> @f1() {
5 ; CHECK: !dbg !0
6 %r = insertvalue <{ i32, i32 }> zeroinitializer, i32 4, 1, !dbg !0
7 ; CHECK: !dbg !0
8 %e = extractvalue <{ i32, i32 }> %r, 0, !dbg !0
9 ret <{ i32, i32 }> %r
10 }