llvm/llvm/lib/CodeGen/MIRParser/MILexer.cpp

//===- MILexer.cpp - Machine instructions lexer implementation ------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements the lexing of machine instructions.
//
//===----------------------------------------------------------------------===//

#include "MILexer.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include <cassert>
#include <cctype>
#include <string>

usingnamespacellvm;

namespace {

ErrorCallbackType;

/// This class provides a way to iterate and get characters from the source
/// string.
class Cursor {};

} // end anonymous namespace

MIToken &MIToken::reset(TokenKind Kind, StringRef Range) {}

MIToken &MIToken::setStringValue(StringRef StrVal) {}

MIToken &MIToken::setOwnedStringValue(std::string StrVal) {}

MIToken &MIToken::setIntegerValue(APSInt IntVal) {}

/// Skip the leading whitespace characters and return the updated cursor.
static Cursor skipWhitespace(Cursor C) {}

static bool isNewlineChar(char C) {}

/// Skip a line comment and return the updated cursor.
static Cursor skipComment(Cursor C) {}

/// Machine operands can have comments, enclosed between /* and */.
/// This eats up all tokens, including /* and */.
static Cursor skipMachineOperandComment(Cursor C) {}

/// Return true if the given character satisfies the following regular
/// expression: [-a-zA-Z$._0-9]
static bool isIdentifierChar(char C) {}

/// Unescapes the given string value.
///
/// Expects the string value to be quoted.
static std::string unescapeQuotedString(StringRef Value) {}

/// Lex a string constant using the following regular expression: \"[^\"]*\"
static Cursor lexStringConstant(Cursor C, ErrorCallbackType ErrorCallback) {}

static Cursor lexName(Cursor C, MIToken &Token, MIToken::TokenKind Type,
                      unsigned PrefixLength, ErrorCallbackType ErrorCallback) {}

static MIToken::TokenKind getIdentifierKind(StringRef Identifier) {}

static Cursor maybeLexIdentifier(Cursor C, MIToken &Token) {}

static Cursor maybeLexMachineBasicBlock(Cursor C, MIToken &Token,
                                        ErrorCallbackType ErrorCallback) {}

static Cursor maybeLexIndex(Cursor C, MIToken &Token, StringRef Rule,
                            MIToken::TokenKind Kind) {}

static Cursor maybeLexIndexAndName(Cursor C, MIToken &Token, StringRef Rule,
                                   MIToken::TokenKind Kind) {}

static Cursor maybeLexJumpTableIndex(Cursor C, MIToken &Token) {}

static Cursor maybeLexStackObject(Cursor C, MIToken &Token) {}

static Cursor maybeLexFixedStackObject(Cursor C, MIToken &Token) {}

static Cursor maybeLexConstantPoolItem(Cursor C, MIToken &Token) {}

static Cursor maybeLexSubRegisterIndex(Cursor C, MIToken &Token,
                                       ErrorCallbackType ErrorCallback) {}

static Cursor maybeLexIRBlock(Cursor C, MIToken &Token,
                              ErrorCallbackType ErrorCallback) {}

static Cursor maybeLexIRValue(Cursor C, MIToken &Token,
                              ErrorCallbackType ErrorCallback) {}

static Cursor maybeLexStringConstant(Cursor C, MIToken &Token,
                                     ErrorCallbackType ErrorCallback) {}

static Cursor lexVirtualRegister(Cursor C, MIToken &Token) {}

/// Returns true for a character allowed in a register name.
static bool isRegisterChar(char C) {}

static Cursor lexNamedVirtualRegister(Cursor C, MIToken &Token) {}

static Cursor maybeLexRegister(Cursor C, MIToken &Token,
                               ErrorCallbackType ErrorCallback) {}

static Cursor maybeLexGlobalValue(Cursor C, MIToken &Token,
                                  ErrorCallbackType ErrorCallback) {}

static Cursor maybeLexExternalSymbol(Cursor C, MIToken &Token,
                                     ErrorCallbackType ErrorCallback) {}

static Cursor maybeLexMCSymbol(Cursor C, MIToken &Token,
                               ErrorCallbackType ErrorCallback) {}

static bool isValidHexFloatingPointPrefix(char C) {}

static Cursor lexFloatingPointLiteral(Cursor Range, Cursor C, MIToken &Token) {}

static Cursor maybeLexHexadecimalLiteral(Cursor C, MIToken &Token) {}

static Cursor maybeLexNumericalLiteral(Cursor C, MIToken &Token) {}

static MIToken::TokenKind getMetadataKeywordKind(StringRef Identifier) {}

static Cursor maybeLexExclaim(Cursor C, MIToken &Token,
                              ErrorCallbackType ErrorCallback) {}

static MIToken::TokenKind symbolToken(char C) {}

static Cursor maybeLexSymbol(Cursor C, MIToken &Token) {}

static Cursor maybeLexNewline(Cursor C, MIToken &Token) {}

static Cursor maybeLexEscapedIRValue(Cursor C, MIToken &Token,
                                     ErrorCallbackType ErrorCallback) {}

StringRef llvm::lexMIToken(StringRef Source, MIToken &Token,
                           ErrorCallbackType ErrorCallback) {}