[llvm-commits] [llvm] r92793 - in /llvm/trunk: lib/AsmParser/LLParser.cpp lib/AsmParser/LLParser.h test/Assembler/functionlocal-metadata.ll

Chris Lattner clattner at apple.com
Fri Jan 8 10:11:40 PST 2010


On Jan 5, 2010, at 2:22 PM, Victor Hernandez wrote:

> Author: hernande
> Date: Tue Jan  5 16:22:14 2010
> New Revision: 92793
>
> URL: http://llvm.org/viewvc/llvm-project?rev=92793&view=rev
> Log:
> Re-add parsing of function-local metadata; this time with testcase.

Ok,

> @@ -1885,7 +1885,7 @@
> /// type implied.  For example, if we parse "4" we don't know what  
> integer type
> /// it has.  The value will later be combined with its type and  
> checked for
> /// sanity.
> -bool LLParser::ParseValID(ValID &ID) {
> +bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {

Please document the new argument, explicitly mentioning that it can be  
null and why.

>
> /// ConvertGlobalOrMetadataValIDToValue - Apply a type to a ValID to  
> get a fully
> -/// resolved constant or metadata value.
> +/// resolved constant, metadata, or function-local value

Likewise.  Also, end your sentence with a period.

> @@ -2458,6 +2459,12 @@
>       return Error(ID.Loc, "metadata value must have metadata type");
>     V = ID.MDStringVal;
>     return false;
> +  case ValID::t_LocalID:
> +  case ValID::t_LocalName:
> +    if (!PFS)
> +      return Error(ID.Loc, "invalid use of function-local name");
> +    if (ConvertValIDToValue(Ty, ID, V, *PFS)) return true;
> +    return false;

With this change, there is no difference between  
ConvertGlobalValIDToValue, ConvertGlobalOrMetadataValIDToValue, and  
ConvertValIDToValue, except for inline asm.  Can they all be merged  
into one function now and use the PFS pointer to distinguish the  
function-local vs global case?

-Chris




More information about the llvm-commits mailing list