[PATCH] D150370: Introduce StructuredData

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 04:52:28 PDT 2023


nhaehnle marked an inline comment as done.
nhaehnle added inline comments.


================
Comment at: llvm/docs/LangRef.rst:3519-3523
+    sdata       ::= '{' (sdata_field ',')* sdata_field? '}'
+    sdata_field ::= label sdata_value
+    sdata_value ::= 'type' type
+                ::= integer
+                ::= 'true' | 'false'
----------------
Flakebi wrote:
> nhaehnle wrote:
> > Flakebi wrote:
> > > Can constants follow the way metadata (and most other things in LLVM) is encoded and prefix the type?
> > > I.e. `i32 <integer>` and `i1 true/false`
> > Good question. I've been going back and forth on this, and the current version is as-is mostly because the various !DIxyz metadata doesn't have those prefixes. But that may not be the best example to follow.
> > 
> > I'd be happy to change it to be more in line with metadata. Any other opinions?
> > But that may not be the best example to follow.
> 
> I once tried to write a parser for !DI metadata (tree-sitter, for syntax highlighting) and gave up because there were more and more edge-cases, so I’d be happy to see a more structured format ;)
I'm going ahead and changing it to have the `iN` prefix. As a reasonable (I believe) consequence, the bit width is now actually part of the value, so if a user wants to distinguish between `i7 0` and `i9 0`, they can.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150370/new/

https://reviews.llvm.org/D150370



More information about the llvm-commits mailing list