From b72b56016a6b586a22a49f145c924c03e4239b1d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 21 Nov 2021 18:14:30 -0800 Subject: [PATCH] NFC: clang-format lib/Transforms/Instrumentation/InstrProfiling.cpp Differential Revision: https://reviews.llvm.org/D114343 --- .../Instrumentation/InstrProfiling.cpp | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp index 36a66e096382..b51193d610f6 100644 --- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp @@ -64,10 +64,10 @@ cl::opt DoHashBasedCounterSplit( cl::desc("Rename counter variable of a comdat function based on cfg hash"), cl::init(true)); -cl::opt RuntimeCounterRelocation( - "runtime-counter-relocation", - cl::desc("Enable relocating counters at runtime."), - cl::init(false)); +cl::opt + RuntimeCounterRelocation("runtime-counter-relocation", + cl::desc("Enable relocating counters at runtime."), + cl::init(false)); cl::opt ValueProfileStaticAlloc( "vp-static-alloc", @@ -331,8 +331,9 @@ private: // Check whether the loop satisfies the basic conditions needed to perform // Counter Promotions. - bool isPromotionPossible(Loop *LP, - const SmallVectorImpl &LoopExitBlocks) { + bool + isPromotionPossible(Loop *LP, + const SmallVectorImpl &LoopExitBlocks) { // We can't insert into a catchswitch. if (llvm::any_of(LoopExitBlocks, [](BasicBlock *Exit) { return isa(Exit->getTerminator()); @@ -421,13 +422,13 @@ PreservedAnalyses InstrProfiling::run(Module &M, ModuleAnalysisManager &AM) { } char InstrProfilingLegacyPass::ID = 0; -INITIALIZE_PASS_BEGIN( - InstrProfilingLegacyPass, "instrprof", - "Frontend instrumentation-based coverage lowering.", false, false) +INITIALIZE_PASS_BEGIN(InstrProfilingLegacyPass, "instrprof", + "Frontend instrumentation-based coverage lowering.", + false, false) INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass) -INITIALIZE_PASS_END( - InstrProfilingLegacyPass, "instrprof", - "Frontend instrumentation-based coverage lowering.", false, false) +INITIALIZE_PASS_END(InstrProfilingLegacyPass, "instrprof", + "Frontend instrumentation-based coverage lowering.", false, + false) ModulePass * llvm::createInstrProfilingLegacyPass(const InstrProfOptions &Options, @@ -703,14 +704,15 @@ void InstrProfiling::lowerIncrement(InstrProfIncrementInst *Inc) { LoadInst *LI = dyn_cast(&I); if (!LI) { IRBuilder<> Builder(&I); - GlobalVariable *Bias = M->getGlobalVariable(getInstrProfCounterBiasVarName()); + GlobalVariable *Bias = + M->getGlobalVariable(getInstrProfCounterBiasVarName()); if (!Bias) { // Compiler must define this variable when runtime counter relocation // is being used. Runtime has a weak external reference that is used // to check whether that's the case or not. - Bias = new GlobalVariable(*M, Int64Ty, false, GlobalValue::LinkOnceODRLinkage, - Constant::getNullValue(Int64Ty), - getInstrProfCounterBiasVarName()); + Bias = new GlobalVariable( + *M, Int64Ty, false, GlobalValue::LinkOnceODRLinkage, + Constant::getNullValue(Int64Ty), getInstrProfCounterBiasVarName()); Bias->setVisibility(GlobalVariable::HiddenVisibility); // A definition that's weak (linkonce_odr) without being in a COMDAT // section wouldn't lead to link errors, but it would lead to a dead @@ -839,8 +841,7 @@ static bool needsRuntimeRegistrationOfSectionRange(const Triple &TT) { return false; // Use linker script magic to get data/cnts/name start/end. if (TT.isOSLinux() || TT.isOSFreeBSD() || TT.isOSNetBSD() || - TT.isOSSolaris() || TT.isOSFuchsia() || TT.isPS4CPU() || - TT.isOSWindows()) + TT.isOSSolaris() || TT.isOSFuchsia() || TT.isPS4CPU() || TT.isOSWindows()) return false; return true; @@ -1078,8 +1079,8 @@ void InstrProfiling::emitNameData() { } auto &Ctx = M->getContext(); - auto *NamesVal = ConstantDataArray::getString( - Ctx, StringRef(CompressedNameStr), false); + auto *NamesVal = + ConstantDataArray::getString(Ctx, StringRef(CompressedNameStr), false); NamesVar = new GlobalVariable(*M, NamesVal->getType(), true, GlobalValue::PrivateLinkage, NamesVal, getInstrProfNamesVarName());