[llvm] [Xtensa] Implement base CallConvention. (PR #83280)
    Matt Arsenault via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Mar 21 02:22:15 PDT 2024
    
    
  
================
@@ -686,6 +763,57 @@ bool XtensaAsmParser::ParseInstruction(ParseInstructionInfo &Info,
   return false;
 }
 
+bool XtensaAsmParser::parseLiteralDirective(SMLoc L) {
+  MCAsmParser &Parser = getParser();
+  const MCExpr *Value;
+  SMLoc LiteralLoc = getLexer().getLoc();
+  XtensaTargetStreamer &TS = this->getTargetStreamer();
+
+  if (Parser.parseExpression(Value))
+    return true;
+
+  const MCSymbolRefExpr *SE = dyn_cast<MCSymbolRefExpr>(Value);
+
+  if (!SE)
+    return Error(LiteralLoc, "literal label must be a symbol");
+
+  if (Parser.parseToken(AsmToken::Comma, "expected comma"))
+    return true;
+
+  SMLoc OpcodeLoc = getLexer().getLoc();
+  if (parseOptionalToken(AsmToken::EndOfStatement))
+    return Error(OpcodeLoc, "expected value");
----------------
arsenm wrote:
I don't believe these error conditions are tested 
https://github.com/llvm/llvm-project/pull/83280
    
    
More information about the llvm-commits
mailing list