[PATCH] AsmParser: Save and restore parsing state for types so that types can be parsed correctly in a separate standalone parsing stage
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 21 12:28:51 PDT 2015
> On 2015-Aug-20, at 17:14, Alex L <arphaman at gmail.com> wrote:
>
> Hi,
>
> This patch extends the 'SlotMapping' and includes mappings for named and
> numbered types in it. The LLParser is extended accordingly to fill out those
> mappings at the end of module parsing.
>
> This information is useful when we want to parse standalone constant values
> at a later stage using the 'parseConstantValue' method. The constant values
> can be constant expressions, which can contain references to types. In order
> to parse such constant values, we have to restore the internal named and
> numbered mappings for the types in LLParser, otherwise the parser will report
> a parsing error. Therefore, this patch also introduces a new method called
> 'restoreParsingState' to LLParser, which uses the slot mappings to restore
> some of its internal parsing state.
>
> This patch is required to serialize constant value pointers in the machine
> memory operands for the MIR format.
>
> Cheers,
> Alex
> <0001-AsmParser-Save-and-restore-the-parsing-state-of-type.patch>
LGTM!
More information about the llvm-commits
mailing list