[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Lexer.l

Reid Spencer rspencer at reidspencer.com
Tue Oct 17 19:28:16 PDT 2006


Owen,

Some comments ..

On Tue, 2006-10-17 at 21:20 -0500, Owen Anderson wrote:
> 
> Changes in directory llvm/lib/AsmParser:
> 
> llvmAsmParser.y updated: 1.265 -> 1.266
> Lexer.l updated: 1.77 -> 1.78
> ---
> Log message:
> 
> Add support for the new "target data" information in .ll files.  This provides 
> a better encoding of the targets data layout, rather than trying to guess it
> from the endianness and pointersize like before.
> 
> 
> ---
> Diffs of the changes:  (+7 -0)
> 
>  Lexer.l         |    1 +
>  llvmAsmParser.y |    6 ++++++
>  2 files changed, 7 insertions(+)
> 
> 
> Index: llvm/lib/AsmParser/llvmAsmParser.y
> diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.265 llvm/lib/AsmParser/llvmAsmParser.y:1.266
> --- llvm/lib/AsmParser/llvmAsmParser.y:1.265	Sun Oct 15 18:26:46 2006
> +++ llvm/lib/AsmParser/llvmAsmParser.y	Tue Oct 17 21:19:55 2006
> @@ -1068,6 +1068,7 @@
>  %token DEPLIBS CALL TAIL ASM_TOK MODULE SIDEEFFECT
>  %token CC_TOK CCC_TOK CSRETCC_TOK FASTCC_TOK COLDCC_TOK
>  %token X86_STDCALLCC_TOK X86_FASTCALLCC_TOK
> +%token DATA

The word "Data" is somewhat bland. Since the method on Module is
"setDataLayout" can we make this "DataLayout" instead?  I'd like this to
be a bit more specific.

Chris: your thoughts?

>  %type <UIntVal> OptCallingConv
>  
>  // Basic Block Terminating Operators
> @@ -1873,6 +1874,11 @@
>      free($3);
>      CHECK_FOR_ERROR
>    };
> +  | DATA '=' STRINGCONSTANT {
> +    CurModule.CurrentModule->setDataLayout($3);
> +    free($3);
> +    CHECK_FOR_ERROR

I don't think you need a CHECK_FOR_ERROR here. Neither of the two
preceding calls will call GENERATE_ERROR.

> +  };
>  
>  LibrariesDefinition : '[' LibList ']';
>  
> 
> 
> Index: llvm/lib/AsmParser/Lexer.l
> diff -u llvm/lib/AsmParser/Lexer.l:1.77 llvm/lib/AsmParser/Lexer.l:1.78
> --- llvm/lib/AsmParser/Lexer.l:1.77	Sun Sep 17 15:25:45 2006
> +++ llvm/lib/AsmParser/Lexer.l	Tue Oct 17 21:19:55 2006
> @@ -210,6 +210,7 @@
>  deplibs         { return DEPLIBS; }
>  endian          { return ENDIAN; }
>  pointersize     { return POINTERSIZE; }
> +data          { return DATA; }

Same comment as above .. perhaps datalayout ?

>  little          { return LITTLE; }
>  big             { return BIG; }
>  volatile        { return VOLATILE; }
> 
> 
> 
> _______________________________________________
> 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