)]}'
{
  "commit": "85fdf501461e8ee00401f06ee6c7d21ac6622484",
  "tree": "b7433b5ccc1596daee74f0d17e6f132ee7af8520",
  "parents": [
    "bd768246da23ad141d3e9303cf43fd4363a6d4f4"
  ],
  "author": {
    "name": "Victor Campos",
    "email": "victor.campos@arm.com",
    "time": "Wed Jan 15 10:11:39 2025 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jan 15 10:11:39 2025 +0000"
  },
  "message": "[Multilib] Custom flags YAML parsing (#122903)\n\nThis patch is the first step to extend the current multilib system to\r\nsupport the selection of library variants which do not correspond to\r\nexisting command-line options.\r\n\r\nProposal can be found in\r\nhttps://discourse.llvm.org/t/rfc-multilib-custom-flags/81058\r\n\r\nThe multilib mechanism supports libraries that target code generation or\r\nlanguage options such as `--target`, `-mcpu`, `-mfpu`,\r\n`-mbranch-protection`. However, some library variants are particular to\r\nfeatures that do not correspond to any command-line options. Examples\r\ninclude variants for multithreading and semihosting.\r\n\r\nThis work introduces a way to instruct the multilib system to consider\r\nthese features in library selection. This particular patch comprises a\r\nnew section in `multilib.yaml` to declare flags for which no option\r\nexists. Henceforth this sort of flag will be called `custom flag` for\r\nclarity.\r\n\r\nThe `multilib.yaml` file will have a new section called Flags which\r\ncontains the declarations of the target’s custom flags:\r\n\r\n```yaml\r\nFlags:\r\n- Name: multithreaded\r\n  Values:\r\n  - Name: no-multithreaded\r\n    MacroDefines: [__SINGLE_THREAD__]\r\n  - Name: multithreaded\r\n  Default: no-multithreaded\r\n\r\n- Name: io\r\n  Values:\r\n    - Name: io-none\r\n    - Name: io-semihosting\r\n      MacroDefines: [SEMIHOSTING]\r\n    - Name: io-linux-syscalls\r\n      MacroDefines: [LINUX_SYSCALLS, HOSTED\u003d1]\r\n   Default: io-none\r\n```\r\n- Name: the name to categorize a flag.\r\n- Values: a list of possible values.\r\n- Default: it specifies which value this flag should take if not\r\nspecified in the command-line invocation. It must be one value from the\r\nValues field.\r\n\r\nEach flag Value follows this description:\r\n- Name (required): the name of the custom flag value (string). This is\r\nthe string to be used in `-fmultilib-flag\u003d\u003cstring\u003e`.\r\n- MacroDefines (optional): a list of strings to be used as macro\r\ndefinitions. Each string\r\n  is fed into the driver as ``-D\u003cstring\u003e``.\r\n\r\nA Default value is useful to save users from specifying custom flags\r\nthat have a most commonly used value.\r\n\r\nThe namespace of flag values is common across all flags. This means that\r\nflag values must be unique.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "dbed70f4f9008f001d8e2da0c048ffe4ac4f95ac",
      "old_mode": 33188,
      "old_path": "clang/include/clang/Driver/Multilib.h",
      "new_id": "0a533ed2804e250235c0c458669ea583ce37fbf0",
      "new_mode": 33188,
      "new_path": "clang/include/clang/Driver/Multilib.h"
    },
    {
      "type": "modify",
      "old_id": "0207e0f2eb2dedd97bc93fb60bc5b4a392f3c35d",
      "old_mode": 33188,
      "old_path": "clang/lib/Driver/Multilib.cpp",
      "new_id": "ccf747e90cb2ca8d104cd764fc1f3ebafb77ac2a",
      "new_mode": 33188,
      "new_path": "clang/lib/Driver/Multilib.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "fe6a9a8d7f1ee7e37e74254d5ecc6fb514d9fd7a",
      "new_mode": 33188,
      "new_path": "clang/test/Driver/baremetal-multilib-custom-flags-parsing.yaml"
    }
  ]
}
