mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 07:09:08 +00:00
Parse PHI instruction with attached metadata.
llvm-svn: 84264
This commit is contained in:
parent
5920acc861
commit
a4ac3dd8bc
@ -3315,6 +3315,9 @@ bool LLParser::ParsePHI(Instruction *&Inst, PerFunctionState &PFS) {
|
||||
if (!EatIfPresent(lltok::comma))
|
||||
break;
|
||||
|
||||
if (Lex.getKind() == lltok::NamedOrCustomMD)
|
||||
break;
|
||||
|
||||
if (ParseToken(lltok::lsquare, "expected '[' in phi value list") ||
|
||||
ParseValue(Ty, Op0, PFS) ||
|
||||
ParseToken(lltok::comma, "expected ',' after insertelement value") ||
|
||||
@ -3323,6 +3326,9 @@ bool LLParser::ParsePHI(Instruction *&Inst, PerFunctionState &PFS) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Lex.getKind() == lltok::NamedOrCustomMD)
|
||||
if (ParseOptionalCustomMetadata()) return true;
|
||||
|
||||
if (!Ty->isFirstClassType())
|
||||
return Error(TypeLoc, "phi node must have first class type");
|
||||
|
||||
|
13
test/DebugInfo/2009-11-16-Phi.ll
Normal file
13
test/DebugInfo/2009-11-16-Phi.ll
Normal file
@ -0,0 +1,13 @@
|
||||
; RUN: llvm-as %s -disable-output
|
||||
|
||||
define i32 @foo() {
|
||||
E:
|
||||
br label %B2
|
||||
B1:
|
||||
br label %B2
|
||||
B2:
|
||||
%0 = phi i32 [ 0, %E ], [ 1, %B1 ], !dbg !0
|
||||
ret i32 %0
|
||||
}
|
||||
|
||||
!0 = metadata !{i32 42}
|
Loading…
Reference in New Issue
Block a user