The ledger languages the declarations cover. The model reads C-family * conventions only; a declared language it does not support is reported by * the model itself and keeps it from being complete. */
| 243 | * conventions only; a declared language it does not support is reported by |
| 244 | * the model itself and keeps it from being complete. */ |
| 245 | static void reg_languages(const cbm_test_declarations_t *declarations, bool *wanted) { |
| 246 | static const struct { |
| 247 | const char *name; |
| 248 | CBMLanguage language; |
| 249 | } NAMES[] = {{"c", CBM_LANG_C}, {"C", CBM_LANG_C}, {"cpp", CBM_LANG_CPP}, |
| 250 | {"c++", CBM_LANG_CPP}, {"C++", CBM_LANG_CPP}, {"cuda", CBM_LANG_CUDA}, |
| 251 | {"CUDA", CBM_LANG_CUDA}}; |
| 252 | bool c_cbm = false; |
| 253 | if (cbm_test_declarations_preset(declarations, CBM_TEST_PRESET_C_CBM, &c_cbm) && c_cbm) { |
| 254 | wanted[CBM_LANG_C] = true; |
| 255 | } |
| 256 | int count = 0; |
| 257 | const cbm_test_declaration_t *items = cbm_test_declarations_items(declarations, &count); |
| 258 | for (int i = 0; i < count; i++) { |
| 259 | for (size_t j = 0; items[i].language && j < sizeof(NAMES) / sizeof(NAMES[0]); j++) { |
| 260 | if (strcmp(items[i].language, NAMES[j].name) == 0) { |
| 261 | wanted[NAMES[j].language] = true; |
| 262 | } |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | /* The full verified blob of one ledger file into the model. */ |
| 268 | static bool reg_add(cni_context *c, cni_reader *reader, cls_budget_t *budget, |
no test coverage detected