[llvm-commits] [llvm] r132466 - /llvm/trunk/lib/MC/MCParser/AsmParser.cpp

Jim Grosbach grosbach at apple.com
Thu Jun 2 10:21:08 PDT 2011


Hi Rafael,

I think this does the right thing for parsing register names vs. numbers in .cfi directives for the asm parser. Seem right to you?

-Jim

On Jun 2, 2011, at 10:14 AM, Jim Grosbach wrote:

> Author: grosbach
> Date: Thu Jun  2 12:14:04 2011
> New Revision: 132466
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=132466&view=rev
> Log:
> .cfi directive register parsing flexibility.
> 
> Parsing a register name/number for .cfi directives can't assume that a
> register name starts with a '%' token. Be more flexible and check for a
> register number instead. Still unlikely to be perfect, but it allows us
> to parse both plain identifiers as register names and integers as register
> numbers, which is what we're wanting to support at this point.
> 
> 
> Modified:
>    llvm/trunk/lib/MC/MCParser/AsmParser.cpp
> 
> Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=132466&r1=132465&r2=132466&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
> +++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Thu Jun  2 12:14:04 2011
> @@ -2330,7 +2330,7 @@
>                                                      SMLoc DirectiveLoc) {
>   unsigned RegNo;
> 
> -  if (getLexer().is(AsmToken::Percent)) {
> +  if (getLexer().isNot(AsmToken::Integer)) {
>     if (getParser().getTargetParser().ParseRegister(RegNo, DirectiveLoc,
>       DirectiveLoc))
>       return true;
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list