[llvm-commits] [llvm] r90497 - in /llvm/trunk/lib/AsmParser: LLParser.cpp LLParser.h

Chris Lattner clattner at apple.com
Tue Dec 29 18:20:07 PST 2009


On Dec 3, 2009, at 3:40 PM, Victor Hernandez wrote:

> Author: hernande
> Date: Thu Dec  3 17:40:58 2009
> New Revision: 90497
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=90497&view=rev
> Log:
> Add ParseInlineMetadata() which can parses metadata that refers to an instruction.  Extend ParseParameterList() to use this new function so that calls to llvm.dbg.declare can pass inline metadata

Hi Victor,

There are several problems with this:

> +/// ParseInlineMetadata:
> +///   !{type %instr}
> +///   !{...} MDNode
> +///   !"foo" MDString
> +bool LLParser::ParseInlineMetadata(Value *&V, PerFunctionState &PFS) {
> +  assert(Lex.getKind() == lltok::Metadata && "Only for Metadata");
> +  V = 0;

This duplicates a lot of logic from other places.

> +  // Standalone metadata reference
> +  // !{ ..., !42, ... }
> +  if (!ParseMDNode((MetadataBase *&)V))
> +    return false;

This can't work.  If the thing is not an mdnode, an error will be emitted.  You can't continue after the error.

There is no testcase for this patch and no extension to the langref documentation.  I assume that this isn't used, because everything passes without it.  I'm removing the code for the time being to make way for other cleanups.

-Chris



More information about the llvm-commits mailing list