<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/95222>95222</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang] Follow-up on #embed implementation
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang,
            c23,
            clang:frontend
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Fznamznon
      </td>
    </tr>
</table>

<pre>
    I merged https://github.com/llvm/llvm-project/pull/68620 this morning. However there are several places to improve the implementation. This issue is to track them as well as for further discussion on the matter.
To be done:

- [ ] Look close into serialization code for `EmbedExpr`. Right now the storage will be duplicated if two `EmbedExpr` referencing same data are serialized. Context https://github.com/llvm/llvm-project/pull/68620#discussion_r1625299848
- [ ] Transform `tok::annot_embed` into a bunch of tokens and inject them back into stream. We might need a new kind of token that directly hold a numerical value. Context https://github.com/llvm/llvm-project/pull/68620#pullrequestreview-2085206518
- [ ] Solve the issue that we're copying the data if a file is page-sized. Ideas https://github.com/llvm/llvm-project/pull/68620#issuecomment-2111257692 .
- [ ] Maybe look more into performance of general case. Current performance diff between "fast" and "slow" case available here https://github.com/llvm/llvm-project/pull/68620#issuecomment-2122564803 .

To be discussed

- [ ] Decide how to handle -d<letter>, -E options 
- [ ] if _has_include/__has_embed/__has_c_attribute may appear in the limit parameter argument. Right now accepted, we may need to diagnose that.
- [ ] What the default preprocessed output format should be, what options to provide to modify it.
- [ ] Decide how to spell base64-input.

Please feel free to edit this if I got something wrong.

CC @AaronBallman @jyknight @cor3ntin @jakubjelinek 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVU2P2zYQ_TX0ZWBDoj5WPviw2V2jAVqgaAPkuBiJI4kxxVFJyorz6wtS2aa76aVILrZGpObjzXsz6L0eLNFJVO9E9bjDJYzsTucvFqcvlu2uZXU7vYeJ3EAKxhBmL4p7Ic9Cngcdxq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