This is an archive of the discontinued LLVM Phabricator instance.

AsmParser: Add a function to parse a standalone type and value
ClosedPublic

Authored by arphaman on Jun 5 2015, 11:29 AM.

Details

Summary

This patch extends the interface provided by the AsmParser library by adding a function that allows the user to parse a standalone type and value in a given string.

This change would be useful for the MachineIR serialization, as it would allow the MIR parser to parse the constant values in a MachineConstantPool.
This is an example of a MIR fragment that shows several constant pool entries in a machine function:

constants:
  - value:           'double 3.250000e+00'
  - value:           'float 6.250000e+00'
    alignment:       4

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 27212.Jun 5 2015, 11:29 AM
arphaman retitled this revision from to AsmParser: Add a function to parse a standalone type and value.
arphaman updated this object.
arphaman edited the test plan for this revision. (Show Details)
arphaman added reviewers: dexonsmith, bogner, bob.wilson.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: Unknown Object (MLST).
arphaman updated this revision to Diff 27233.Jun 5 2015, 2:38 PM

I've updated the patch based on Duncan's comments.

The updated patch now rejects non constant values.

arphaman updated this revision to Diff 28829.Jun 30 2015, 4:45 PM

Rebased this patch on top of trunk and made the public method 'parseStandaloneConstantValue' consistent with the other methods.

arphaman updated this revision to Diff 29967.Jul 16 2015, 5:10 PM

I added a test case for the block address constant value as requested by Duncan.

This revision was automatically updated to reflect the committed changes.