Skip to content

Commit fd38366

Browse files
authored
[BOLT][NFC] Clean includes, add license headers (#87200)
1 parent dc0cb17 commit fd38366

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+71
-86
lines changed

bolt/include/bolt/Core/AddressMap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#ifndef BOLT_CORE_ADDRESS_MAP_H
1515
#define BOLT_CORE_ADDRESS_MAP_H
1616

17-
#include "llvm/ADT/StringRef.h"
1817
#include "llvm/MC/MCSymbol.h"
1918

2019
#include <optional>

bolt/include/bolt/Core/BinaryData.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "llvm/ADT/Twine.h"
1919
#include "llvm/MC/MCSymbol.h"
2020
#include "llvm/Support/raw_ostream.h"
21-
#include <algorithm>
2221
#include <string>
2322
#include <vector>
2423

bolt/include/bolt/Core/BinaryDomTree.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "bolt/Core/BinaryBasicBlock.h"
1818
#include "llvm/IR/Dominators.h"
19-
#include "llvm/Support/GenericDomTreeConstruction.h"
2019

2120
namespace llvm {
2221
namespace bolt {

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#include <iterator>
5353
#include <limits>
5454
#include <unordered_map>
55-
#include <unordered_set>
5655
#include <utility>
5756
#include <vector>
5857

bolt/include/bolt/Core/BinaryLoop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef BOLT_CORE_BINARY_LOOP_H
1616
#define BOLT_CORE_BINARY_LOOP_H
1717

18-
#include "llvm/Support/GenericLoopInfoImpl.h"
18+
#include "llvm/Support/GenericLoopInfo.h"
1919

2020
namespace llvm {
2121
namespace bolt {

bolt/include/bolt/Core/BinarySection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "bolt/Core/DebugData.h"
1919
#include "bolt/Core/Relocation.h"
2020
#include "llvm/ADT/ArrayRef.h"
21-
#include "llvm/ADT/STLExtras.h"
2221
#include "llvm/BinaryFormat/ELF.h"
2322
#include "llvm/Object/ELFObjectFile.h"
2423
#include "llvm/Object/MachO.h"

bolt/include/bolt/Core/DebugData.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <mutex>
2828
#include <string>
2929
#include <unordered_map>
30-
#include <unordered_set>
3130
#include <utility>
3231
#include <vector>
3332

bolt/include/bolt/Core/DebugNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef BOLT_CORE_DEBUG_NAMES_H
1515
#define BOLT_CORE_DEBUG_NAMES_H
1616

17-
#include "DebugData.h"
17+
#include "bolt/Core/DebugData.h"
1818
#include "llvm/CodeGen/AccelTable.h"
1919

2020
namespace llvm {

bolt/include/bolt/Core/FunctionLayout.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "llvm/ADT/iterator.h"
2626
#include "llvm/ADT/iterator_range.h"
2727
#include <iterator>
28-
#include <utility>
2928

3029
namespace llvm {
3130
namespace bolt {

bolt/include/bolt/Core/MCPlus.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
#ifndef BOLT_CORE_MCPLUS_H
1515
#define BOLT_CORE_MCPLUS_H
1616

17-
#include "llvm/CodeGen/TargetOpcodes.h"
1817
#include "llvm/MC/MCExpr.h"
1918
#include "llvm/MC/MCInst.h"
20-
#include "llvm/Support/Casting.h"
2119
#include <vector>
2220

2321
namespace llvm {

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "llvm/ADT/ArrayRef.h"
2020
#include "llvm/ADT/BitVector.h"
2121
#include "llvm/ADT/StringMap.h"
22+
#include "llvm/CodeGen/TargetOpcodes.h"
2223
#include "llvm/MC/MCAsmBackend.h"
2324
#include "llvm/MC/MCDisassembler/MCSymbolizer.h"
2425
#include "llvm/MC/MCExpr.h"
@@ -27,6 +28,7 @@
2728
#include "llvm/MC/MCInstrDesc.h"
2829
#include "llvm/MC/MCInstrInfo.h"
2930
#include "llvm/Support/Allocator.h"
31+
#include "llvm/Support/Casting.h"
3032
#include "llvm/Support/ErrorHandling.h"
3133
#include "llvm/Support/ErrorOr.h"
3234
#include "llvm/Support/RWMutex.h"

bolt/include/bolt/Passes/BinaryPasses.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "bolt/Core/DynoStats.h"
1919
#include "llvm/Support/CommandLine.h"
2020
#include <atomic>
21-
#include <map>
2221
#include <set>
2322
#include <string>
2423
#include <unordered_set>

bolt/include/bolt/Passes/CacheMetrics.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#ifndef BOLT_PASSES_CACHEMETRICS_H
1414
#define BOLT_PASSES_CACHEMETRICS_H
1515

16-
#include <cstdint>
1716
#include <vector>
1817

1918
namespace llvm {

bolt/include/bolt/Passes/DominatorAnalysis.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include "bolt/Passes/DataflowAnalysis.h"
1313
#include "llvm/Support/CommandLine.h"
14-
#include "llvm/Support/Timer.h"
1514

1615
namespace opts {
1716
extern llvm::cl::opt<bool> TimeOpts;

bolt/include/bolt/Passes/ReachingDefOrUse.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
#include "bolt/Passes/DataflowAnalysis.h"
1313
#include "bolt/Passes/RegAnalysis.h"
14-
#include "llvm/MC/MCRegisterInfo.h"
1514
#include "llvm/Support/CommandLine.h"
16-
#include "llvm/Support/Timer.h"
1715
#include <optional>
1816

1917
namespace opts {

bolt/include/bolt/Passes/ReachingInsns.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include "bolt/Passes/DataflowAnalysis.h"
1313
#include "llvm/Support/CommandLine.h"
14-
#include "llvm/Support/Timer.h"
1514

1615
namespace opts {
1716
extern llvm::cl::opt<bool> TimeOpts;

bolt/include/bolt/Passes/ReorderUtils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#ifndef BOLT_PASSES_REORDER_UTILS_H
1515
#define BOLT_PASSES_REORDER_UTILS_H
1616

17-
#include <memory>
1817
#include <vector>
1918

2019
#include "llvm/ADT/BitVector.h"

bolt/include/bolt/Profile/ProfileReaderBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ProfileReaderBase {
6565
/// Return true if the function \p BF may have a profile available.
6666
/// The result is based on the name(s) of the function alone and the profile
6767
/// match is not guaranteed.
68-
virtual bool mayHaveProfileData(const BinaryFunction &BF);
68+
virtual bool mayHaveProfileData(const BinaryFunction &BF) { return true; }
6969

7070
/// Return true if the profile contains an entry for a local object
7171
/// that has an associated file name.

bolt/include/bolt/Profile/ProfileYAMLMapping.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#define BOLT_PROFILE_PROFILEYAMLMAPPING_H
1515

1616
#include "bolt/Core/BinaryFunction.h"
17-
#include "llvm/ADT/StringRef.h"
1817
#include "llvm/Support/YAMLTraits.h"
1918
#include <vector>
2019

bolt/include/bolt/Rewrite/DWARFRewriter.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
#include <memory>
2323
#include <mutex>
2424
#include <optional>
25-
#include <set>
2625
#include <unordered_map>
27-
#include <unordered_set>
2826
#include <vector>
2927

3028
namespace llvm {

bolt/include/bolt/Rewrite/MetadataManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include "bolt/Rewrite/MetadataRewriter.h"
1313
#include "llvm/ADT/SmallVector.h"
14-
#include "llvm/Support/Error.h"
1514

1615
namespace llvm {
1716
namespace bolt {

bolt/include/bolt/Rewrite/RewriteInstance.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "bolt/Core/Linker.h"
1818
#include "bolt/Rewrite/MetadataManager.h"
1919
#include "bolt/Utils/NameResolver.h"
20-
#include "llvm/ADT/ArrayRef.h"
2120
#include "llvm/MC/StringTableBuilder.h"
2221
#include "llvm/Object/ELFObjectFile.h"
2322
#include "llvm/Object/ObjectFile.h"

bolt/include/bolt/RuntimeLibs/RuntimeLibrary.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include "bolt/Core/Linker.h"
1919
#include "llvm/ADT/StringRef.h"
20-
#include <functional>
2120
#include <vector>
2221

2322
namespace llvm {

bolt/include/bolt/Utils/NameShortener.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#define BOLT_UTILS_NAME_SHORTENER_H
1515

1616
#include "llvm/ADT/StringMap.h"
17-
#include "llvm/ADT/Twine.h"
1817

1918
namespace llvm {
2019
namespace bolt {

bolt/lib/Core/BinaryContext.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "bolt/Core/BinaryEmitter.h"
1515
#include "bolt/Core/BinaryFunction.h"
1616
#include "bolt/Utils/CommandLineOpts.h"
17-
#include "bolt/Utils/NameResolver.h"
1817
#include "bolt/Utils/Utils.h"
1918
#include "llvm/ADT/STLExtras.h"
2019
#include "llvm/ADT/Twine.h"
@@ -39,7 +38,6 @@
3938
#include <algorithm>
4039
#include <functional>
4140
#include <iterator>
42-
#include <numeric>
4341
#include <unordered_set>
4442

4543
using namespace llvm;

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "llvm/Object/ObjectFile.h"
3535
#include "llvm/Support/CommandLine.h"
3636
#include "llvm/Support/Debug.h"
37+
#include "llvm/Support/GenericDomTreeConstruction.h"
38+
#include "llvm/Support/GenericLoopInfoImpl.h"
3739
#include "llvm/Support/GraphWriter.h"
3840
#include "llvm/Support/LEB128.h"
3941
#include "llvm/Support/Regex.h"

bolt/lib/Core/DIEBuilder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "llvm/Support/Casting.h"
2323
#include "llvm/Support/Debug.h"
2424
#include "llvm/Support/ErrorHandling.h"
25-
#include "llvm/Support/Format.h"
2625
#include "llvm/Support/LEB128.h"
2726

2827
#include <algorithm>

bolt/lib/Core/DebugData.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "bolt/Core/DebugData.h"
1414
#include "bolt/Core/BinaryContext.h"
1515
#include "bolt/Core/DIEBuilder.h"
16-
#include "bolt/Rewrite/RewriteInstance.h"
1716
#include "bolt/Utils/Utils.h"
1817
#include "llvm/BinaryFormat/Dwarf.h"
1918
#include "llvm/CodeGen/DIE.h"
@@ -23,7 +22,6 @@
2322
#include "llvm/MC/MCAssembler.h"
2423
#include "llvm/MC/MCContext.h"
2524
#include "llvm/MC/MCObjectStreamer.h"
26-
#include "llvm/Support/Allocator.h"
2725
#include "llvm/Support/CommandLine.h"
2826
#include "llvm/Support/EndianStream.h"
2927
#include "llvm/Support/LEB128.h"
@@ -32,7 +30,6 @@
3230
#include <cassert>
3331
#include <cstdint>
3432
#include <functional>
35-
#include <limits>
3633
#include <memory>
3734
#include <unordered_map>
3835
#include <vector>

bolt/lib/Core/FunctionLayout.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
//===- bolt/Core/FunctionLayout.cpp - Fragmented Function Layout -*- C++ -*-==//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
19
#include "bolt/Core/FunctionLayout.h"
2-
#include "bolt/Core/BinaryFunction.h"
10+
#include "bolt/Core/BinaryBasicBlock.h"
311
#include "llvm/ADT/STLExtras.h"
412
#include "llvm/ADT/edit_distance.h"
513
#include <algorithm>
6-
#include <cstddef>
7-
#include <functional>
814
#include <iterator>
9-
#include <memory>
1015

1116
using namespace llvm;
1217
using namespace bolt;

bolt/lib/Core/HashUtilities.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include "bolt/Core/HashUtilities.h"
1414
#include "bolt/Core/BinaryContext.h"
15-
#include "bolt/Core/BinaryFunction.h"
1615
#include "llvm/MC/MCInstPrinter.h"
1716

1817
namespace llvm {

bolt/lib/Core/MCPlusBuilder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "llvm/Support/CommandLine.h"
2323
#include "llvm/Support/Debug.h"
2424
#include <cstdint>
25-
#include <queue>
2625

2726
#define DEBUG_TYPE "mcplus"
2827

bolt/lib/Passes/CMOVConversion.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "llvm/ADT/PostOrderIterator.h"
1818
#include "llvm/Support/CommandLine.h"
1919
#include "llvm/Support/ErrorHandling.h"
20-
#include <numeric>
2120

2221
#define DEBUG_TYPE "cmov"
2322

bolt/lib/Passes/FixRISCVCallsPass.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
//===- bolt/Passes/FixRISCVCallsPass.cpp ------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
19
#include "bolt/Passes/FixRISCVCallsPass.h"
210
#include "bolt/Core/ParallelUtilities.h"
311

bolt/lib/Passes/FixRelaxationPass.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
//===- bolt/Passes/FixRelaxationPass.cpp ------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
19
#include "bolt/Passes/FixRelaxationPass.h"
210
#include "bolt/Core/ParallelUtilities.h"
311

bolt/lib/Passes/FrameOptimizer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "bolt/Utils/CommandLineOpts.h"
2121
#include "llvm/Support/Timer.h"
2222
#include <deque>
23-
#include <unordered_map>
2423

2524
#define DEBUG_TYPE "fop"
2625

bolt/lib/Passes/Hugify.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "bolt/Passes/Hugify.h"
10-
#include "llvm/Support/CommandLine.h"
1110

1211
#define DEBUG_TYPE "bolt-hugify"
1312

bolt/lib/Passes/Inliner.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "bolt/Passes/Inliner.h"
2828
#include "bolt/Core/MCPlus.h"
2929
#include "llvm/Support/CommandLine.h"
30-
#include <map>
3130

3231
#define DEBUG_TYPE "bolt-inliner"
3332

bolt/lib/Passes/ShrinkWrapping.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "bolt/Passes/ShrinkWrapping.h"
14-
#include "bolt/Core/MCPlus.h"
1514
#include "bolt/Passes/DataflowInfoManager.h"
1615
#include "bolt/Passes/MCF.h"
1716
#include "bolt/Utils/CommandLineOpts.h"

bolt/lib/Passes/SplitFunctions.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "bolt/Core/ParallelUtilities.h"
1818
#include "bolt/Utils/CommandLineOpts.h"
1919
#include "llvm/ADT/STLExtras.h"
20-
#include "llvm/ADT/Sequence.h"
2120
#include "llvm/ADT/SmallVector.h"
2221
#include "llvm/ADT/iterator_range.h"
2322
#include "llvm/Support/CommandLine.h"

bolt/lib/Passes/TailDuplication.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "bolt/Passes/TailDuplication.h"
1414
#include "llvm/ADT/DenseMap.h"
1515
#include "llvm/MC/MCRegisterInfo.h"
16-
#include <queue>
1716

1817
#include <numeric>
18+
#include <queue>
1919

2020
#define DEBUG_TYPE "taildup"
2121

bolt/lib/Passes/ValidateInternalCalls.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "bolt/Core/BinaryBasicBlock.h"
1515
#include "bolt/Passes/DataflowInfoManager.h"
1616
#include "bolt/Passes/FrameAnalysis.h"
17-
#include "llvm/ADT/SmallVector.h"
1817
#include "llvm/MC/MCInstPrinter.h"
1918
#include <optional>
2019
#include <queue>

0 commit comments

Comments
 (0)