Permalink
Browse files

bpf: Add BPF AsmParser support in LLVM

Reviewed-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313055 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information...
yonghong-song committed Sep 12, 2017
1 parent a0e0fb7 commit a6b7d22c2e64f44e6c74ad7e5ce5670f5ae72da3
@@ -266,6 +266,8 @@ class MCTargetAsmParser : public MCAsmParserExtension {
virtual bool equalIsAsmAssignment() { return true; };
// Return whether this start of statement identifier is a label
virtual bool isLabel(AsmToken &Token) { return true; };
// Return whether this parser accept star as start of statement
virtual bool starIsStartOfStatement() { return false; };
virtual const MCExpr *applyModifierToExpr(const MCExpr *E,
MCSymbolRefExpr::VariantKind,
@@ -1687,6 +1687,11 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
// Treat '}' as a valid identifier in this context.
Lex();
IDVal = "}";
} else if (Lexer.is(AsmToken::Star) &&
getTargetParser().starIsStartOfStatement()) {
// Accept '*' as a valid start of statement.
Lex();
IDVal = "*";
} else if (parseIdentifier(IDVal)) {
if (!TheCondState.Ignore) {
Lex(); // always eat a token
Oops, something went wrong.

0 comments on commit a6b7d22

Please sign in to comment.