| OLD | NEW |
| 1 //===- AsmParser.cpp - Parser for Assembly Files --------------------------===// | 1 //===- AsmParser.cpp - Parser for Assembly Files --------------------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This class implements the parser for assembly files. | 10 // This class implements the parser for assembly files. |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 | 1085 |
| 1086 // Eat the next primary expression. | 1086 // Eat the next primary expression. |
| 1087 const MCExpr *RHS; | 1087 const MCExpr *RHS; |
| 1088 if (ParsePrimaryExpr(RHS, EndLoc)) return true; | 1088 if (ParsePrimaryExpr(RHS, EndLoc)) return true; |
| 1089 | 1089 |
| 1090 // If BinOp binds less tightly with RHS than the operator after RHS, let | 1090 // If BinOp binds less tightly with RHS than the operator after RHS, let |
| 1091 // the pending operator take RHS as its LHS. | 1091 // the pending operator take RHS as its LHS. |
| 1092 MCBinaryExpr::Opcode Dummy; | 1092 MCBinaryExpr::Opcode Dummy; |
| 1093 unsigned NextTokPrec = getBinOpPrecedence(Lexer.getKind(), Dummy); | 1093 unsigned NextTokPrec = getBinOpPrecedence(Lexer.getKind(), Dummy); |
| 1094 if (TokPrec < NextTokPrec) { | 1094 if (TokPrec < NextTokPrec) { |
| 1095 if (ParseBinOpRHS(TokPrec+1, RHS, EndLoc)) return true; | 1095 if (ParseBinOpRHS(Precedence+1, RHS, EndLoc)) return true; |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 // Merge LHS and RHS according to operator. | 1098 // Merge LHS and RHS according to operator. |
| 1099 Res = MCBinaryExpr::Create(Kind, Res, RHS, getContext()); | 1099 Res = MCBinaryExpr::Create(Kind, Res, RHS, getContext()); |
| 1100 } | 1100 } |
| 1101 } | 1101 } |
| 1102 | 1102 |
| 1103 /// ParseStatement: | 1103 /// ParseStatement: |
| 1104 /// ::= EndOfStatement | 1104 /// ::= EndOfStatement |
| 1105 /// ::= Label* Directive ...Operands... EndOfStatement | 1105 /// ::= Label* Directive ...Operands... EndOfStatement |
| (...skipping 3146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4252 AsmString = OS.str(); | 4252 AsmString = OS.str(); |
| 4253 return false; | 4253 return false; |
| 4254 } | 4254 } |
| 4255 | 4255 |
| 4256 /// \brief Create an MCAsmParser instance. | 4256 /// \brief Create an MCAsmParser instance. |
| 4257 MCAsmParser *llvm::createMCAsmParser(SourceMgr &SM, | 4257 MCAsmParser *llvm::createMCAsmParser(SourceMgr &SM, |
| 4258 MCContext &C, MCStreamer &Out, | 4258 MCContext &C, MCStreamer &Out, |
| 4259 const MCAsmInfo &MAI) { | 4259 const MCAsmInfo &MAI) { |
| 4260 return new AsmParser(SM, C, Out, MAI); | 4260 return new AsmParser(SM, C, Out, MAI); |
| 4261 } | 4261 } |
| OLD | NEW |