File: llvm-4.0.0_threads.patch

package info (click to toggle)
julia 1.0.3%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,452 kB
  • sloc: lisp: 236,453; ansic: 55,579; cpp: 25,603; makefile: 1,685; pascal: 1,130; sh: 956; asm: 86; xml: 76
file content (2032 lines) | stat: -rw-r--r-- 69,396 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
From dfead72dc82a76a62433c4f0ed2262407ef51bf0 Mon Sep 17 00:00:00 2001
From: Alex Crichton <alex@alexcrichton.com>
Date: Thu, 28 Jan 2016 20:44:50 -0800
Subject: [PATCH] Don't compile usage of std::thread

As of the time of this writing it's not actually used anywhere meaningfullly
throughout the LLVM repo that we need, and it unfortunately uses `std::thread`
which isn't available in mingw-w64 toolchains with the win32 threading model
(the one that we use).

The change made to achive this was to just always use the single-threaded
support in `include/llvm/Support/thread.h`, and hopefuly that'll be enough...

For reference, the upstream LLVM bug has been reported [1]

[1]: https://llvm.org/bugs/show_bug.cgi?id=26365
---
 include/llvm/Support/ThreadPool.h         |   4 +
 include/llvm/Support/thread.h             |   2 +-
 lib/CodeGen/ParallelCG.cpp                |   2 +
 lib/LTO/LTO.cpp                           |   6 +-
 lib/LTO/LTOBackend.cpp                    |   2 +
 lib/LTO/ThinLTOCodeGenerator.cpp          |   6 +-
 lib/Support/ThreadPool.cpp                |   6 +-
 test/CMakeLists.txt                       |   1 -
 tools/lli/CMakeLists.txt                  |   4 -
 tools/lli/ChildTarget/CMakeLists.txt      |  13 --
 tools/lli/ChildTarget/ChildTarget.cpp     |  67 -------
 tools/lli/ChildTarget/LLVMBuild.txt       |  21 ---
 tools/lli/LLVMBuild.txt                   |   3 -
 tools/lli/OrcLazyJIT.cpp                  |   3 +-
 tools/lli/OrcLazyJIT.h                    | 175 ------------------
 tools/lli/RemoteJITUtils.h                | 153 ----------------
 tools/lli/lli.cpp                         |   7 +
 tools/llvm-cov/CodeCoverage.cpp           |   4 +
 tools/llvm-cov/CoverageExporterJson.cpp   |   2 +
 tools/llvm-cov/CoverageFilters.cpp        |   2 +
 tools/llvm-cov/CoverageFilters.h          | 127 -------------
 tools/llvm-cov/CoverageReport.cpp         |   2 +
 tools/llvm-cov/CoverageReport.h           |  51 ------
 tools/llvm-cov/CoverageSummaryInfo.cpp    |   2 +
 tools/llvm-cov/CoverageSummaryInfo.h      | 165 -----------------
 tools/llvm-cov/CoverageViewOptions.h      |  68 -------
 tools/llvm-cov/RenderingSupport.h         |  61 -------
 tools/llvm-cov/SourceCoverageView.cpp     |   2 +
 tools/llvm-cov/SourceCoverageView.h       | 289 ------------------------------
 tools/llvm-cov/SourceCoverageViewHTML.cpp |   3 +
 tools/llvm-cov/SourceCoverageViewHTML.h   |  96 ----------
 tools/llvm-cov/SourceCoverageViewText.cpp |   3 +
 tools/llvm-cov/SourceCoverageViewText.h   |  89 ---------
 tools/llvm-cov/TestingSupport.cpp         |   2 +
 tools/llvm-cov/gcov.cpp                   |   2 +
 tools/llvm-cov/llvm-cov.cpp               |   4 +
 tools/llvm-profdata/llvm-profdata.cpp     |   5 +
 tools/sancov/sancov.cc                    |   5 +
 unittests/Support/ThreadPool.cpp          |   4 +
 39 files changed, 73 insertions(+), 1390 deletions(-)
 delete mode 100644 tools/lli/ChildTarget/CMakeLists.txt
 delete mode 100644 tools/lli/ChildTarget/ChildTarget.cpp
 delete mode 100644 tools/lli/ChildTarget/LLVMBuild.txt
 delete mode 100644 tools/lli/OrcLazyJIT.h
 delete mode 100644 tools/lli/RemoteJITUtils.h
 delete mode 100644 tools/llvm-cov/CoverageFilters.h
 delete mode 100644 tools/llvm-cov/CoverageReport.h
 delete mode 100644 tools/llvm-cov/CoverageSummaryInfo.h
 delete mode 100644 tools/llvm-cov/CoverageViewOptions.h
 delete mode 100644 tools/llvm-cov/RenderingSupport.h
 delete mode 100644 tools/llvm-cov/SourceCoverageView.h
 delete mode 100644 tools/llvm-cov/SourceCoverageViewHTML.h
 delete mode 100644 tools/llvm-cov/SourceCoverageViewText.h

diff --git a/include/llvm/Support/ThreadPool.h b/include/llvm/Support/ThreadPool.h
index 665cec2465b..c3aa64de8cc 100644
--- a/include/llvm/Support/ThreadPool.h
+++ b/include/llvm/Support/ThreadPool.h
@@ -16,6 +16,8 @@
 
 #include "llvm/Support/thread.h"
 
+# if 0
+
 #ifdef _MSC_VER
 // concrt.h depends on eh.h for __uncaught_exception declaration
 // even if we disable exceptions.
@@ -134,4 +136,6 @@ private:
 };
 }
 
+# endif
+
 #endif // LLVM_SUPPORT_THREAD_POOL_H
diff --git a/include/llvm/Support/thread.h b/include/llvm/Support/thread.h
index 9c45418df55..27d42d23f61 100644
--- a/include/llvm/Support/thread.h
+++ b/include/llvm/Support/thread.h
@@ -19,7 +19,7 @@
 
 #include "llvm/Config/llvm-config.h"
 
-#if LLVM_ENABLE_THREADS
+#if LLVM_ENABLE_THREADS && 0
 
 #ifdef _MSC_VER
 // concrt.h depends on eh.h for __uncaught_exception declaration
diff --git a/lib/CodeGen/ParallelCG.cpp b/lib/CodeGen/ParallelCG.cpp
index 50dd44fa659..e91898e0fa7 100644
--- a/lib/CodeGen/ParallelCG.cpp
+++ b/lib/CodeGen/ParallelCG.cpp
@@ -50,6 +50,7 @@ std::unique_ptr<Module> llvm::splitCodeGen(
     return M;
   }
 
+#if 0
   // Create ThreadPool in nested scope so that threads will be joined
   // on destruction.
   {
@@ -96,5 +97,6 @@ std::unique_ptr<Module> llvm::splitCodeGen(
         PreserveLocals);
   }
 
+#endif
   return {};
 }
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp
index e3e2f9f806c..530946c03bb 100644
--- a/lib/LTO/LTO.cpp
+++ b/lib/LTO/LTO.cpp
@@ -630,7 +630,6 @@ public:
 
 namespace {
 class InProcessThinBackend : public ThinBackendProc {
-  ThreadPool BackendThreadPool;
   AddStreamFn AddStream;
   NativeObjectCache Cache;
 
@@ -644,7 +643,6 @@ public:
       const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
       AddStreamFn AddStream, NativeObjectCache Cache)
       : ThinBackendProc(Conf, CombinedIndex, ModuleToDefinedGVSummaries),
-        BackendThreadPool(ThinLTOParallelismLevel),
         AddStream(std::move(AddStream)), Cache(std::move(Cache)) {}
 
   Error runThinLTOBackendThread(
@@ -690,6 +688,7 @@ public:
       const FunctionImporter::ExportSetTy &ExportList,
       const std::map<GlobalValue::GUID, GlobalValue::LinkageTypes> &ResolvedODR,
       MapVector<StringRef, BitcodeModule> &ModuleMap) override {
+#if 0
     StringRef ModulePath = BM.getModuleIdentifier();
     assert(ModuleToDefinedGVSummaries.count(ModulePath));
     const GVSummaryMapTy &DefinedGlobals =
@@ -716,11 +715,14 @@ public:
         BM, std::ref(CombinedIndex), std::ref(ImportList),
         std::ref(ExportList), std::ref(ResolvedODR), std::ref(DefinedGlobals),
         std::ref(ModuleMap));
+#endif
     return Error::success();
   }
 
   Error wait() override {
+#if 0
     BackendThreadPool.wait();
+#endif
     if (Err)
       return std::move(*Err);
     else
diff --git a/lib/LTO/LTOBackend.cpp b/lib/LTO/LTOBackend.cpp
index 809db80bc91..73a355ecf1a 100644
--- a/lib/LTO/LTOBackend.cpp
+++ b/lib/LTO/LTOBackend.cpp
@@ -216,6 +216,7 @@ void codegen(Config &Conf, TargetMachine *TM, AddStreamFn AddStream,
 void splitCodeGen(Config &C, TargetMachine *TM, AddStreamFn AddStream,
                   unsigned ParallelCodeGenParallelismLevel,
                   std::unique_ptr<Module> Mod) {
+#if 0
   ThreadPool CodegenThreadPool(ParallelCodeGenParallelismLevel);
   unsigned ThreadCount = 0;
   const Target *T = &TM->getTarget();
@@ -259,6 +260,7 @@ void splitCodeGen(Config &C, TargetMachine *TM, AddStreamFn AddStream,
   // variables, we need to wait for the worker threads to terminate before we
   // can leave the function scope.
   CodegenThreadPool.wait();
+#endif
 }
 
 Expected<const Target *> initAndLookupTarget(Config &C, Module &Mod) {
diff --git a/lib/LTO/ThinLTOCodeGenerator.cpp b/lib/LTO/ThinLTOCodeGenerator.cpp
index 40537e4fa78..470e9e57df5 100644
--- a/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -70,8 +70,8 @@ extern cl::opt<bool> LTOPassRemarksWithHotness;
 
 namespace {
 
-static cl::opt<int>
-    ThreadCount("threads", cl::init(llvm::heavyweight_hardware_concurrency()));
+static cl::opt<int> ThreadCount("threads",
+                                cl::init(1));
 
 Expected<std::unique_ptr<tool_output_file>>
 setupOptimizationRemarks(LLVMContext &Ctx, int Count) {
@@ -830,6 +830,7 @@ static std::string writeGeneratedObject(int count, StringRef CacheEntryPath,
 
 // Main entry point for the ThinLTO processing
 void ThinLTOCodeGenerator::run() {
+#if 0
   // Prepare the resulting object vector
   assert(ProducedBinaries.empty() && "The generator should not be reused");
   if (SavedObjectsDirectoryPath.empty())
@@ -1052,4 +1053,5 @@ void ThinLTOCodeGenerator::run() {
   // If statistics were requested, print them out now.
   if (llvm::AreStatisticsEnabled())
     llvm::PrintStatistics();
+#endif
 }
diff --git a/lib/Support/ThreadPool.cpp b/lib/Support/ThreadPool.cpp
index db03a4d6240..71f49330f91 100644
--- a/lib/Support/ThreadPool.cpp
+++ b/lib/Support/ThreadPool.cpp
@@ -11,6 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#if 0
+
 #include "llvm/Support/ThreadPool.h"
 
 #include "llvm/Config/llvm-config.h"
@@ -18,7 +20,7 @@
 
 using namespace llvm;
 
-#if LLVM_ENABLE_THREADS
+#if LLVM_ENABLE_THREADS && 0
 
 // Default to std::thread::hardware_concurrency
 ThreadPool::ThreadPool() : ThreadPool(std::thread::hardware_concurrency()) {}
@@ -156,3 +158,5 @@ ThreadPool::~ThreadPool() {
 }
 
 #endif
+
+#endif
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c1667049f80..aa7d7f105b2 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -35,7 +35,6 @@ set(LLVM_TEST_DEPENDS
           count
           llc
           lli
-          lli-child-target
           llvm-ar
           llvm-as
           llvm-bcanalyzer
diff --git a/tools/lli/CMakeLists.txt b/tools/lli/CMakeLists.txt
index f02e19313b7..ca2e82abcd0 100644
--- a/tools/lli/CMakeLists.txt
+++ b/tools/lli/CMakeLists.txt
@@ -1,7 +1,3 @@
-if ( LLVM_INCLUDE_UTILS )
-  add_subdirectory(ChildTarget)
-endif()
-
 set(LLVM_LINK_COMPONENTS
   CodeGen
   Core
diff --git a/tools/lli/ChildTarget/CMakeLists.txt b/tools/lli/ChildTarget/CMakeLists.txt
deleted file mode 100644
index f08ce57c295..00000000000
--- a/tools/lli/ChildTarget/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-set(LLVM_LINK_COMPONENTS
-  OrcJIT
-  RuntimeDyld
-  Support
-  )
-
-add_llvm_utility(lli-child-target
-  ChildTarget.cpp
-
-  DEPENDS
-  intrinsics_gen
-)
-
diff --git a/tools/lli/ChildTarget/ChildTarget.cpp b/tools/lli/ChildTarget/ChildTarget.cpp
deleted file mode 100644
index 77b1d47a946..00000000000
--- a/tools/lli/ChildTarget/ChildTarget.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-#include "llvm/ExecutionEngine/Orc/OrcABISupport.h"
-#include "llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/DynamicLibrary.h"
-#include "llvm/Support/Process.h"
-#include <sstream>
-
-#include "../RemoteJITUtils.h"
-
-using namespace llvm;
-using namespace llvm::orc;
-using namespace llvm::sys;
-
-#ifdef __x86_64__
-typedef OrcX86_64_SysV HostOrcArch;
-#else
-typedef OrcGenericABI HostOrcArch;
-#endif
-
-ExitOnError ExitOnErr;
-
-int main(int argc, char *argv[]) {
-
-  if (argc != 3) {
-    errs() << "Usage: " << argv[0] << " <input fd> <output fd>\n";
-    return 1;
-  }
-
-  ExitOnErr.setBanner(std::string(argv[0]) + ":");
-
-  int InFD;
-  int OutFD;
-  {
-    std::istringstream InFDStream(argv[1]), OutFDStream(argv[2]);
-    InFDStream >> InFD;
-    OutFDStream >> OutFD;
-  }
-
-  if (sys::DynamicLibrary::LoadLibraryPermanently(nullptr)) {
-    errs() << "Error loading program symbols.\n";
-    return 1;
-  }
-
-  auto SymbolLookup = [](const std::string &Name) {
-    return RTDyldMemoryManager::getSymbolAddressInProcess(Name);
-  };
-
-  auto RegisterEHFrames = [](uint8_t *Addr, uint32_t Size) {
-    RTDyldMemoryManager::registerEHFramesInProcess(Addr, Size);
-  };
-
-  auto DeregisterEHFrames = [](uint8_t *Addr, uint32_t Size) {
-    RTDyldMemoryManager::deregisterEHFramesInProcess(Addr, Size);
-  };
-
-  FDRawChannel Channel(InFD, OutFD);
-  typedef remote::OrcRemoteTargetServer<FDRawChannel, HostOrcArch> JITServer;
-  JITServer Server(Channel, SymbolLookup, RegisterEHFrames, DeregisterEHFrames);
-
-  while (!Server.receivedTerminate())
-    ExitOnErr(Server.handleOne());
-
-  close(InFD);
-  close(OutFD);
-
-  return 0;
-}
diff --git a/tools/lli/ChildTarget/LLVMBuild.txt b/tools/lli/ChildTarget/LLVMBuild.txt
deleted file mode 100644
index daf6df11324..00000000000
--- a/tools/lli/ChildTarget/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/lli/ChildTarget/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-;                     The LLVM Compiler Infrastructure
-;
-; This file is distributed under the University of Illinois Open Source
-; License. See LICENSE.TXT for details.
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = lli-child-target
-parent = lli
diff --git a/tools/lli/LLVMBuild.txt b/tools/lli/LLVMBuild.txt
index 9d889bf4c2e..47385048e08 100644
--- a/tools/lli/LLVMBuild.txt
+++ b/tools/lli/LLVMBuild.txt
@@ -15,9 +15,6 @@
 ;
 ;===------------------------------------------------------------------------===;
 
-[common]
-subdirectories = ChildTarget
-
 [component_0]
 type = Tool
 name = lli
diff --git a/tools/lli/OrcLazyJIT.cpp b/tools/lli/OrcLazyJIT.cpp
index ec61ce5e154..640cfd9b6ef 100644
--- a/tools/lli/OrcLazyJIT.cpp
+++ b/tools/lli/OrcLazyJIT.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===------ OrcLazyJIT.cpp - Basic Orc-based JIT for lazy execution -------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -158,4 +159,4 @@ int llvm::runOrcLazyJIT(std::vector<std::unique_ptr<Module>> Ms,
   auto Main = fromTargetAddress<MainFnPtr>(MainSym.getAddress());
   return Main(ArgV.size(), (const char**)ArgV.data());
 }
-
+#endif
diff --git a/tools/lli/OrcLazyJIT.h b/tools/lli/OrcLazyJIT.h
deleted file mode 100644
index 05319c34548..00000000000
--- a/tools/lli/OrcLazyJIT.h
+++ /dev/null
@@ -1,175 +0,0 @@
-//===--- OrcLazyJIT.h - Basic Orc-based JIT for lazy execution --*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Simple Orc-based JIT. Uses the compile-on-demand layer to break up and
-// lazily compile modules.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLI_ORCLAZYJIT_H
-#define LLVM_TOOLS_LLI_ORCLAZYJIT_H
-
-#include "llvm/ADT/Triple.h"
-#include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
-#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
-#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
-#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
-#include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
-#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
-#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
-
-namespace llvm {
-
-class OrcLazyJIT {
-public:
-
-  typedef orc::JITCompileCallbackManager CompileCallbackMgr;
-  typedef orc::ObjectLinkingLayer<> ObjLayerT;
-  typedef orc::IRCompileLayer<ObjLayerT> CompileLayerT;
-  typedef std::function<std::unique_ptr<Module>(std::unique_ptr<Module>)>
-    TransformFtor;
-  typedef orc::IRTransformLayer<CompileLayerT, TransformFtor> IRDumpLayerT;
-  typedef orc::CompileOnDemandLayer<IRDumpLayerT, CompileCallbackMgr> CODLayerT;
-  typedef CODLayerT::IndirectStubsManagerBuilderT
-    IndirectStubsManagerBuilder;
-  typedef CODLayerT::ModuleSetHandleT ModuleSetHandleT;
-
-  OrcLazyJIT(std::unique_ptr<TargetMachine> TM,
-             std::unique_ptr<CompileCallbackMgr> CCMgr,
-             IndirectStubsManagerBuilder IndirectStubsMgrBuilder,
-             bool InlineStubs)
-      : TM(std::move(TM)), DL(this->TM->createDataLayout()),
-	CCMgr(std::move(CCMgr)),
-	ObjectLayer(),
-        CompileLayer(ObjectLayer, orc::SimpleCompiler(*this->TM)),
-        IRDumpLayer(CompileLayer, createDebugDumper()),
-        CODLayer(IRDumpLayer, extractSingleFunction, *this->CCMgr,
-                 std::move(IndirectStubsMgrBuilder), InlineStubs),
-        CXXRuntimeOverrides(
-            [this](const std::string &S) { return mangle(S); }) {}
-
-  ~OrcLazyJIT() {
-    // Run any destructors registered with __cxa_atexit.
-    CXXRuntimeOverrides.runDestructors();
-    // Run any IR destructors.
-    for (auto &DtorRunner : IRStaticDestructorRunners)
-      DtorRunner.runViaLayer(CODLayer);
-  }
-
-  ModuleSetHandleT addModuleSet(std::vector<std::unique_ptr<Module>> Ms) {
-    // Attach a data-layouts if they aren't already present.
-    for (auto &M : Ms)
-      if (M->getDataLayout().isDefault())
-        M->setDataLayout(DL);
-
-    // Rename, bump linkage and record static constructors and destructors.
-    // We have to do this before we hand over ownership of the module to the
-    // JIT.
-    std::vector<std::string> CtorNames, DtorNames;
-    {
-      unsigned CtorId = 0, DtorId = 0;
-      for (auto &M : Ms) {
-        for (auto Ctor : orc::getConstructors(*M)) {
-          std::string NewCtorName = ("$static_ctor." + Twine(CtorId++)).str();
-          Ctor.Func->setName(NewCtorName);
-          Ctor.Func->setLinkage(GlobalValue::ExternalLinkage);
-          Ctor.Func->setVisibility(GlobalValue::HiddenVisibility);
-          CtorNames.push_back(mangle(NewCtorName));
-        }
-        for (auto Dtor : orc::getDestructors(*M)) {
-          std::string NewDtorName = ("$static_dtor." + Twine(DtorId++)).str();
-          Dtor.Func->setLinkage(GlobalValue::ExternalLinkage);
-          Dtor.Func->setVisibility(GlobalValue::HiddenVisibility);
-          DtorNames.push_back(mangle(Dtor.Func->getName()));
-          Dtor.Func->setName(NewDtorName);
-        }
-      }
-    }
-
-    // Symbol resolution order:
-    //   1) Search the JIT symbols.
-    //   2) Check for C++ runtime overrides.
-    //   3) Search the host process (LLI)'s symbol table.
-    auto Resolver =
-      orc::createLambdaResolver(
-        [this](const std::string &Name) -> JITSymbol {
-          if (auto Sym = CODLayer.findSymbol(Name, true))
-            return Sym;
-          return CXXRuntimeOverrides.searchOverrides(Name);
-        },
-        [](const std::string &Name) {
-          if (auto Addr =
-              RTDyldMemoryManager::getSymbolAddressInProcess(Name))
-            return JITSymbol(Addr, JITSymbolFlags::Exported);
-          return JITSymbol(nullptr);
-        }
-      );
-
-    // Add the module to the JIT.
-    auto H = CODLayer.addModuleSet(std::move(Ms),
-				   llvm::make_unique<SectionMemoryManager>(),
-				   std::move(Resolver));
-
-    // Run the static constructors, and save the static destructor runner for
-    // execution when the JIT is torn down.
-    orc::CtorDtorRunner<CODLayerT> CtorRunner(std::move(CtorNames), H);
-    CtorRunner.runViaLayer(CODLayer);
-
-    IRStaticDestructorRunners.emplace_back(std::move(DtorNames), H);
-
-    return H;
-  }
-
-  JITSymbol findSymbol(const std::string &Name) {
-    return CODLayer.findSymbol(mangle(Name), true);
-  }
-
-  JITSymbol findSymbolIn(ModuleSetHandleT H, const std::string &Name) {
-    return CODLayer.findSymbolIn(H, mangle(Name), true);
-  }
-
-private:
-
-  std::string mangle(const std::string &Name) {
-    std::string MangledName;
-    {
-      raw_string_ostream MangledNameStream(MangledName);
-      Mangler::getNameWithPrefix(MangledNameStream, Name, DL);
-    }
-    return MangledName;
-  }
-
-  static std::set<Function*> extractSingleFunction(Function &F) {
-    std::set<Function*> Partition;
-    Partition.insert(&F);
-    return Partition;
-  }
-
-  static TransformFtor createDebugDumper();
-
-  std::unique_ptr<TargetMachine> TM;
-  DataLayout DL;
-  SectionMemoryManager CCMgrMemMgr;
-
-  std::unique_ptr<CompileCallbackMgr> CCMgr;
-  ObjLayerT ObjectLayer;
-  CompileLayerT CompileLayer;
-  IRDumpLayerT IRDumpLayer;
-  CODLayerT CODLayer;
-
-  orc::LocalCXXRuntimeOverrides CXXRuntimeOverrides;
-  std::vector<orc::CtorDtorRunner<CODLayerT>> IRStaticDestructorRunners;
-};
-
-int runOrcLazyJIT(std::vector<std::unique_ptr<Module>> Ms,
-                  const std::vector<std::string> &Args);
-
-} // end namespace llvm
-
-#endif
diff --git a/tools/lli/RemoteJITUtils.h b/tools/lli/RemoteJITUtils.h
deleted file mode 100644
index 89a51420256..00000000000
--- a/tools/lli/RemoteJITUtils.h
+++ /dev/null
@@ -1,153 +0,0 @@
-//===-- RemoteJITUtils.h - Utilities for remote-JITing with LLI -*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Utilities for remote-JITing with LLI.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLI_REMOTEJITUTILS_H
-#define LLVM_TOOLS_LLI_REMOTEJITUTILS_H
-
-#include "llvm/ExecutionEngine/Orc/RawByteChannel.h"
-#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
-#include <mutex>
-
-#if !defined(_MSC_VER) && !defined(__MINGW32__)
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-/// RPC channel that reads from and writes from file descriptors.
-class FDRawChannel final : public llvm::orc::rpc::RawByteChannel {
-public:
-  FDRawChannel(int InFD, int OutFD) : InFD(InFD), OutFD(OutFD) {}
-
-  llvm::Error readBytes(char *Dst, unsigned Size) override {
-    assert(Dst && "Attempt to read into null.");
-    ssize_t Completed = 0;
-    while (Completed < static_cast<ssize_t>(Size)) {
-      ssize_t Read = ::read(InFD, Dst + Completed, Size - Completed);
-      if (Read <= 0) {
-        auto ErrNo = errno;
-        if (ErrNo == EAGAIN || ErrNo == EINTR)
-          continue;
-        else
-          return llvm::errorCodeToError(
-                   std::error_code(errno, std::generic_category()));
-      }
-      Completed += Read;
-    }
-    return llvm::Error::success();
-  }
-
-  llvm::Error appendBytes(const char *Src, unsigned Size) override {
-    assert(Src && "Attempt to append from null.");
-    ssize_t Completed = 0;
-    while (Completed < static_cast<ssize_t>(Size)) {
-      ssize_t Written = ::write(OutFD, Src + Completed, Size - Completed);
-      if (Written < 0) {
-        auto ErrNo = errno;
-        if (ErrNo == EAGAIN || ErrNo == EINTR)
-          continue;
-        else
-          return llvm::errorCodeToError(
-                   std::error_code(errno, std::generic_category()));
-      }
-      Completed += Written;
-    }
-    return llvm::Error::success();
-  }
-
-  llvm::Error send() override { return llvm::Error::success(); }
-
-private:
-  int InFD, OutFD;
-};
-
-// launch the remote process (see lli.cpp) and return a channel to it.
-std::unique_ptr<FDRawChannel> launchRemote();
-
-namespace llvm {
-
-// ForwardingMM - Adapter to connect MCJIT to Orc's Remote8
-// memory manager.
-class ForwardingMemoryManager : public llvm::RTDyldMemoryManager {
-public:
-  void setMemMgr(std::unique_ptr<RuntimeDyld::MemoryManager> MemMgr) {
-    this->MemMgr = std::move(MemMgr);
-  }
-
-  void setResolver(std::unique_ptr<JITSymbolResolver> Resolver) {
-    this->Resolver = std::move(Resolver);
-  }
-
-  uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                               unsigned SectionID,
-                               StringRef SectionName) override {
-    return MemMgr->allocateCodeSection(Size, Alignment, SectionID, SectionName);
-  }
-
-  uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
-                               unsigned SectionID, StringRef SectionName,
-                               bool IsReadOnly) override {
-    return MemMgr->allocateDataSection(Size, Alignment, SectionID, SectionName,
-                                       IsReadOnly);
-  }
-
-  void reserveAllocationSpace(uintptr_t CodeSize, uint32_t CodeAlign,
-                              uintptr_t RODataSize, uint32_t RODataAlign,
-                              uintptr_t RWDataSize,
-                              uint32_t RWDataAlign) override {
-    MemMgr->reserveAllocationSpace(CodeSize, CodeAlign, RODataSize, RODataAlign,
-                                   RWDataSize, RWDataAlign);
-  }
-
-  bool needsToReserveAllocationSpace() override {
-    return MemMgr->needsToReserveAllocationSpace();
-  }
-
-  void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr,
-                        size_t Size) override {
-    MemMgr->registerEHFrames(Addr, LoadAddr, Size);
-  }
-
-  void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr,
-                          size_t Size) override {
-    MemMgr->deregisterEHFrames(Addr, LoadAddr, Size);
-  }
-
-  bool finalizeMemory(std::string *ErrMsg = nullptr) override {
-    return MemMgr->finalizeMemory(ErrMsg);
-  }
-
-  void notifyObjectLoaded(RuntimeDyld &RTDyld,
-                          const object::ObjectFile &Obj) override {
-    MemMgr->notifyObjectLoaded(RTDyld, Obj);
-  }
-
-  // Don't hide the sibling notifyObjectLoaded from RTDyldMemoryManager.
-  using RTDyldMemoryManager::notifyObjectLoaded;
-
-  JITSymbol findSymbol(const std::string &Name) override {
-    return Resolver->findSymbol(Name);
-  }
-
-  JITSymbol
-  findSymbolInLogicalDylib(const std::string &Name) override {
-    return Resolver->findSymbolInLogicalDylib(Name);
-  }
-
-private:
-  std::unique_ptr<RuntimeDyld::MemoryManager> MemMgr;
-  std::unique_ptr<JITSymbolResolver> Resolver;
-};
-}
-
-#endif
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 0823ff469de..8e9b9f87577 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -13,6 +13,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#if 0
+
 #include "OrcLazyJIT.h"
 #include "RemoteJITUtils.h"
 #include "llvm/IR/LLVMContext.h"
@@ -758,3 +760,8 @@ std::unique_ptr<FDRawChannel> launchRemote() {
   return llvm::make_unique<FDRawChannel>(PipeFD[1][0], PipeFD[0][1]);
 #endif
 }
+#endif
+
+int main(int argc, char **argv, char * const *envp) {
+  return 0;
+}
diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp
index 0a9807ab003..0b7ffd366b9 100644
--- a/tools/llvm-cov/CodeCoverage.cpp
+++ b/tools/llvm-cov/CodeCoverage.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- CodeCoverage.cpp - Coverage tool based on profiling instrumentation-===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -864,7 +865,10 @@ int reportMain(int argc, const char *argv[]) {
   return Tool.run(CodeCoverageTool::Report, argc, argv);
 }
 
+
 int exportMain(int argc, const char *argv[]) {
   CodeCoverageTool Tool;
   return Tool.run(CodeCoverageTool::Export, argc, argv);
 }
+
+#endif
diff --git a/tools/llvm-cov/CoverageExporterJson.cpp b/tools/llvm-cov/CoverageExporterJson.cpp
index ef50bba2123..d3d0a8f5f01 100644
--- a/tools/llvm-cov/CoverageExporterJson.cpp
+++ b/tools/llvm-cov/CoverageExporterJson.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- CoverageExporterJson.cpp - Code coverage export --------------------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -419,3 +420,4 @@ void exportCoverageDataToJson(const CoverageMapping &CoverageMapping,
 
   Exporter.print();
 }
+#endif
diff --git a/tools/llvm-cov/CoverageFilters.cpp b/tools/llvm-cov/CoverageFilters.cpp
index 325dd723578..8a41ba8c1d8 100644
--- a/tools/llvm-cov/CoverageFilters.cpp
+++ b/tools/llvm-cov/CoverageFilters.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- CoverageFilters.cpp - Function coverage mapping filters ------------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -57,3 +58,4 @@ CoverageFiltersMatchAll::matches(const coverage::FunctionRecord &Function) {
   }
   return true;
 }
+#endif
diff --git a/tools/llvm-cov/CoverageFilters.h b/tools/llvm-cov/CoverageFilters.h
deleted file mode 100644
index 756c4b47872..00000000000
--- a/tools/llvm-cov/CoverageFilters.h
+++ /dev/null
@@ -1,127 +0,0 @@
-//===- CoverageFilters.h - Function coverage mapping filters --------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// These classes provide filtering for function coverage mapping records.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_COVERAGEFILTERS_H
-#define LLVM_COV_COVERAGEFILTERS_H
-
-#include "llvm/ProfileData/Coverage/CoverageMapping.h"
-#include <memory>
-#include <vector>
-
-namespace llvm {
-
-/// \brief Matches specific functions that pass the requirement of this filter.
-class CoverageFilter {
-public:
-  virtual ~CoverageFilter() {}
-
-  /// \brief Return true if the function passes the requirements of this filter.
-  virtual bool matches(const coverage::FunctionRecord &Function) {
-    return true;
-  }
-};
-
-/// \brief Matches functions that contain a specific string in their name.
-class NameCoverageFilter : public CoverageFilter {
-  StringRef Name;
-
-public:
-  NameCoverageFilter(StringRef Name) : Name(Name) {}
-
-  bool matches(const coverage::FunctionRecord &Function) override;
-};
-
-/// \brief Matches functions whose name matches a certain regular expression.
-class NameRegexCoverageFilter : public CoverageFilter {
-  StringRef Regex;
-
-public:
-  NameRegexCoverageFilter(StringRef Regex) : Regex(Regex) {}
-
-  bool matches(const coverage::FunctionRecord &Function) override;
-};
-
-/// \brief Matches numbers that pass a certain threshold.
-template <typename T> class StatisticThresholdFilter {
-public:
-  enum Operation { LessThan, GreaterThan };
-
-protected:
-  Operation Op;
-  T Threshold;
-
-  StatisticThresholdFilter(Operation Op, T Threshold)
-      : Op(Op), Threshold(Threshold) {}
-
-  /// \brief Return true if the given number is less than
-  /// or greater than the certain threshold.
-  bool PassesThreshold(T Value) const {
-    switch (Op) {
-    case LessThan:
-      return Value < Threshold;
-    case GreaterThan:
-      return Value > Threshold;
-    }
-    return false;
-  }
-};
-
-/// \brief Matches functions whose region coverage percentage
-/// is above/below a certain percentage.
-class RegionCoverageFilter : public CoverageFilter,
-                             public StatisticThresholdFilter<double> {
-public:
-  RegionCoverageFilter(Operation Op, double Threshold)
-      : StatisticThresholdFilter(Op, Threshold) {}
-
-  bool matches(const coverage::FunctionRecord &Function) override;
-};
-
-/// \brief Matches functions whose line coverage percentage
-/// is above/below a certain percentage.
-class LineCoverageFilter : public CoverageFilter,
-                           public StatisticThresholdFilter<double> {
-public:
-  LineCoverageFilter(Operation Op, double Threshold)
-      : StatisticThresholdFilter(Op, Threshold) {}
-
-  bool matches(const coverage::FunctionRecord &Function) override;
-};
-
-/// \brief A collection of filters.
-/// Matches functions that match any filters contained
-/// in an instance of this class.
-class CoverageFilters : public CoverageFilter {
-protected:
-  std::vector<std::unique_ptr<CoverageFilter>> Filters;
-
-public:
-  /// \brief Append a filter to this collection.
-  void push_back(std::unique_ptr<CoverageFilter> Filter);
-
-  bool empty() const { return Filters.empty(); }
-
-  bool matches(const coverage::FunctionRecord &Function) override;
-};
-
-/// \brief A collection of filters.
-/// Matches functions that match all of the filters contained
-/// in an instance of this class.
-class CoverageFiltersMatchAll : public CoverageFilters {
-public:
-  bool matches(const coverage::FunctionRecord &Function) override;
-};
-
-} // namespace llvm
-
-#endif // LLVM_COV_COVERAGEFILTERS_H
diff --git a/tools/llvm-cov/CoverageReport.cpp b/tools/llvm-cov/CoverageReport.cpp
index e88cb186acd..67fdaa6f57e 100644
--- a/tools/llvm-cov/CoverageReport.cpp
+++ b/tools/llvm-cov/CoverageReport.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- CoverageReport.cpp - Code coverage report -------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -353,3 +354,4 @@ void CoverageReport::renderFileReports(raw_ostream &OS,
 }
 
 } // end namespace llvm
+#endif
diff --git a/tools/llvm-cov/CoverageReport.h b/tools/llvm-cov/CoverageReport.h
deleted file mode 100644
index 7a416497e25..00000000000
--- a/tools/llvm-cov/CoverageReport.h
+++ /dev/null
@@ -1,51 +0,0 @@
-//===- CoverageReport.h - Code coverage report ---------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class implements rendering of a code coverage report.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_COVERAGEREPORT_H
-#define LLVM_COV_COVERAGEREPORT_H
-
-#include "CoverageSummaryInfo.h"
-#include "CoverageViewOptions.h"
-
-namespace llvm {
-
-/// \brief Displays the code coverage report.
-class CoverageReport {
-  const CoverageViewOptions &Options;
-  const coverage::CoverageMapping &Coverage;
-
-  void render(const FileCoverageSummary &File, raw_ostream &OS) const;
-  void render(const FunctionCoverageSummary &Function, raw_ostream &OS) const;
-
-public:
-  CoverageReport(const CoverageViewOptions &Options,
-                 const coverage::CoverageMapping &Coverage)
-      : Options(Options), Coverage(Coverage) {}
-
-  void renderFunctionReports(ArrayRef<std::string> Files, raw_ostream &OS);
-
-  /// Prepare file reports for the files specified in \p Files.
-  static std::vector<FileCoverageSummary>
-  prepareFileReports(const coverage::CoverageMapping &Coverage,
-                     FileCoverageSummary &Totals, ArrayRef<std::string> Files);
-
-  /// Render file reports for every unique file in the coverage mapping.
-  void renderFileReports(raw_ostream &OS) const;
-
-  /// Render file reports for the files specified in \p Files.
-  void renderFileReports(raw_ostream &OS, ArrayRef<std::string> Files) const;
-};
-
-} // end namespace llvm
-
-#endif // LLVM_COV_COVERAGEREPORT_H
diff --git a/tools/llvm-cov/CoverageSummaryInfo.cpp b/tools/llvm-cov/CoverageSummaryInfo.cpp
index 21aa7ff73a0..5a325b40cf8 100644
--- a/tools/llvm-cov/CoverageSummaryInfo.cpp
+++ b/tools/llvm-cov/CoverageSummaryInfo.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- CoverageSummaryInfo.cpp - Coverage summary for function/file -------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -81,3 +82,4 @@ void FunctionCoverageSummary::update(const FunctionCoverageSummary &Summary) {
   LineCoverage.NotCovered =
       std::min(LineCoverage.NotCovered, Summary.LineCoverage.NotCovered);
 }
+#endif
diff --git a/tools/llvm-cov/CoverageSummaryInfo.h b/tools/llvm-cov/CoverageSummaryInfo.h
deleted file mode 100644
index c04a4d42ccd..00000000000
--- a/tools/llvm-cov/CoverageSummaryInfo.h
+++ /dev/null
@@ -1,165 +0,0 @@
-//===- CoverageSummaryInfo.h - Coverage summary for function/file ---------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// These structures are used to represent code coverage metrics
-// for functions/files.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_COVERAGESUMMARYINFO_H
-#define LLVM_COV_COVERAGESUMMARYINFO_H
-
-#include "llvm/ProfileData/Coverage/CoverageMapping.h"
-#include "llvm/Support/raw_ostream.h"
-
-namespace llvm {
-
-/// \brief Provides information about region coverage for a function/file.
-struct RegionCoverageInfo {
-  /// \brief The number of regions that were executed at least once.
-  size_t Covered;
-
-  /// \brief The number of regions that weren't executed.
-  size_t NotCovered;
-
-  /// \brief The total number of regions in a function/file.
-  size_t NumRegions;
-
-  RegionCoverageInfo() : Covered(0), NotCovered(0), NumRegions(0) {}
-
-  RegionCoverageInfo(size_t Covered, size_t NumRegions)
-      : Covered(Covered), NotCovered(NumRegions - Covered),
-        NumRegions(NumRegions) {}
-
-  RegionCoverageInfo &operator+=(const RegionCoverageInfo &RHS) {
-    Covered += RHS.Covered;
-    NotCovered += RHS.NotCovered;
-    NumRegions += RHS.NumRegions;
-    return *this;
-  }
-
-  bool isFullyCovered() const { return Covered == NumRegions; }
-
-  double getPercentCovered() const {
-    if (NumRegions == 0)
-      return 0.0;
-    return double(Covered) / double(NumRegions) * 100.0;
-  }
-};
-
-/// \brief Provides information about line coverage for a function/file.
-struct LineCoverageInfo {
-  /// \brief The number of lines that were executed at least once.
-  size_t Covered;
-
-  /// \brief The number of lines that weren't executed.
-  size_t NotCovered;
-
-  /// \brief The total number of lines in a function/file.
-  size_t NumLines;
-
-  LineCoverageInfo() : Covered(0), NotCovered(0), NumLines(0) {}
-
-  LineCoverageInfo(size_t Covered, size_t NumLines)
-      : Covered(Covered), NotCovered(NumLines - Covered), NumLines(NumLines) {}
-
-  LineCoverageInfo &operator+=(const LineCoverageInfo &RHS) {
-    Covered += RHS.Covered;
-    NotCovered += RHS.NotCovered;
-    NumLines += RHS.NumLines;
-    return *this;
-  }
-
-  bool isFullyCovered() const { return Covered == NumLines; }
-
-  double getPercentCovered() const {
-    if (NumLines == 0)
-      return 0.0;
-    return double(Covered) / double(NumLines) * 100.0;
-  }
-};
-
-/// \brief Provides information about function coverage for a file.
-struct FunctionCoverageInfo {
-  /// \brief The number of functions that were executed.
-  size_t Executed;
-
-  /// \brief The total number of functions in this file.
-  size_t NumFunctions;
-
-  FunctionCoverageInfo() : Executed(0), NumFunctions(0) {}
-
-  FunctionCoverageInfo(size_t Executed, size_t NumFunctions)
-      : Executed(Executed), NumFunctions(NumFunctions) {}
-
-  void addFunction(bool Covered) {
-    if (Covered)
-      ++Executed;
-    ++NumFunctions;
-  }
-
-  bool isFullyCovered() const { return Executed == NumFunctions; }
-
-  double getPercentCovered() const {
-    if (NumFunctions == 0)
-      return 0.0;
-    return double(Executed) / double(NumFunctions) * 100.0;
-  }
-};
-
-/// \brief A summary of function's code coverage.
-struct FunctionCoverageSummary {
-  StringRef Name;
-  uint64_t ExecutionCount;
-  RegionCoverageInfo RegionCoverage;
-  LineCoverageInfo LineCoverage;
-
-  FunctionCoverageSummary(StringRef Name) : Name(Name), ExecutionCount(0) {}
-
-  FunctionCoverageSummary(StringRef Name, uint64_t ExecutionCount,
-                          const RegionCoverageInfo &RegionCoverage,
-                          const LineCoverageInfo &LineCoverage)
-      : Name(Name), ExecutionCount(ExecutionCount),
-        RegionCoverage(RegionCoverage), LineCoverage(LineCoverage) {
-  }
-
-  /// \brief Compute the code coverage summary for the given function coverage
-  /// mapping record.
-  static FunctionCoverageSummary
-  get(const coverage::FunctionRecord &Function);
-
-  /// \brief Update the summary with information from another instantiation
-  /// of this function.
-  void update(const FunctionCoverageSummary &Summary);
-};
-
-/// \brief A summary of file's code coverage.
-struct FileCoverageSummary {
-  StringRef Name;
-  RegionCoverageInfo RegionCoverage;
-  LineCoverageInfo LineCoverage;
-  FunctionCoverageInfo FunctionCoverage;
-  FunctionCoverageInfo InstantiationCoverage;
-
-  FileCoverageSummary(StringRef Name) : Name(Name) {}
-
-  void addFunction(const FunctionCoverageSummary &Function) {
-    RegionCoverage += Function.RegionCoverage;
-    LineCoverage += Function.LineCoverage;
-    FunctionCoverage.addFunction(/*Covered=*/Function.ExecutionCount > 0);
-  }
-
-  void addInstantiation(const FunctionCoverageSummary &Function) {
-    InstantiationCoverage.addFunction(/*Covered=*/Function.ExecutionCount > 0);
-  }
-};
-
-} // namespace llvm
-
-#endif // LLVM_COV_COVERAGESUMMARYINFO_H
diff --git a/tools/llvm-cov/CoverageViewOptions.h b/tools/llvm-cov/CoverageViewOptions.h
deleted file mode 100644
index 266b380b7d3..00000000000
--- a/tools/llvm-cov/CoverageViewOptions.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//===- CoverageViewOptions.h - Code coverage display options -------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_COVERAGEVIEWOPTIONS_H
-#define LLVM_COV_COVERAGEVIEWOPTIONS_H
-
-#include "RenderingSupport.h"
-#include <vector>
-
-namespace llvm {
-
-/// \brief The options for displaying the code coverage information.
-struct CoverageViewOptions {
-  enum class OutputFormat {
-    Text,
-    HTML
-  };
-
-  bool Debug;
-  bool Colors;
-  bool ShowLineNumbers;
-  bool ShowLineStats;
-  bool ShowRegionMarkers;
-  bool ShowLineStatsOrRegionMarkers;
-  bool ShowExpandedRegions;
-  bool ShowFunctionInstantiations;
-  bool ShowFullFilenames;
-  OutputFormat Format;
-  std::string ShowOutputDirectory;
-  std::vector<std::string> DemanglerOpts;
-  uint32_t TabSize;
-  std::string ProjectTitle;
-  std::string CreatedTimeStr;
-
-  /// \brief Change the output's stream color if the colors are enabled.
-  ColoredRawOstream colored_ostream(raw_ostream &OS,
-                                    raw_ostream::Colors Color) const {
-    return llvm::colored_ostream(OS, Color, Colors);
-  }
-
-  /// \brief Check if an output directory has been specified.
-  bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }
-
-  /// \brief Check if a demangler has been specified.
-  bool hasDemangler() const { return !DemanglerOpts.empty(); }
-
-  /// \brief Check if a project title has been specified.
-  bool hasProjectTitle() const { return !ProjectTitle.empty(); }
-
-  /// \brief Check if the created time of the profile data file is available.
-  bool hasCreatedTime() const { return !CreatedTimeStr.empty(); }
-
-  /// \brief Get the LLVM version string.
-  std::string getLLVMVersionString() const {
-    std::string VersionString = "Generated by llvm-cov -- llvm version ";
-    VersionString += LLVM_VERSION_STRING;
-    return VersionString;
-  }
-};
-}
-
-#endif // LLVM_COV_COVERAGEVIEWOPTIONS_H
diff --git a/tools/llvm-cov/RenderingSupport.h b/tools/llvm-cov/RenderingSupport.h
deleted file mode 100644
index aa70fbc23e3..00000000000
--- a/tools/llvm-cov/RenderingSupport.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//===- RenderingSupport.h - output stream rendering support functions  ----===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_RENDERINGSUPPORT_H
-#define LLVM_COV_RENDERINGSUPPORT_H
-
-#include "llvm/Support/raw_ostream.h"
-#include <utility>
-
-namespace llvm {
-
-/// \brief A helper class that resets the output stream's color if needed
-/// when destroyed.
-class ColoredRawOstream {
-  ColoredRawOstream(const ColoredRawOstream &OS) = delete;
-
-public:
-  raw_ostream &OS;
-  bool IsColorUsed;
-
-  ColoredRawOstream(raw_ostream &OS, bool IsColorUsed)
-      : OS(OS), IsColorUsed(IsColorUsed) {}
-
-  ColoredRawOstream(ColoredRawOstream &&Other)
-      : OS(Other.OS), IsColorUsed(Other.IsColorUsed) {
-    // Reset the other IsColorUsed so that the other object won't reset the
-    // color when destroyed.
-    Other.IsColorUsed = false;
-  }
-
-  ~ColoredRawOstream() {
-    if (IsColorUsed)
-      OS.resetColor();
-  }
-};
-
-template <typename T>
-inline raw_ostream &operator<<(const ColoredRawOstream &OS, T &&Value) {
-  return OS.OS << std::forward<T>(Value);
-}
-
-/// \brief Change the color of the output stream if the `IsColorUsed` flag
-/// is true. Returns an object that resets the color when destroyed.
-inline ColoredRawOstream colored_ostream(raw_ostream &OS,
-                                         raw_ostream::Colors Color,
-                                         bool IsColorUsed = true,
-                                         bool Bold = false, bool BG = false) {
-  if (IsColorUsed)
-    OS.changeColor(Color, Bold, BG);
-  return ColoredRawOstream(OS, IsColorUsed);
-}
-
-} // namespace llvm
-
-#endif // LLVM_COV_RENDERINGSUPPORT_H
diff --git a/tools/llvm-cov/SourceCoverageView.cpp b/tools/llvm-cov/SourceCoverageView.cpp
index 52b8ff1747f..84c2cb7e8d6 100644
--- a/tools/llvm-cov/SourceCoverageView.cpp
+++ b/tools/llvm-cov/SourceCoverageView.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- SourceCoverageView.cpp - Code coverage view for source code --------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -265,3 +266,4 @@ void SourceCoverageView::print(raw_ostream &OS, bool WholeFile,
 
   renderViewFooter(OS);
 }
+#endif
diff --git a/tools/llvm-cov/SourceCoverageView.h b/tools/llvm-cov/SourceCoverageView.h
deleted file mode 100644
index 9cb608fed60..00000000000
--- a/tools/llvm-cov/SourceCoverageView.h
+++ /dev/null
@@ -1,289 +0,0 @@
-//===- SourceCoverageView.h - Code coverage view for source code ----------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file This class implements rendering for code coverage of source code.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_SOURCECOVERAGEVIEW_H
-#define LLVM_COV_SOURCECOVERAGEVIEW_H
-
-#include "CoverageViewOptions.h"
-#include "llvm/ProfileData/Coverage/CoverageMapping.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include <vector>
-
-namespace llvm {
-
-class SourceCoverageView;
-
-/// \brief A view that represents a macro or include expansion.
-struct ExpansionView {
-  coverage::CounterMappingRegion Region;
-  std::unique_ptr<SourceCoverageView> View;
-
-  ExpansionView(const coverage::CounterMappingRegion &Region,
-                std::unique_ptr<SourceCoverageView> View)
-      : Region(Region), View(std::move(View)) {}
-  ExpansionView(ExpansionView &&RHS)
-      : Region(std::move(RHS.Region)), View(std::move(RHS.View)) {}
-  ExpansionView &operator=(ExpansionView &&RHS) {
-    Region = std::move(RHS.Region);
-    View = std::move(RHS.View);
-    return *this;
-  }
-
-  unsigned getLine() const { return Region.LineStart; }
-  unsigned getStartCol() const { return Region.ColumnStart; }
-  unsigned getEndCol() const { return Region.ColumnEnd; }
-
-  friend bool operator<(const ExpansionView &LHS, const ExpansionView &RHS) {
-    return LHS.Region.startLoc() < RHS.Region.startLoc();
-  }
-};
-
-/// \brief A view that represents a function instantiation.
-struct InstantiationView {
-  StringRef FunctionName;
-  unsigned Line;
-  std::unique_ptr<SourceCoverageView> View;
-
-  InstantiationView(StringRef FunctionName, unsigned Line,
-                    std::unique_ptr<SourceCoverageView> View)
-      : FunctionName(FunctionName), Line(Line), View(std::move(View)) {}
-
-  friend bool operator<(const InstantiationView &LHS,
-                        const InstantiationView &RHS) {
-    return LHS.Line < RHS.Line;
-  }
-};
-
-/// \brief Coverage statistics for a single line.
-struct LineCoverageStats {
-  uint64_t ExecutionCount;
-  unsigned RegionCount;
-  bool Mapped;
-
-  LineCoverageStats() : ExecutionCount(0), RegionCount(0), Mapped(false) {}
-
-  bool isMapped() const { return Mapped; }
-
-  bool hasMultipleRegions() const { return RegionCount > 1; }
-
-  void addRegionStartCount(uint64_t Count) {
-    // The max of all region starts is the most interesting value.
-    addRegionCount(RegionCount ? std::max(ExecutionCount, Count) : Count);
-    ++RegionCount;
-  }
-
-  void addRegionCount(uint64_t Count) {
-    Mapped = true;
-    ExecutionCount = Count;
-  }
-};
-
-/// \brief A file manager that handles format-aware file creation.
-class CoveragePrinter {
-public:
-  struct StreamDestructor {
-    void operator()(raw_ostream *OS) const;
-  };
-
-  using OwnedStream = std::unique_ptr<raw_ostream, StreamDestructor>;
-
-protected:
-  const CoverageViewOptions &Opts;
-
-  CoveragePrinter(const CoverageViewOptions &Opts) : Opts(Opts) {}
-
-  /// \brief Return `OutputDir/ToplevelDir/Path.Extension`. If \p InToplevel is
-  /// false, skip the ToplevelDir component. If \p Relative is false, skip the
-  /// OutputDir component.
-  std::string getOutputPath(StringRef Path, StringRef Extension,
-                            bool InToplevel, bool Relative = true) const;
-
-  /// \brief If directory output is enabled, create a file in that directory
-  /// at the path given by getOutputPath(). Otherwise, return stdout.
-  Expected<OwnedStream> createOutputStream(StringRef Path, StringRef Extension,
-                                           bool InToplevel) const;
-
-  /// \brief Return the sub-directory name for file coverage reports.
-  static StringRef getCoverageDir() { return "coverage"; }
-
-public:
-  static std::unique_ptr<CoveragePrinter>
-  create(const CoverageViewOptions &Opts);
-
-  virtual ~CoveragePrinter() {}
-
-  /// @name File Creation Interface
-  /// @{
-
-  /// \brief Create a file to print a coverage view into.
-  virtual Expected<OwnedStream> createViewFile(StringRef Path,
-                                               bool InToplevel) = 0;
-
-  /// \brief Close a file which has been used to print a coverage view.
-  virtual void closeViewFile(OwnedStream OS) = 0;
-
-  /// \brief Create an index which lists reports for the given source files.
-  virtual Error createIndexFile(ArrayRef<std::string> SourceFiles,
-                                const coverage::CoverageMapping &Coverage) = 0;
-
-  /// @}
-};
-
-/// \brief A code coverage view of a source file or function.
-///
-/// A source coverage view and its nested sub-views form a file-oriented
-/// representation of code coverage data. This view can be printed out by a
-/// renderer which implements the Rendering Interface.
-class SourceCoverageView {
-  /// A function or file name.
-  StringRef SourceName;
-
-  /// A memory buffer backing the source on display.
-  const MemoryBuffer &File;
-
-  /// Various options to guide the coverage renderer.
-  const CoverageViewOptions &Options;
-
-  /// Complete coverage information about the source on display.
-  coverage::CoverageData CoverageInfo;
-
-  /// A container for all expansions (e.g macros) in the source on display.
-  std::vector<ExpansionView> ExpansionSubViews;
-
-  /// A container for all instantiations (e.g template functions) in the source
-  /// on display.
-  std::vector<InstantiationView> InstantiationSubViews;
-
-  /// Get the first uncovered line number for the source file.
-  unsigned getFirstUncoveredLineNo();
-
-protected:
-  struct LineRef {
-    StringRef Line;
-    int64_t LineNo;
-
-    LineRef(StringRef Line, int64_t LineNo) : Line(Line), LineNo(LineNo) {}
-  };
-
-  using CoverageSegmentArray = ArrayRef<const coverage::CoverageSegment *>;
-
-  /// @name Rendering Interface
-  /// @{
-
-  /// \brief Render a header for the view.
-  virtual void renderViewHeader(raw_ostream &OS) = 0;
-
-  /// \brief Render a footer for the view.
-  virtual void renderViewFooter(raw_ostream &OS) = 0;
-
-  /// \brief Render the source name for the view.
-  virtual void renderSourceName(raw_ostream &OS, bool WholeFile) = 0;
-
-  /// \brief Render the line prefix at the given \p ViewDepth.
-  virtual void renderLinePrefix(raw_ostream &OS, unsigned ViewDepth) = 0;
-
-  /// \brief Render the line suffix at the given \p ViewDepth.
-  virtual void renderLineSuffix(raw_ostream &OS, unsigned ViewDepth) = 0;
-
-  /// \brief Render a view divider at the given \p ViewDepth.
-  virtual void renderViewDivider(raw_ostream &OS, unsigned ViewDepth) = 0;
-
-  /// \brief Render a source line with highlighting.
-  virtual void renderLine(raw_ostream &OS, LineRef L,
-                          const coverage::CoverageSegment *WrappedSegment,
-                          CoverageSegmentArray Segments, unsigned ExpansionCol,
-                          unsigned ViewDepth) = 0;
-
-  /// \brief Render the line's execution count column.
-  virtual void renderLineCoverageColumn(raw_ostream &OS,
-                                        const LineCoverageStats &Line) = 0;
-
-  /// \brief Render the line number column.
-  virtual void renderLineNumberColumn(raw_ostream &OS, unsigned LineNo) = 0;
-
-  /// \brief Render all the region's execution counts on a line.
-  virtual void renderRegionMarkers(raw_ostream &OS,
-                                   CoverageSegmentArray Segments,
-                                   unsigned ViewDepth) = 0;
-
-  /// \brief Render the site of an expansion.
-  virtual void
-  renderExpansionSite(raw_ostream &OS, LineRef L,
-                      const coverage::CoverageSegment *WrappedSegment,
-                      CoverageSegmentArray Segments, unsigned ExpansionCol,
-                      unsigned ViewDepth) = 0;
-
-  /// \brief Render an expansion view and any nested views.
-  virtual void renderExpansionView(raw_ostream &OS, ExpansionView &ESV,
-                                   unsigned ViewDepth) = 0;
-
-  /// \brief Render an instantiation view and any nested views.
-  virtual void renderInstantiationView(raw_ostream &OS, InstantiationView &ISV,
-                                       unsigned ViewDepth) = 0;
-
-  /// \brief Render \p Title, a project title if one is available, and the
-  /// created time.
-  virtual void renderTitle(raw_ostream &OS, StringRef CellText) = 0;
-
-  /// \brief Render the table header for a given source file.
-  virtual void renderTableHeader(raw_ostream &OS, unsigned FirstUncoveredLineNo,
-                                 unsigned IndentLevel) = 0;
-
-  /// @}
-
-  /// \brief Format a count using engineering notation with 3 significant
-  /// digits.
-  static std::string formatCount(uint64_t N);
-
-  /// \brief Check if region marker output is expected for a line.
-  bool shouldRenderRegionMarkers(bool LineHasMultipleRegions) const;
-
-  /// \brief Check if there are any sub-views attached to this view.
-  bool hasSubViews() const;
-
-  SourceCoverageView(StringRef SourceName, const MemoryBuffer &File,
-                     const CoverageViewOptions &Options,
-                     coverage::CoverageData &&CoverageInfo)
-      : SourceName(SourceName), File(File), Options(Options),
-        CoverageInfo(std::move(CoverageInfo)) {}
-
-public:
-  static std::unique_ptr<SourceCoverageView>
-  create(StringRef SourceName, const MemoryBuffer &File,
-         const CoverageViewOptions &Options,
-         coverage::CoverageData &&CoverageInfo);
-
-  virtual ~SourceCoverageView() {}
-
-  /// \brief Return the source name formatted for the host OS.
-  std::string getSourceName() const;
-
-  const CoverageViewOptions &getOptions() const { return Options; }
-
-  /// \brief Add an expansion subview to this view.
-  void addExpansion(const coverage::CounterMappingRegion &Region,
-                    std::unique_ptr<SourceCoverageView> View);
-
-  /// \brief Add a function instantiation subview to this view.
-  void addInstantiation(StringRef FunctionName, unsigned Line,
-                        std::unique_ptr<SourceCoverageView> View);
-
-  /// \brief Print the code coverage information for a specific portion of a
-  /// source file to the output stream.
-  void print(raw_ostream &OS, bool WholeFile, bool ShowSourceName,
-             unsigned ViewDepth = 0);
-};
-
-} // namespace llvm
-
-#endif // LLVM_COV_SOURCECOVERAGEVIEW_H
diff --git a/tools/llvm-cov/SourceCoverageViewHTML.cpp b/tools/llvm-cov/SourceCoverageViewHTML.cpp
index 64b888e89d7..929b224b66b 100644
--- a/tools/llvm-cov/SourceCoverageViewHTML.cpp
+++ b/tools/llvm-cov/SourceCoverageViewHTML.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- SourceCoverageViewHTML.cpp - A html code coverage view -------------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -636,3 +637,5 @@ void SourceCoverageViewHTML::renderTableHeader(raw_ostream &OS,
      << SourceLabel;
   renderLineSuffix(OS, ViewDepth);
 }
+
+#endif
diff --git a/tools/llvm-cov/SourceCoverageViewHTML.h b/tools/llvm-cov/SourceCoverageViewHTML.h
deleted file mode 100644
index 94b08a5e7fc..00000000000
--- a/tools/llvm-cov/SourceCoverageViewHTML.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//===- SourceCoverageViewHTML.h - A html code coverage view ---------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file This file defines the interface to the html coverage renderer.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_SOURCECOVERAGEVIEWHTML_H
-#define LLVM_COV_SOURCECOVERAGEVIEWHTML_H
-
-#include "SourceCoverageView.h"
-
-namespace llvm {
-
-struct FileCoverageSummary;
-
-/// \brief A coverage printer for html output.
-class CoveragePrinterHTML : public CoveragePrinter {
-public:
-  Expected<OwnedStream> createViewFile(StringRef Path,
-                                       bool InToplevel) override;
-
-  void closeViewFile(OwnedStream OS) override;
-
-  Error createIndexFile(ArrayRef<std::string> SourceFiles,
-                        const coverage::CoverageMapping &Coverage) override;
-
-  CoveragePrinterHTML(const CoverageViewOptions &Opts)
-      : CoveragePrinter(Opts) {}
-
-private:
-  void emitFileSummary(raw_ostream &OS, StringRef SF,
-                       const FileCoverageSummary &FCS,
-                       bool IsTotals = false) const;
-};
-
-/// \brief A code coverage view which supports html-based rendering.
-class SourceCoverageViewHTML : public SourceCoverageView {
-  void renderViewHeader(raw_ostream &OS) override;
-
-  void renderViewFooter(raw_ostream &OS) override;
-
-  void renderSourceName(raw_ostream &OS, bool WholeFile) override;
-
-  void renderLinePrefix(raw_ostream &OS, unsigned ViewDepth) override;
-
-  void renderLineSuffix(raw_ostream &OS, unsigned ViewDepth) override;
-
-  void renderViewDivider(raw_ostream &OS, unsigned ViewDepth) override;
-
-  void renderLine(raw_ostream &OS, LineRef L,
-                  const coverage::CoverageSegment *WrappedSegment,
-                  CoverageSegmentArray Segments, unsigned ExpansionCol,
-                  unsigned ViewDepth) override;
-
-  void renderExpansionSite(raw_ostream &OS, LineRef L,
-                           const coverage::CoverageSegment *WrappedSegment,
-                           CoverageSegmentArray Segments, unsigned ExpansionCol,
-                           unsigned ViewDepth) override;
-
-  void renderExpansionView(raw_ostream &OS, ExpansionView &ESV,
-                           unsigned ViewDepth) override;
-
-  void renderInstantiationView(raw_ostream &OS, InstantiationView &ISV,
-                               unsigned ViewDepth) override;
-
-  void renderLineCoverageColumn(raw_ostream &OS,
-                                const LineCoverageStats &Line) override;
-
-  void renderLineNumberColumn(raw_ostream &OS, unsigned LineNo) override;
-
-  void renderRegionMarkers(raw_ostream &OS, CoverageSegmentArray Segments,
-                           unsigned ViewDepth) override;
-
-  void renderTitle(raw_ostream &OS, StringRef Title) override;
-
-  void renderTableHeader(raw_ostream &OS, unsigned FirstUncoveredLineNo,
-                         unsigned IndentLevel) override;
-
-public:
-  SourceCoverageViewHTML(StringRef SourceName, const MemoryBuffer &File,
-                         const CoverageViewOptions &Options,
-                         coverage::CoverageData &&CoverageInfo)
-      : SourceCoverageView(SourceName, File, Options, std::move(CoverageInfo)) {
-  }
-};
-
-} // namespace llvm
-
-#endif // LLVM_COV_SOURCECOVERAGEVIEWHTML_H
diff --git a/tools/llvm-cov/SourceCoverageViewText.cpp b/tools/llvm-cov/SourceCoverageViewText.cpp
index 4ad120f642e..03422a36a37 100644
--- a/tools/llvm-cov/SourceCoverageViewText.cpp
+++ b/tools/llvm-cov/SourceCoverageViewText.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- SourceCoverageViewText.cpp - A text-based code coverage view -------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -237,3 +238,5 @@ void SourceCoverageViewText::renderTitle(raw_ostream &OS, StringRef Title) {
 
 void SourceCoverageViewText::renderTableHeader(raw_ostream &, unsigned,
                                                unsigned) {}
+
+#endif
diff --git a/tools/llvm-cov/SourceCoverageViewText.h b/tools/llvm-cov/SourceCoverageViewText.h
deleted file mode 100644
index c3f20de9297..00000000000
--- a/tools/llvm-cov/SourceCoverageViewText.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//===- SourceCoverageViewText.h - A text-based code coverage view ---------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file This file defines the interface to the text-based coverage renderer.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_SOURCECOVERAGEVIEWTEXT_H
-#define LLVM_COV_SOURCECOVERAGEVIEWTEXT_H
-
-#include "SourceCoverageView.h"
-
-namespace llvm {
-
-/// \brief A coverage printer for text output.
-class CoveragePrinterText : public CoveragePrinter {
-public:
-  Expected<OwnedStream> createViewFile(StringRef Path,
-                                       bool InToplevel) override;
-
-  void closeViewFile(OwnedStream OS) override;
-
-  Error createIndexFile(ArrayRef<std::string> SourceFiles,
-                        const coverage::CoverageMapping &Coverage) override;
-
-  CoveragePrinterText(const CoverageViewOptions &Opts)
-      : CoveragePrinter(Opts) {}
-};
-
-/// \brief A code coverage view which supports text-based rendering.
-class SourceCoverageViewText : public SourceCoverageView {
-  void renderViewHeader(raw_ostream &OS) override;
-
-  void renderViewFooter(raw_ostream &OS) override;
-
-  void renderSourceName(raw_ostream &OS, bool WholeFile) override;
-
-  void renderLinePrefix(raw_ostream &OS, unsigned ViewDepth) override;
-
-  void renderLineSuffix(raw_ostream &OS, unsigned ViewDepth) override;
-
-  void renderViewDivider(raw_ostream &OS, unsigned ViewDepth) override;
-
-  void renderLine(raw_ostream &OS, LineRef L,
-                  const coverage::CoverageSegment *WrappedSegment,
-                  CoverageSegmentArray Segments, unsigned ExpansionCol,
-                  unsigned ViewDepth) override;
-
-  void renderExpansionSite(raw_ostream &OS, LineRef L,
-                           const coverage::CoverageSegment *WrappedSegment,
-                           CoverageSegmentArray Segments, unsigned ExpansionCol,
-                           unsigned ViewDepth) override;
-
-  void renderExpansionView(raw_ostream &OS, ExpansionView &ESV,
-                           unsigned ViewDepth) override;
-
-  void renderInstantiationView(raw_ostream &OS, InstantiationView &ISV,
-                               unsigned ViewDepth) override;
-
-  void renderLineCoverageColumn(raw_ostream &OS,
-                                const LineCoverageStats &Line) override;
-
-  void renderLineNumberColumn(raw_ostream &OS, unsigned LineNo) override;
-
-  void renderRegionMarkers(raw_ostream &OS, CoverageSegmentArray Segments,
-                           unsigned ViewDepth) override;
-
-  void renderTitle(raw_ostream &OS, StringRef Title) override;
-
-  void renderTableHeader(raw_ostream &OS, unsigned FirstUncoveredLineNo,
-                         unsigned IndentLevel) override;
-
-public:
-  SourceCoverageViewText(StringRef SourceName, const MemoryBuffer &File,
-                         const CoverageViewOptions &Options,
-                         coverage::CoverageData &&CoverageInfo)
-      : SourceCoverageView(SourceName, File, Options, std::move(CoverageInfo)) {
-  }
-};
-
-} // namespace llvm
-
-#endif // LLVM_COV_SOURCECOVERAGEVIEWTEXT_H
diff --git a/tools/llvm-cov/TestingSupport.cpp b/tools/llvm-cov/TestingSupport.cpp
index 72768f4fd58..89111d87b6e 100644
--- a/tools/llvm-cov/TestingSupport.cpp
+++ b/tools/llvm-cov/TestingSupport.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- TestingSupport.cpp - Convert objects files into test files --------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -90,3 +91,4 @@ int convertForTestingMain(int argc, const char *argv[]) {
 
   return 0;
 }
+#endif
diff --git a/tools/llvm-cov/gcov.cpp b/tools/llvm-cov/gcov.cpp
index 4652fed2a38..ee742efdc15 100644
--- a/tools/llvm-cov/gcov.cpp
+++ b/tools/llvm-cov/gcov.cpp
@@ -1,3 +1,4 @@
+#if 0
 //===- gcov.cpp - GCOV compatible LLVM coverage tool ----------------------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -143,3 +144,4 @@ int gcovMain(int argc, const char *argv[]) {
                    Options);
   return 0;
 }
+#endif
diff --git a/tools/llvm-cov/llvm-cov.cpp b/tools/llvm-cov/llvm-cov.cpp
index 15841587025..5103688cd7c 100644
--- a/tools/llvm-cov/llvm-cov.cpp
+++ b/tools/llvm-cov/llvm-cov.cpp
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#if 0
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Support/CommandLine.h"
@@ -57,8 +58,10 @@ static int versionMain(int argc, const char *argv[]) {
   cl::PrintVersionMessage();
   return 0;
 }
+#endif
 
 int main(int argc, const char **argv) {
+#if 0
   // Print a stack trace if we signal out.
   sys::PrintStackTraceOnErrorSignal(argv[0]);
   PrettyStackTraceProgram X(argc, argv);
@@ -96,5 +99,6 @@ int main(int argc, const char **argv) {
       errs().resetColor();
   }
   helpMain(argc, argv);
+#endif
   return 1;
 }
diff --git a/tools/llvm-profdata/llvm-profdata.cpp b/tools/llvm-profdata/llvm-profdata.cpp
index 6715566a166..cfcebbbb082 100644
--- a/tools/llvm-profdata/llvm-profdata.cpp
+++ b/tools/llvm-profdata/llvm-profdata.cpp
@@ -11,6 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#if 0
+
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
@@ -652,8 +654,10 @@ static int show_main(int argc, const char *argv[]) {
     return showSampleProfile(Filename, ShowCounts, ShowAllFunctions,
                              ShowFunction, OS);
 }
+#endif
 
 int main(int argc, const char *argv[]) {
+#if 0
   // Print a stack trace if we signal out.
   sys::PrintStackTraceOnErrorSignal(argv[0]);
   PrettyStackTraceProgram X(argc, argv);
@@ -692,5 +696,6 @@ int main(int argc, const char *argv[]) {
     errs() << ProgName << ": Unknown command!\n";
 
   errs() << "USAGE: " << ProgName << " <merge|show> [args...]\n";
+#endif
   return 1;
 }
diff --git a/tools/sancov/sancov.cc b/tools/sancov/sancov.cc
index ff2039de35e..abb924c3644 100644
--- a/tools/sancov/sancov.cc
+++ b/tools/sancov/sancov.cc
@@ -10,6 +10,7 @@
 // This file is a command-line tool for reading and analyzing sanitizer
 // coverage.
 //===----------------------------------------------------------------------===//
+#if 0
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/Twine.h"
@@ -1181,8 +1182,10 @@ readSymbolizeAndMergeCmdArguments(std::vector<std::string> FileNames) {
 }
 
 } // namespace
+#endif
 
 int main(int Argc, char **Argv) {
+#if 0
   // Print stack trace if we signal out.
   sys::PrintStackTraceOnErrorSignal(Argv[0]);
   PrettyStackTraceProgram X(Argc, Argv);
@@ -1236,4 +1239,6 @@ int main(int Argc, char **Argv) {
   case PrintCovPointsAction:
     llvm_unreachable("unsupported action");
   }
+#endif
+  return 1;
 }
diff --git a/unittests/Support/ThreadPool.cpp b/unittests/Support/ThreadPool.cpp
index 8e03aacfb1e..6ee0055c1ff 100644
--- a/unittests/Support/ThreadPool.cpp
+++ b/unittests/Support/ThreadPool.cpp
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#if 0
+
 #include "llvm/Support/ThreadPool.h"
 
 #include "llvm/ADT/STLExtras.h"
@@ -164,3 +166,5 @@ TEST_F(ThreadPoolTest, PoolDestruction) {
   }
   ASSERT_EQ(5, checked_in);
 }
+
+#endif
-- 
2.13.1