@@ -333,7 +333,9 @@ static void getLibStdCxxFileMapping(
333
333
334
334
auto contents = (*buf)->getBuffer ();
335
335
auto headerInjectionPoint = contents.find (" /// additional headers" );
336
- if (headerInjectionPoint == StringRef::npos) {
336
+ auto bitsInjectionPoint = contents.find (" /// additional bits" );
337
+ if (headerInjectionPoint == StringRef::npos ||
338
+ bitsInjectionPoint == StringRef::npos) {
337
339
fileMapping.redirectedFiles .push_back (
338
340
{std::string (injectedModuleMapPath), std::string (actualModuleMapPath)});
339
341
return ;
@@ -357,7 +359,124 @@ static void getLibStdCxxFileMapping(
357
359
};
358
360
for (StringRef additionalFile : additionalFiles)
359
361
includeHeaderInModuleMap (additionalFile);
360
- os << contents.substr (headerInjectionPoint);
362
+ os << contents.substr (headerInjectionPoint,
363
+ bitsInjectionPoint - headerInjectionPoint);
364
+
365
+ StringRef additionalBits[] = {" bits/algorithmfwd.h" ,
366
+ " bits/align.h" ,
367
+ " bits/alloc_traits.h" ,
368
+ " bits/allocated_ptr.h" ,
369
+ " bits/allocator.h" ,
370
+ " bits/atomic_base.h" ,
371
+ " bits/atomic_futex.h" ,
372
+ " bits/atomic_lockfree_defines.h" ,
373
+ " bits/basic_ios.h" ,
374
+ " bits/basic_string.h" ,
375
+ " bits/c++0x_warning.h" ,
376
+ " bits/char_traits.h" ,
377
+ " bits/charconv.h" ,
378
+ " bits/codecvt.h" ,
379
+ " bits/concept_check.h" ,
380
+ " bits/cpp_type_traits.h" ,
381
+ " bits/cxxabi_forced.h" ,
382
+ " bits/cxxabi_init_exception.h" ,
383
+ " bits/enable_special_members.h" ,
384
+ " bits/erase_if.h" ,
385
+ " bits/exception.h" ,
386
+ " bits/exception_defines.h" ,
387
+ " bits/exception_ptr.h" ,
388
+ " bits/forward_list.h" ,
389
+ " bits/fs_dir.h" ,
390
+ " bits/fs_fwd.h" ,
391
+ " bits/fs_ops.h" ,
392
+ " bits/fs_path.h" ,
393
+ " bits/functexcept.h" ,
394
+ " bits/functional_hash.h" ,
395
+ " bits/gslice.h" ,
396
+ " bits/gslice_array.h" ,
397
+ " bits/hash_bytes.h" ,
398
+ " bits/hashtable.h" ,
399
+ " bits/hashtable_policy.h" ,
400
+ " bits/indirect_array.h" ,
401
+ " bits/invoke.h" ,
402
+ " bits/ios_base.h" ,
403
+ " bits/iterator_concepts.h" ,
404
+ " bits/locale_classes.h" ,
405
+ " bits/locale_conv.h" ,
406
+ " bits/locale_facets.h" ,
407
+ " bits/locale_facets_nonio.h" ,
408
+ " bits/localefwd.h" ,
409
+ " bits/mask_array.h" ,
410
+ " bits/max_size_type.h" ,
411
+ " bits/memoryfwd.h" ,
412
+ " bits/move.h" ,
413
+ " bits/nested_exception.h" ,
414
+ " bits/node_handle.h" ,
415
+ " bits/ostream_insert.h" ,
416
+ " bits/parse_numbers.h" ,
417
+ " bits/postypes.h" ,
418
+ " bits/predefined_ops.h" ,
419
+ " bits/ptr_traits.h" ,
420
+ " bits/quoted_string.h" ,
421
+ " bits/random.h" ,
422
+ " bits/range_access.h" ,
423
+ " bits/ranges_algo.h" ,
424
+ " bits/ranges_algobase.h" ,
425
+ " bits/ranges_base.h" ,
426
+ " bits/ranges_cmp.h" ,
427
+ " bits/ranges_uninitialized.h" ,
428
+ " bits/ranges_util.h" ,
429
+ " bits/refwrap.h" ,
430
+ " bits/shared_ptr.h" ,
431
+ " bits/shared_ptr_atomic.h" ,
432
+ " bits/shared_ptr_base.h" ,
433
+ " bits/slice_array.h" ,
434
+ " bits/std_abs.h" ,
435
+ " bits/std_function.h" ,
436
+ " bits/std_mutex.h" ,
437
+ " bits/std_thread.h" ,
438
+ " bits/stl_algo.h" ,
439
+ " bits/stl_algobase.h" ,
440
+ " bits/stl_bvector.h" ,
441
+ " bits/stl_construct.h" ,
442
+ " bits/stl_deque.h" ,
443
+ " bits/stl_function.h" ,
444
+ " bits/stl_heap.h" ,
445
+ " bits/stl_iterator.h" ,
446
+ " bits/stl_iterator_base_funcs.h" ,
447
+ " bits/stl_iterator_base_types.h" ,
448
+ " bits/stl_list.h" ,
449
+ " bits/stl_map.h" ,
450
+ " bits/stl_multimap.h" ,
451
+ " bits/stl_multiset.h" ,
452
+ " bits/stl_numeric.h" ,
453
+ " bits/stl_pair.h" ,
454
+ " bits/stl_queue.h" ,
455
+ " bits/stl_raw_storage_iter.h" ,
456
+ " bits/stl_relops.h" ,
457
+ " bits/stl_set.h" ,
458
+ " bits/stl_stack.h" ,
459
+ " bits/stl_tempbuf.h" ,
460
+ " bits/stl_tree.h" ,
461
+ " bits/stl_uninitialized.h" ,
462
+ " bits/stl_vector.h" ,
463
+ " bits/stream_iterator.h" ,
464
+ " bits/streambuf_iterator.h" ,
465
+ " bits/stringfwd.h" ,
466
+ " bits/this_thread_sleep.h" ,
467
+ " bits/uniform_int_dist.h" ,
468
+ " bits/unique_lock.h" ,
469
+ " bits/unique_ptr.h" ,
470
+ " bits/unordered_map.h" ,
471
+ " bits/unordered_set.h" ,
472
+ " bits/uses_allocator.h" ,
473
+ " bits/uses_allocator_args.h" ,
474
+ " bits/valarray_after.h" ,
475
+ " bits/valarray_array.h" ,
476
+ " bits/valarray_before.h" };
477
+ for (StringRef additionalFile : additionalBits)
478
+ includeHeaderInModuleMap (additionalFile);
479
+ os << contents.substr (bitsInjectionPoint);
361
480
362
481
fileMapping.overridenFiles .push_back (
363
482
{std::string (injectedModuleMapPath), std::move (os.str ())});
0 commit comments