Skip to content

Commit 4518980

Browse files
[Instrumentation] Move out to Utils (NFC)
Utility functions have been moved out to Utils.
1 parent c0e308b commit 4518980

26 files changed

+25
-26
lines changed

clang/lib/CodeGen/BackendUtil.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
#include "llvm/Transforms/IPO/LowerTypeTests.h"
6565
#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
6666
#include "llvm/Transforms/InstCombine/InstCombine.h"
67-
#include "llvm/Transforms/Instrumentation.h"
6867
#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
6968
#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
7069
#include "llvm/Transforms/Instrumentation/BoundsChecking.h"

llvm/include/llvm/Passes/PassBuilder.h

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "llvm/Support/raw_ostream.h"
2626
#include "llvm/Transforms/IPO/Inliner.h"
2727
#include "llvm/Transforms/IPO/ModuleInliner.h"
28-
#include "llvm/Transforms/Instrumentation.h"
2928
#include "llvm/Transforms/Scalar/LoopPassManager.h"
3029
#include <optional>
3130
#include <vector>

llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define LLVM_TRANSFORMS_INSTRUMENTATION_GCOVPROFILER_H
1414

1515
#include "llvm/IR/PassManager.h"
16-
#include "llvm/Transforms/Instrumentation.h"
16+
#include "llvm/Transforms/Utils/Instrumentation.h"
1717

1818
namespace llvm {
1919
/// The gcov-style instrumentation pass

llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define LLVM_TRANSFORMS_INSTRUMENTATION_INSTRPROFILING_H
1515

1616
#include "llvm/IR/PassManager.h"
17-
#include "llvm/Transforms/Instrumentation.h"
17+
#include "llvm/Transforms/Utils/Instrumentation.h"
1818

1919
namespace llvm {
2020

llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "llvm/IR/Function.h"
1717
#include "llvm/IR/Module.h"
1818
#include "llvm/IR/PassManager.h"
19-
#include "llvm/Transforms/Instrumentation.h"
19+
#include "llvm/Transforms/Utils/Instrumentation.h"
2020

2121
namespace llvm {
2222

llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "llvm/IR/PassManager.h"
1919
#include "llvm/Support/SpecialCaseList.h"
2020
#include "llvm/Support/VirtualFileSystem.h"
21-
#include "llvm/Transforms/Instrumentation.h"
21+
#include "llvm/Transforms/Utils/Instrumentation.h"
2222

2323
namespace llvm {
2424
class Module;

llvm/lib/Passes/PassBuilder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@
183183
#include "llvm/Transforms/IPO/StripSymbols.h"
184184
#include "llvm/Transforms/IPO/WholeProgramDevirt.h"
185185
#include "llvm/Transforms/InstCombine/InstCombine.h"
186-
#include "llvm/Transforms/Instrumentation.h"
187186
#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
188187
#include "llvm/Transforms/Instrumentation/BoundsChecking.h"
189188
#include "llvm/Transforms/Instrumentation/CGProfile.h"
@@ -299,6 +298,7 @@
299298
#include "llvm/Transforms/Utils/HelloWorld.h"
300299
#include "llvm/Transforms/Utils/InjectTLIMappings.h"
301300
#include "llvm/Transforms/Utils/InstructionNamer.h"
301+
#include "llvm/Transforms/Utils/Instrumentation.h"
302302
#include "llvm/Transforms/Utils/LCSSA.h"
303303
#include "llvm/Transforms/Utils/LibCallsShrinkWrap.h"
304304
#include "llvm/Transforms/Utils/LoopSimplify.h"

llvm/lib/Transforms/IPO/SampleProfile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
#include "llvm/Transforms/IPO/SampleContextTracker.h"
7474
#include "llvm/Transforms/IPO/SampleProfileMatcher.h"
7575
#include "llvm/Transforms/IPO/SampleProfileProbe.h"
76-
#include "llvm/Transforms/Instrumentation.h"
7776
#include "llvm/Transforms/Utils/CallPromotionUtils.h"
7877
#include "llvm/Transforms/Utils/Cloning.h"
78+
#include "llvm/Transforms/Utils/Instrumentation.h"
7979
#include "llvm/Transforms/Utils/MisExpect.h"
8080
#include "llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h"
8181
#include "llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h"

llvm/lib/Transforms/IPO/SampleProfileProbe.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "llvm/Support/CRC.h"
3030
#include "llvm/Support/CommandLine.h"
3131
#include "llvm/Target/TargetMachine.h"
32-
#include "llvm/Transforms/Instrumentation.h"
32+
#include "llvm/Transforms/Utils/Instrumentation.h"
3333
#include "llvm/Transforms/Utils/ModuleUtils.h"
3434
#include <unordered_set>
3535
#include <vector>

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@
7171
#include "llvm/Support/MathExtras.h"
7272
#include "llvm/Support/raw_ostream.h"
7373
#include "llvm/TargetParser/Triple.h"
74-
#include "llvm/Transforms/Instrumentation.h"
7574
#include "llvm/Transforms/Instrumentation/AddressSanitizerCommon.h"
7675
#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
7776
#include "llvm/Transforms/Utils/ASanStackFrameLayout.h"
7877
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
78+
#include "llvm/Transforms/Utils/Instrumentation.h"
7979
#include "llvm/Transforms/Utils/Local.h"
8080
#include "llvm/Transforms/Utils/ModuleUtils.h"
8181
#include "llvm/Transforms/Utils/PromoteMemToReg.h"

llvm/lib/Transforms/Instrumentation/CGProfile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "llvm/IR/Module.h"
1818
#include "llvm/IR/PassManager.h"
1919
#include "llvm/ProfileData/InstrProf.h"
20-
#include "llvm/Transforms/Instrumentation.h"
20+
#include "llvm/Transforms/Utils/Instrumentation.h"
2121
#include <optional>
2222

2323
using namespace llvm;

llvm/lib/Transforms/Instrumentation/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ add_llvm_component_library(LLVMInstrumentation
1010
MemorySanitizer.cpp
1111
NumericalStabilitySanitizer.cpp
1212
IndirectCallPromotion.cpp
13-
Instrumentation.cpp
1413
InstrOrderFile.cpp
1514
InstrProfiling.cpp
1615
KCFI.cpp

llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@
104104
#include "llvm/Support/SpecialCaseList.h"
105105
#include "llvm/Support/VirtualFileSystem.h"
106106
#include "llvm/TargetParser/Triple.h"
107-
#include "llvm/Transforms/Instrumentation.h"
108107
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
108+
#include "llvm/Transforms/Utils/Instrumentation.h"
109109
#include "llvm/Transforms/Utils/Local.h"
110110
#include <algorithm>
111111
#include <cassert>

llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
#include "llvm/Support/Path.h"
3737
#include "llvm/Support/Regex.h"
3838
#include "llvm/Support/raw_ostream.h"
39-
#include "llvm/Transforms/Instrumentation.h"
4039
#include "llvm/Transforms/Instrumentation/CFGMST.h"
4140
#include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
41+
#include "llvm/Transforms/Utils/Instrumentation.h"
4242
#include "llvm/Transforms/Utils/ModuleUtils.h"
4343
#include <algorithm>
4444
#include <memory>

llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
#include "llvm/Support/RandomNumberGenerator.h"
5858
#include "llvm/Support/raw_ostream.h"
5959
#include "llvm/TargetParser/Triple.h"
60-
#include "llvm/Transforms/Instrumentation.h"
6160
#include "llvm/Transforms/Instrumentation/AddressSanitizerCommon.h"
6261
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
62+
#include "llvm/Transforms/Utils/Instrumentation.h"
6363
#include "llvm/Transforms/Utils/Local.h"
6464
#include "llvm/Transforms/Utils/MemoryTaggingSupport.h"
6565
#include "llvm/Transforms/Utils/ModuleUtils.h"

llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
#include "llvm/Support/Debug.h"
3838
#include "llvm/Support/Error.h"
3939
#include "llvm/Support/raw_ostream.h"
40-
#include "llvm/Transforms/Instrumentation.h"
4140
#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
4241
#include "llvm/Transforms/Utils/CallPromotionUtils.h"
42+
#include "llvm/Transforms/Utils/Instrumentation.h"
4343
#include <cassert>
4444
#include <cstdint>
4545
#include <memory>

llvm/lib/Transforms/Instrumentation/InstrOrderFile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "llvm/Support/CommandLine.h"
2020
#include "llvm/Support/FileSystem.h"
2121
#include "llvm/Support/raw_ostream.h"
22-
#include "llvm/Transforms/Instrumentation.h"
22+
#include "llvm/Transforms/Utils/Instrumentation.h"
2323
#include <fstream>
2424
#include <mutex>
2525
#include <sstream>

llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
#include "llvm/Support/Error.h"
5151
#include "llvm/Support/ErrorHandling.h"
5252
#include "llvm/TargetParser/Triple.h"
53-
#include "llvm/Transforms/Instrumentation.h"
5453
#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
5554
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
55+
#include "llvm/Transforms/Utils/Instrumentation.h"
5656
#include "llvm/Transforms/Utils/ModuleUtils.h"
5757
#include "llvm/Transforms/Utils/SSAUpdater.h"
5858
#include <algorithm>

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@
198198
#include "llvm/Support/MathExtras.h"
199199
#include "llvm/Support/raw_ostream.h"
200200
#include "llvm/TargetParser/Triple.h"
201-
#include "llvm/Transforms/Instrumentation.h"
202201
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
202+
#include "llvm/Transforms/Utils/Instrumentation.h"
203203
#include "llvm/Transforms/Utils/Local.h"
204204
#include "llvm/Transforms/Utils/ModuleUtils.h"
205205
#include <algorithm>

llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
#include "llvm/Support/MathExtras.h"
3939
#include "llvm/Support/Regex.h"
4040
#include "llvm/Support/raw_ostream.h"
41-
#include "llvm/Transforms/Instrumentation.h"
4241
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
4342
#include "llvm/Transforms/Utils/EscapeEnumerator.h"
43+
#include "llvm/Transforms/Utils/Instrumentation.h"
4444
#include "llvm/Transforms/Utils/Local.h"
4545
#include "llvm/Transforms/Utils/ModuleUtils.h"
4646

llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@
107107
#include "llvm/Support/VirtualFileSystem.h"
108108
#include "llvm/Support/raw_ostream.h"
109109
#include "llvm/TargetParser/Triple.h"
110-
#include "llvm/Transforms/Instrumentation.h"
111110
#include "llvm/Transforms/Instrumentation/BlockCoverageInference.h"
112111
#include "llvm/Transforms/Instrumentation/CFGMST.h"
113112
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
113+
#include "llvm/Transforms/Utils/Instrumentation.h"
114114
#include "llvm/Transforms/Utils/MisExpect.h"
115115
#include "llvm/Transforms/Utils/ModuleUtils.h"
116116
#include <algorithm>

llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
#include "llvm/Support/Debug.h"
4343
#include "llvm/Support/MathExtras.h"
4444
#include "llvm/Support/raw_ostream.h"
45-
#include "llvm/Transforms/Instrumentation.h"
4645
#include "llvm/Transforms/Utils/EscapeEnumerator.h"
46+
#include "llvm/Transforms/Utils/Instrumentation.h"
4747
#include "llvm/Transforms/Utils/Local.h"
4848
#include "llvm/Transforms/Utils/ModuleUtils.h"
4949

llvm/lib/Transforms/Utils/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ add_llvm_component_library(LLVMTransformUtils
3535
InlineFunction.cpp
3636
InjectTLIMappings.cpp
3737
InstructionNamer.cpp
38+
Instrumentation.cpp
3839
IntegerDivision.cpp
3940
LCSSA.cpp
4041
LibCallsShrinkWrap.cpp

llvm/lib/Transforms/Instrumentation/Instrumentation.cpp renamed to llvm/lib/Transforms/Utils/Instrumentation.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#include "llvm/Transforms/Instrumentation.h"
14+
#include "llvm/Transforms/Utils/Instrumentation.h"
1515
#include "llvm/IR/DiagnosticInfo.h"
1616
#include "llvm/IR/DiagnosticPrinter.h"
1717
#include "llvm/IR/IntrinsicInst.h"
@@ -41,7 +41,8 @@ bool llvm::checkIfAlreadyInstrumented(Module &M, StringRef Flag) {
4141
}
4242

4343
/// Moves I before IP. Returns new insert point.
44-
static BasicBlock::iterator moveBeforeInsertPoint(BasicBlock::iterator I, BasicBlock::iterator IP) {
44+
static BasicBlock::iterator moveBeforeInsertPoint(BasicBlock::iterator I,
45+
BasicBlock::iterator IP) {
4546
// If I is IP, move the insert point down.
4647
if (I == IP) {
4748
++IP;
@@ -93,7 +94,8 @@ GlobalVariable *llvm::createPrivateGlobalForString(Module &M, StringRef Str,
9394
}
9495

9596
Comdat *llvm::getOrCreateFunctionComdat(Function &F, Triple &T) {
96-
if (auto Comdat = F.getComdat()) return Comdat;
97+
if (auto Comdat = F.getComdat())
98+
return Comdat;
9799
assert(F.hasName());
98100
Module *M = F.getParent();
99101

llvm/tools/lli/lli.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
#include "llvm/Support/WithColor.h"
6767
#include "llvm/Support/raw_ostream.h"
6868
#include "llvm/TargetParser/Triple.h"
69-
#include "llvm/Transforms/Instrumentation.h"
7069
#include <cerrno>
7170
#include <optional>
7271

0 commit comments

Comments
 (0)