diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-07-22 07:11:21 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-07-22 07:11:21 +0000 |
commit | 102e1b6a4753b0bd3662ad1bd119f6efa04b8763 (patch) | |
tree | ca8f1756219f5e96da9e61989530af9d12b6ae96 /lib/Parse/ParseStmt.cpp | |
parent | fa38c81b67426e1363b58b86d702caa91a0c2ddb (diff) |
Fix PR7673 by allowing an empty clobbers section in an ASM statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index c908ed9cae..baf8488e74 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -1367,17 +1367,19 @@ Parser::OwningStmtResult Parser::ParseAsmStatement(bool &msAsm) { if (!AteExtraColon) ConsumeToken(); - // Parse the asm-string list for clobbers. - while (1) { - OwningExprResult Clobber(ParseAsmStringLiteral()); + // Parse the asm-string list for clobbers if present. + if (Tok.isNot(tok::r_paren)) { + while (1) { + OwningExprResult Clobber(ParseAsmStringLiteral()); - if (Clobber.isInvalid()) - break; + if (Clobber.isInvalid()) + break; - Clobbers.push_back(Clobber.release()); + Clobbers.push_back(Clobber.release()); - if (Tok.isNot(tok::comma)) break; - ConsumeToken(); + if (Tok.isNot(tok::comma)) break; + ConsumeToken(); + } } } |