+
+/// ParseDirectiveOrg
+/// ::= .org expression [ , expression ]
+bool AsmParser::ParseDirectiveOrg() {
+ int64_t Offset;
+ if (ParseExpression(Offset))
+ return true;
+
+ // Parse optional fill expression.
+ int64_t FillExpr = 0;
+ if (Lexer.isNot(asmtok::EndOfStatement)) {
+ if (Lexer.isNot(asmtok::Comma))
+ return TokError("unexpected token in '.org' directive");
+ Lexer.Lex();
+
+ if (ParseExpression(FillExpr))
+ return true;
+
+ if (Lexer.isNot(asmtok::EndOfStatement))
+ return TokError("unexpected token in '.org' directive");
+ }
+
+ Lexer.Lex();
+
+ Out.EmitValueToOffset(MCValue::get(Offset), FillExpr);
+
+ return false;
+}