search for: gettok

Displaying 6 results from an estimated 6 matches for "gettok".

2010 Jun 21
2
[LLVMdev] MC: Object file specific parsing
...rgetDirective(AsmToken DirectiveID); }; /// ARMOperand - Instances of this class represent a parsed ARM machine @@ -270,7 +262,7 @@ public: bool ARMAsmParser::MaybeParseRegister (OwningPtr<ARMOperand> &Op, bool ParseWriteBack) { SMLoc S, E; - const AsmToken &Tok = Parser.getTok(); + const AsmToken &Tok = getTok(); assert(Tok.is(AsmToken::Identifier) && "Token is not an Identifier"); // FIXME: Validate register for the current architecture; we have to do @@ -283,17 +275,17 @@ bool ARMAsmParser::MaybeParseRegister S = Tok.getLoc();...
2018 Sep 28
3
error: expected memory with 32-bit signed offset
...x           $2,0($3,$4)                                           ^ test/MC/Mips/loongson3a/valid.s:32:32: error: unexpected token in argument list         gslbx           $2,0($3,$4)                                           ^ So I just changed  MipsAsmParser::parseMemOffset :    if (Parser.getTok().isNot(AsmToken::RParen)) { -    Error(Parser.getTok().getLoc(), "')' expected"); -    return MatchOperand_ParseFail; +    if (hasLoongson3A()) { +      if (Parser.getTok().isNot(AsmToken::Comma)) { +        Error(Parser.getTok().getLoc(), "',' expected"); +   ...
2015 Nov 26
2
Accessing TableGen defined variable in the cpp code
...TableGen: *bits<4> bitpattern = 0;* *let Inst{10-7} = bitpattern;* Then, at the moment that I am parsing the instruction, I would like to assign a value to "bitpattern" variable! for example: ->ParseInstruction(...) if (Mnemonic == "X") Mnemonic = getLexer().getTok().getString(); if (Mnemonic == "Y") *** let bitpattern = 0b1010" ** // How can I do this?* How can I do this? Is it possible? Cheers, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attach...
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...e // of these for known things. enum Token { tok_eof = -1, // commands tok_def = -2, tok_extern = -3, // primary tok_identifier = -4, tok_number = -5, }; static std::string IdentifierStr; // Filled in if tok_identifier static double NumVal; // Filled in if tok_number /// gettok - Return the next token from standard input. static int gettok() { static int LastChar = ' '; // Skip any whitespace. while (isspace(LastChar)) LastChar = getchar(); if (isalpha(LastChar)) { // identifier: [a-zA-Z][a-zA-Z0-9]* IdentifierStr = LastChar; while (isalnum((...
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...of = -1, > > // commands > tok_def = -2, tok_extern = -3, > > // primary > tok_identifier = -4, tok_number = -5, > }; > > static std::string IdentifierStr; // Filled in if tok_identifier > static double NumVal; // Filled in if tok_number > > /// gettok - Return the next token from standard input. > static int gettok() { > static int LastChar = ' '; > > // Skip any whitespace. > while (isspace(LastChar)) > LastChar = getchar(); > > if (isalpha(LastChar)) { // identifier: [a-zA-Z][a-zA-Z0-9]* > Identifie...
2010 Feb 17
1
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
... tok_def = -2, tok_extern = -3, >> >>  // primary >>  tok_identifier = -4, tok_number = -5, >> }; >> >> static std::string IdentifierStr;  // Filled in if tok_identifier >> static double NumVal;              // Filled in if tok_number >> >> /// gettok - Return the next token from standard input. >> static int gettok() { >>  static int LastChar = ' '; >> >>  // Skip any whitespace. >>  while (isspace(LastChar)) >>    LastChar = getchar(); >> >>  if (isalpha(LastChar)) { // identifier: [a-zA-...