[llvm-commits] patch: refactor the asmparser a little

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Sat Jun 4 07:53:00 PDT 2011


On 11-06-02 8:18 PM, Nick Lewycky wrote:
> The attached patch refactors the asm parsers' parsing of strings into a
> ReadString method and parsing of LocalVarName or GlobalVarName into
> ReadName(). No functionality change intended.
>
> I'm asking for review because the parser doesn't already have helper
> functions like these, and I wanted to check whether the error-reporting
> style (inconsistent between the two) is okay to commit or if anyone has
> suggestions.

I am not familiar with this code, but the patch looks reasonable. The 
inconsistency is probably OK, since the functions have different uses.

If you want to be a bit more consistent, you could do:

lltok::Kind kind;
if (ReadString(lltok::StringConstant, &kind))
   return kind;

> Nick

Cheers,
Rafael



More information about the llvm-commits mailing list