[clang] [clang-tools-extra] [compiler-rt] [flang] [libclc] [libcxx] [lld] [lldb] [llvm] [NFC] Remove trailing whitespace across all non-test related files (PR #82838)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 23 14:46:01 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 69c0b2febe01108f50db6e8ed21cd8b2e6088caf c55b5f4dad60114522c6082a7f31625f8c9d59a0 -- clang-tools-extra/clang-tidy/abseil/DurationDivisionCheck.h clang-tools-extra/clang-tidy/abseil/RedundantStrcatCallsCheck.cpp clang-tools-extra/clang-tidy/abseil/RedundantStrcatCallsCheck.h clang-tools-extra/clang-tidy/abseil/StrCatAppendCheck.cpp clang-tools-extra/clang-tidy/abseil/StrCatAppendCheck.h clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.h clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.h clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp clang-tools-extra/clangd/ClangdLSPServer.h clang-tools-extra/clangd/CodeComplete.cpp clang-tools-extra/clangd/IncludeCleaner.cpp clang-tools-extra/clangd/Protocol.h clang-tools-extra/clangd/refactor/tweaks/PopulateSwitch.cpp clang-tools-extra/clangd/tool/Check.cpp clang-tools-extra/pseudo/gen/Main.cpp clang/examples/PrintFunctionNames/PrintFunctionNames.cpp clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp clang/tools/diagtool/DiagTool.cpp clang/tools/diagtool/DiagTool.h clang/tools/diagtool/diagtool_main.cpp clang/tools/libclang/ARCMigrate.cpp clang/tools/libclang/CIndexCXX.cpp clang/tools/libclang/CIndexCodeCompletion.cpp clang/tools/libclang/CIndexDiagnostic.cpp clang/tools/libclang/CIndexDiagnostic.h clang/tools/libclang/CIndexHigh.cpp clang/tools/libclang/CIndexer.h clang/tools/libclang/CXIndexDataConsumer.cpp clang/tools/libclang/CXIndexDataConsumer.h clang/tools/libclang/CXLoadedDiagnostic.cpp clang/tools/libclang/CXLoadedDiagnostic.h clang/tools/libclang/CXSourceLocation.cpp clang/tools/libclang/CXSourceLocation.h clang/tools/libclang/CXStoredDiagnostic.cpp clang/tools/libclang/CXTranslationUnit.h clang/tools/libclang/CXType.cpp clang/tools/libclang/CXType.h clang/tools/libclang/Index_Internal.h clang/tools/libclang/Indexing.cpp clang/utils/TableGen/ClangSACheckersEmitter.cpp clang/utils/TableGen/ClangTypeNodesEmitter.cpp clang/utils/builtin-defines.c compiler-rt/include/profile/InstrProfData.inc compiler-rt/include/xray/xray_records.h compiler-rt/lib/BlocksRuntime/Block.h compiler-rt/lib/BlocksRuntime/Block_private.h compiler-rt/lib/BlocksRuntime/data.c compiler-rt/lib/BlocksRuntime/runtime.c compiler-rt/lib/profile/InstrProfilingInternal.h compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp compiler-rt/lib/tsan/benchmarks/mop.cpp compiler-rt/lib/tsan/rtl/tsan_rtl.h compiler-rt/lib/xray/xray_basic_logging.cpp compiler-rt/lib/xray/xray_init.cpp flang/lib/Lower/OpenACC.cpp flang/lib/Optimizer/Transforms/PolymorphicOpConversion.cpp libclc/generic/lib/integer/rotate.inc libclc/generic/lib/math/log_base.h libcxx/include/sstream lld/wasm/InputChunks.cpp lld/wasm/Symbols.h lldb/include/lldb/API/SBBreakpointLocation.h lldb/include/lldb/API/SBBreakpointName.h lldb/include/lldb/API/SBCommandInterpreter.h lldb/include/lldb/API/SBDebugger.h lldb/include/lldb/API/SBInstructionList.h lldb/include/lldb/API/SBTarget.h lldb/include/lldb/API/SBThreadPlan.h lldb/include/lldb/Breakpoint/BreakpointLocation.h lldb/include/lldb/Breakpoint/BreakpointName.h lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h lldb/include/lldb/Breakpoint/Watchpoint.h lldb/include/lldb/Core/Disassembler.h lldb/include/lldb/Core/ValueObjectVariable.h lldb/include/lldb/Host/LZMA.h lldb/include/lldb/Interpreter/CommandInterpreter.h lldb/include/lldb/Interpreter/CommandObject.h lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h lldb/include/lldb/Interpreter/OptionValue.h lldb/include/lldb/Interpreter/ScriptInterpreter.h lldb/include/lldb/Target/Language.h lldb/include/lldb/Target/Memory.h lldb/include/lldb/Target/StackFrameList.h lldb/include/lldb/Target/TargetList.h lldb/include/lldb/Target/Thread.h lldb/include/lldb/Target/ThreadPlan.h lldb/include/lldb/Target/ThreadPlanPython.h lldb/include/lldb/Target/ThreadPlanStack.h lldb/include/lldb/Target/UnixSignals.h lldb/include/lldb/Utility/Event.h lldb/include/lldb/Utility/StructuredData.h lldb/include/lldb/Utility/UUID.h lldb/source/API/SBBreakpointName.cpp lldb/source/API/SBCommandInterpreter.cpp lldb/source/API/SBDebugger.cpp lldb/source/API/SBFrame.cpp lldb/source/Breakpoint/BreakpointIDList.cpp lldb/source/Breakpoint/BreakpointLocationCollection.cpp lldb/source/Breakpoint/BreakpointName.cpp lldb/source/Breakpoint/BreakpointOptions.cpp lldb/source/Commands/CommandObjectBreakpoint.cpp lldb/source/Commands/CommandObjectCommands.cpp lldb/source/Commands/CommandObjectFrame.cpp lldb/source/Commands/CommandObjectRegexCommand.cpp lldb/source/Commands/CommandObjectThread.cpp lldb/source/Core/ModuleList.cpp lldb/source/Core/SearchFilter.cpp lldb/source/Core/ValueObjectDynamicValue.cpp lldb/source/DataFormatters/ValueObjectPrinter.cpp lldb/source/Expression/FunctionCaller.cpp lldb/source/Expression/IRExecutionUnit.cpp lldb/source/Host/common/SocketAddress.cpp lldb/source/Host/posix/MainLoopPosix.cpp lldb/source/Host/windows/PipeWindows.cpp lldb/source/Interpreter/CommandAlias.cpp lldb/source/Interpreter/CommandObject.cpp lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp lldb/source/Interpreter/OptionGroupWatchpoint.cpp lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h lldb/source/Plugins/Language/ObjC/CFBasicHash.cpp lldb/source/Plugins/Language/ObjC/Cocoa.cpp lldb/source/Plugins/Language/ObjC/NSDictionary.cpp lldb/source/Plugins/Language/ObjC/NSSet.cpp lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h lldb/source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.h lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h lldb/source/Target/Process.cpp lldb/source/Target/StackFrameList.cpp lldb/source/Target/StopInfo.cpp lldb/source/Target/TargetList.cpp lldb/source/Target/ThreadList.cpp lldb/source/Target/ThreadPlanBase.cpp lldb/source/Target/ThreadPlanCallFunction.cpp lldb/source/Target/ThreadPlanPython.cpp lldb/source/Target/ThreadPlanStepOut.cpp lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp lldb/source/Target/ThreadPlanStepOverRange.cpp lldb/source/Target/ThreadPlanStepRange.cpp lldb/source/Target/UnixSignals.cpp lldb/source/Utility/ArchSpec.cpp lldb/source/Utility/Broadcaster.cpp lldb/tools/debugserver/source/DNB.cpp lldb/tools/debugserver/source/DNB.h lldb/tools/debugserver/source/MacOSX/MachException.cpp lldb/tools/debugserver/source/MacOSX/MachProcess.h lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp lldb/tools/debugserver/source/RNBContext.h lldb/tools/debugserver/source/RNBRemote.cpp lldb/tools/debugserver/source/RNBRemote.h llvm/examples/HowToUseJIT/HowToUseJIT.cpp llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp llvm/include/llvm-c/Orc.h llvm/include/llvm/Analysis/IRSimilarityIdentifier.h llvm/include/llvm/CodeGen/MachineRegisterInfo.h llvm/include/llvm/CodeGen/StackMaps.h llvm/include/llvm/CodeGen/TargetSubtargetInfo.h llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h llvm/include/llvm/IR/DiagnosticInfo.h llvm/include/llvm/IR/Metadata.h llvm/include/llvm/MC/MCInstrAnalysis.h llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h llvm/include/llvm/MC/TargetRegistry.h llvm/include/llvm/Object/StackMapParser.h llvm/include/llvm/ProfileData/InstrProfData.inc llvm/include/llvm/ProfileData/SampleProf.h llvm/include/llvm/ProfileData/SampleProfWriter.h llvm/include/llvm/Support/Error.h llvm/include/llvm/TextAPI/Symbol.h llvm/include/llvm/Transforms/IPO/IROutliner.h llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h llvm/lib/Analysis/CFGPrinter.cpp llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp llvm/lib/Analysis/IRSimilarityIdentifier.cpp llvm/lib/Analysis/LoopAccessAnalysis.cpp llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp llvm/lib/ExecutionEngine/IntelJITEvents/jitprofiling.c llvm/lib/IR/Constants.cpp llvm/lib/IR/Value.cpp llvm/lib/Support/BLAKE3/blake3_avx2.c llvm/lib/Support/BLAKE3/blake3_impl.h llvm/lib/Support/BLAKE3/blake3_sse2.c llvm/lib/Support/BLAKE3/blake3_sse41.c llvm/lib/Support/regengine.inc llvm/lib/Support/regerror.c llvm/lib/TableGen/DetailedRecordsBackend.cpp llvm/lib/TableGen/Main.cpp llvm/lib/TableGen/TGParser.cpp llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp llvm/lib/Target/ARC/ARCRegisterInfo.cpp llvm/lib/Target/DirectX/DXILWriter/DXILValueEnumerator.cpp llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp llvm/lib/Target/MSP430/MCTargetDesc/MSP430AsmBackend.cpp llvm/lib/Target/Mips/MipsISelLowering.cpp llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp llvm/lib/Target/PowerPC/PPCISelLowering.cpp llvm/lib/Target/PowerPC/PPCLowerMASSVEntries.cpp llvm/lib/Target/PowerPC/PPCMachineScheduler.cpp llvm/lib/Target/PowerPC/PPCMacroFusion.cpp llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp llvm/lib/Target/X86/X86SelectionDAGInfo.cpp llvm/lib/Target/XCore/XCoreISelLowering.cpp llvm/lib/Target/Xtensa/MCTargetDesc/XtensaMCCodeEmitter.cpp llvm/lib/TextAPI/TextStubV5.cpp llvm/lib/Transforms/IPO/IROutliner.cpp llvm/lib/Transforms/IPO/SampleContextTracker.cpp llvm/lib/Transforms/Scalar/JumpThreading.cpp llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp llvm/lib/Transforms/Scalar/Reassociate.cpp llvm/lib/Transforms/Utils/AddDiscriminators.cpp llvm/lib/Transforms/Utils/BasicBlockUtils.cpp llvm/lib/Transforms/Utils/GuardUtils.cpp llvm/tools/llvm-diff/lib/DifferenceEngine.cpp llvm/tools/llvm-mca/Views/BottleneckAnalysis.h llvm/tools/llvm-profgen/ProfiledBinary.h llvm/utils/count/count.c mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h mlir/lib/Bytecode/Writer/IRNumbering.h mlir/lib/ExecutionEngine/ExecutionEngine.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clangd/IncludeCleaner.cpp b/clang-tools-extra/clangd/IncludeCleaner.cpp
index 54f767918c..233645e388 100644
--- a/clang-tools-extra/clangd/IncludeCleaner.cpp
+++ b/clang-tools-extra/clangd/IncludeCleaner.cpp
@@ -75,9 +75,9 @@ bool mayConsiderUnused(const Inclusion &Inc, ParsedAST &AST,
AST.getIncludeStructure().getRealPath(HID));
assert(FE);
if (FE->getDir() == AST.getPreprocessor()
- .getHeaderSearchInfo()
- .getModuleMap()
- .getBuiltinDir())
+ .getHeaderSearchInfo()
+ .getModuleMap()
+ .getBuiltinDir())
return false;
if (PI && PI->shouldKeep(*FE))
return false;
diff --git a/clang/tools/libclang/CIndexCXX.cpp b/clang/tools/libclang/CIndexCXX.cpp
index 95a16e0ed9..17f12fc148 100644
--- a/clang/tools/libclang/CIndexCXX.cpp
+++ b/clang/tools/libclang/CIndexCXX.cpp
@@ -96,8 +96,8 @@ CXCursor clang_getSpecializedCursorTemplate(CXCursor C) {
if (const ClassTemplatePartialSpecializationDecl *PartialSpec
= dyn_cast<ClassTemplatePartialSpecializationDecl>(CXXRecord))
Template = PartialSpec->getSpecializedTemplate();
- else if (const ClassTemplateSpecializationDecl *ClassSpec
- = dyn_cast<ClassTemplateSpecializationDecl>(CXXRecord)) {
+ else if (const ClassTemplateSpecializationDecl *ClassSpec =
+ dyn_cast<ClassTemplateSpecializationDecl>(CXXRecord)) {
llvm::PointerUnion<ClassTemplateDecl *,
ClassTemplatePartialSpecializationDecl *> Result
= ClassSpec->getSpecializedTemplateOrPartial();
diff --git a/clang/tools/libclang/CIndexCodeCompletion.cpp b/clang/tools/libclang/CIndexCodeCompletion.cpp
index 2476197408..9b0fd88937 100644
--- a/clang/tools/libclang/CIndexCodeCompletion.cpp
+++ b/clang/tools/libclang/CIndexCodeCompletion.cpp
@@ -573,8 +573,7 @@ namespace {
CCTUInfo(Results.CodeCompletionAllocator), TU(TranslationUnit) {}
~CaptureCompletionResults() override { Finish(); }
- void ProcessCodeCompleteResults(Sema &S,
- CodeCompletionContext Context,
+ void ProcessCodeCompleteResults(Sema &S, CodeCompletionContext Context,
CodeCompletionResult *Results,
unsigned NumResults) override {
StoredResults.reserve(StoredResults.size() + NumResults);
@@ -619,7 +618,7 @@ namespace {
// Get the @interface declaration for a (possibly-qualified) Objective-C
// object pointer type, e.g., NSString*
else if (const ObjCObjectPointerType *ObjPtr =
- baseType->getAs<ObjCObjectPointerType>())
+ baseType->getAs<ObjCObjectPointerType>())
D = ObjPtr->getInterfaceDecl();
// Get the @interface declaration for an Objective-C object type
else if (const ObjCObjectType *Obj = baseType->getAs<ObjCObjectType>())
diff --git a/clang/tools/libclang/CIndexDiagnostic.cpp b/clang/tools/libclang/CIndexDiagnostic.cpp
index 4309ed9aee..8a1d1b1855 100644
--- a/clang/tools/libclang/CIndexDiagnostic.cpp
+++ b/clang/tools/libclang/CIndexDiagnostic.cpp
@@ -323,8 +323,8 @@ CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, unsigned Options) {
clang_disposeString(OptionName);
}
- if (Options & (CXDiagnostic_DisplayCategoryId |
- CXDiagnostic_DisplayCategoryName)) {
+ if (Options &
+ (CXDiagnostic_DisplayCategoryId | CXDiagnostic_DisplayCategoryName)) {
if (unsigned CategoryID = clang_getDiagnosticCategory(Diagnostic)) {
if (Options & CXDiagnostic_DisplayCategoryId) {
if (NeedBracket)
diff --git a/clang/tools/libclang/CXIndexDataConsumer.cpp b/clang/tools/libclang/CXIndexDataConsumer.cpp
index 089e11f1a1..a191da68e4 100644
--- a/clang/tools/libclang/CXIndexDataConsumer.cpp
+++ b/clang/tools/libclang/CXIndexDataConsumer.cpp
@@ -666,10 +666,9 @@ bool CXIndexDataConsumer::handleObjCInterface(const ObjCInterfaceDecl *D) {
bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl();
ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true, isRedeclaration,
/*isImplementation=*/false);
- return handleObjCContainer(D, D->getLocation(),
- MakeCursorObjCClassRef(D, D->getLocation(),
- CXTU),
- ContDInfo);
+ return handleObjCContainer(
+ D, D->getLocation(), MakeCursorObjCClassRef(D, D->getLocation(), CXTU),
+ ContDInfo);
}
ScratchAlloc SA(*this);
@@ -722,10 +721,9 @@ bool CXIndexDataConsumer::handleObjCProtocol(const ObjCProtocolDecl *D) {
ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true,
isRedeclaration,
/*isImplementation=*/false);
- return handleObjCContainer(D, D->getLocation(),
- MakeCursorObjCProtocolRef(D, D->getLocation(),
- CXTU),
- ContDInfo);
+ return handleObjCContainer(
+ D, D->getLocation(),
+ MakeCursorObjCProtocolRef(D, D->getLocation(), CXTU), ContDInfo);
}
ScratchAlloc SA(*this);
diff --git a/clang/tools/libclang/CXType.cpp b/clang/tools/libclang/CXType.cpp
index 6878467293..fea7c6ef37 100644
--- a/clang/tools/libclang/CXType.cpp
+++ b/clang/tools/libclang/CXType.cpp
@@ -532,7 +532,7 @@ try_again:
D = cast<InjectedClassNameType>(TP)->getDecl();
break;
- // FIXME: Template type parameters!
+ // FIXME: Template type parameters!
case Type::Elaborated:
TP = cast<ElaboratedType>(TP)->getNamedType().getTypePtrOrNull();
diff --git a/compiler-rt/lib/BlocksRuntime/runtime.c b/compiler-rt/lib/BlocksRuntime/runtime.c
index d1f9c4fe9a..0ac1e244fe 100644
--- a/compiler-rt/lib/BlocksRuntime/runtime.c
+++ b/compiler-rt/lib/BlocksRuntime/runtime.c
@@ -522,31 +522,46 @@ unsigned long int Block_size(void *arg) {
Entry points used by the compiler - the real API!
-A Block can reference four different kinds of things that require help when the Block is copied to the heap.
-1) C++ stack based objects
-2) References to Objective-C objects
-3) Other Blocks
-4) __block variables
+A Block can reference four different kinds of things that require help when the
+Block is copied to the heap. 1) C++ stack based objects 2) References to
+Objective-C objects 3) Other Blocks 4) __block variables
-In these cases helper functions are synthesized by the compiler for use in Block_copy and Block_release, called the copy and dispose helpers. The copy helper emits a call to the C++ const copy constructor for C++ stack based objects and for the rest calls into the runtime support function _Block_object_assign. The dispose helper has a call to the C++ destructor for case 1 and a call into _Block_object_dispose for the rest.
+In these cases helper functions are synthesized by the compiler for use in
+Block_copy and Block_release, called the copy and dispose helpers. The copy
+helper emits a call to the C++ const copy constructor for C++ stack based
+objects and for the rest calls into the runtime support function
+_Block_object_assign. The dispose helper has a call to the C++ destructor for
+case 1 and a call into _Block_object_dispose for the rest.
The flags parameter of _Block_object_assign and _Block_object_dispose is set to
- * BLOCK_FIELD_IS_OBJECT (3), for the case of an Objective-C Object,
- * BLOCK_FIELD_IS_BLOCK (7), for the case of another Block, and
- * BLOCK_FIELD_IS_BYREF (8), for the case of a __block variable.
-If the __block variable is marked weak the compiler also or's in BLOCK_FIELD_IS_WEAK (16).
-
-So the Block copy/dispose helpers should only ever generate the four flag values of 3, 7, 8, and 24.
-
-When a __block variable is either a C++ object, an Objective-C object, or another Block then the compiler also generates copy/dispose helper functions. Similarly to the Block copy helper, the "__block" copy helper (formerly and still a.k.a. "byref" copy helper) will do a C++ copy constructor (not a const one though!) and the dispose helper will do the destructor. And similarly the helpers will call into the same two support functions with the same values for objects and Blocks with the additional BLOCK_BYREF_CALLER (128) bit of information supplied.
-
-So the __block copy/dispose helpers will generate flag values of 3 or 7 for objects and Blocks respectively, with BLOCK_FIELD_IS_WEAK (16) or'ed as appropriate and always 128 or'd in, for the following set of possibilities:
- __block id 128+3
+ * BLOCK_FIELD_IS_OBJECT (3), for the case of an Objective-C Object,
+ * BLOCK_FIELD_IS_BLOCK (7), for the case of another Block, and
+ * BLOCK_FIELD_IS_BYREF (8), for the case of a __block variable.
+If the __block variable is marked weak the compiler also or's in
+BLOCK_FIELD_IS_WEAK (16).
+
+So the Block copy/dispose helpers should only ever generate the four flag values
+of 3, 7, 8, and 24.
+
+When a __block variable is either a C++ object, an Objective-C object, or
+another Block then the compiler also generates copy/dispose helper functions.
+Similarly to the Block copy helper, the "__block" copy helper (formerly and
+still a.k.a. "byref" copy helper) will do a C++ copy constructor (not a const
+one though!) and the dispose helper will do the destructor. And similarly the
+helpers will call into the same two support functions with the same values for
+objects and Blocks with the additional BLOCK_BYREF_CALLER (128) bit of
+information supplied.
+
+So the __block copy/dispose helpers will generate flag values of 3 or 7 for
+objects and Blocks respectively, with BLOCK_FIELD_IS_WEAK (16) or'ed as
+appropriate and always 128 or'd in, for the following set of possibilities:
+ __block id 128+3
__weak block id 128+3+16
- __block (^Block) 128+7
- __weak __block (^Block) 128+7+16
+ __block (^Block) 128+7
+ __weak __block (^Block) 128+7+16
-The implementation of the two routines would be improved by switch statements enumerating the eight cases.
+The implementation of the two routines would be improved by switch statements
+enumerating the eight cases.
********************************************************/
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
index 6c01827779..5356eeaabb 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
@@ -30,12 +30,7 @@ namespace __sanitizer {
#if SANITIZER_FREEBSD
void GetMemoryProfile(fill_profile_f cb, uptr *stats) {
- const int Mib[] = {
- CTL_KERN,
- KERN_PROC,
- KERN_PROC_PID,
- getpid()
- };
+ const int Mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()};
struct kinfo_proc InfoProc;
uptr Len = sizeof(InfoProc);
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index 32eaa384a2..d626814c53 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -2556,7 +2556,8 @@ static void genACCDataOp(Fortran::lower::AbstractConverter &converter,
hasWaitDevnums, waitOperandsSegments,
crtDeviceTypes, stmtCtx);
} else if (const auto *defaultClause =
- std::get_if<Fortran::parser::AccClause::Default>(&clause.u)) {
+ std::get_if<Fortran::parser::AccClause::Default>(
+ &clause.u)) {
if ((defaultClause->v).v == llvm::acc::DefaultValue::ACC_Default_none)
hasDefaultNone = true;
else if ((defaultClause->v).v == llvm::acc::DefaultValue::ACC_Default_present)
diff --git a/lldb/include/lldb/API/SBInstructionList.h b/lldb/include/lldb/API/SBInstructionList.h
index caec50071e..327b7dbabe 100644
--- a/lldb/include/lldb/API/SBInstructionList.h
+++ b/lldb/include/lldb/API/SBInstructionList.h
@@ -36,8 +36,7 @@ public:
// Returns the number of instructions between the start and end address. If
// canSetBreakpoint is true then the count will be the number of
// instructions on which a breakpoint can be set.
- size_t GetInstructionsCount(const SBAddress &start,
- const SBAddress &end,
+ size_t GetInstructionsCount(const SBAddress &start, const SBAddress &end,
bool canSetBreakpoint = false);
void Clear();
diff --git a/lldb/include/lldb/Target/StackFrameList.h b/lldb/include/lldb/Target/StackFrameList.h
index c94c6ba9e5..f978e8c57a 100644
--- a/lldb/include/lldb/Target/StackFrameList.h
+++ b/lldb/include/lldb/Target/StackFrameList.h
@@ -104,7 +104,7 @@ protected:
/// the actual number of frames.)
/// Returns true if the function was interrupted, false otherwise.
bool GetFramesUpTo(uint32_t end_idx,
- InterruptionControl allow_interrupt = AllowInterruption);
+ InterruptionControl allow_interrupt = AllowInterruption);
void GetOnlyConcreteFramesUpTo(uint32_t end_idx, Unwind &unwinder);
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp
index 9aba6a79f6..796aea6b3d 100644
--- a/lldb/source/API/SBFrame.cpp
+++ b/lldb/source/API/SBFrame.cpp
@@ -815,9 +815,11 @@ SBValueList SBFrame::GetVariables(const lldb::SBVariablesOptions &options) {
if (num_variables) {
size_t num_produced = 0;
for (const VariableSP &variable_sp : *variable_list) {
- if (INTERRUPT_REQUESTED(dbg,
- "Interrupted getting frame variables with {0} of {1} "
- "produced.", num_produced, num_variables))
+ if (INTERRUPT_REQUESTED(
+ dbg,
+ "Interrupted getting frame variables with {0} of {1} "
+ "produced.",
+ num_produced, num_variables))
return {};
if (variable_sp) {
diff --git a/lldb/source/Breakpoint/BreakpointName.cpp b/lldb/source/Breakpoint/BreakpointName.cpp
index 385f71c662..8249d8f822 100644
--- a/lldb/source/Breakpoint/BreakpointName.cpp
+++ b/lldb/source/Breakpoint/BreakpointName.cpp
@@ -21,12 +21,8 @@ using namespace lldb;
using namespace lldb_private;
const Flags::ValueType BreakpointName::Permissions::permissions_mask
- [BreakpointName::Permissions::PermissionKinds::allPerms + 1] = {
- (1u << 0),
- (1u << 1),
- (1u << 2),
- (0x5u)
-};
+ [BreakpointName::Permissions::PermissionKinds::allPerms + 1] = {
+ (1u << 0), (1u << 1), (1u << 2), (0x5u)};
bool BreakpointName::Permissions::GetDescription(Stream *s,
lldb::DescriptionLevel level) {
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 827ed23de2..9446aead9f 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -2003,9 +2003,8 @@ public:
: CommandObjectMultiword(
interpreter, "name", "Commands to manage breakpoint names") {
-
SetHelpLong(
- R"(
+ R"(
Breakpoint names provide a general tagging mechanism for breakpoints. Each
breakpoint name can be added to any number of breakpoints, and each breakpoint
can have any number of breakpoint names attached to it. For instance:
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index ab05d63676..4552be2d37 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -1259,8 +1259,8 @@ private:
class CommandOptions : public Options {
public:
CommandOptions(CommandInterpreter &interpreter,
- StructuredData::GenericSP cmd_obj_sp) : m_interpreter(interpreter),
- m_cmd_obj_sp(cmd_obj_sp) {}
+ StructuredData::GenericSP cmd_obj_sp)
+ : m_interpreter(interpreter), m_cmd_obj_sp(cmd_obj_sp) {}
~CommandOptions() override = default;
@@ -1268,7 +1268,7 @@ private:
ExecutionContext *execution_context) override {
Status error;
ScriptInterpreter *scripter =
- m_interpreter.GetDebugger().GetScriptInterpreter();
+ m_interpreter.GetDebugger().GetScriptInterpreter();
if (!scripter) {
error.SetErrorString("No script interpreter for SetOptionValue.");
return error;
@@ -1285,10 +1285,10 @@ private:
// Pass the long option, since you aren't actually required to have a
// short_option, and for those options the index or short option character
// aren't meaningful on the python side.
- const char * long_option =
- m_options_definition_up.get()[option_idx].long_option;
- bool success = scripter->SetOptionValueForCommandObject(m_cmd_obj_sp,
- execution_context, long_option, option_arg);
+ const char *long_option =
+ m_options_definition_up.get()[option_idx].long_option;
+ bool success = scripter->SetOptionValueForCommandObject(
+ m_cmd_obj_sp, execution_context, long_option, option_arg);
if (!success)
error.SetErrorStringWithFormatv("Error setting option: {0} to {1}",
long_option, option_arg);
@@ -1297,7 +1297,7 @@ private:
void OptionParsingStarting(ExecutionContext *execution_context) override {
ScriptInterpreter *scripter =
- m_interpreter.GetDebugger().GetScriptInterpreter();
+ m_interpreter.GetDebugger().GetScriptInterpreter();
if (!scripter || !m_cmd_obj_sp)
return;
@@ -1311,7 +1311,8 @@ private:
}
static Status ParseUsageMaskFromArray(StructuredData::ObjectSP obj_sp,
- size_t counter, uint32_t &usage_mask) {
+ size_t counter,
+ uint32_t &usage_mask) {
// If the usage entry is not provided, we use LLDB_OPT_SET_ALL.
// If the usage mask is a UINT, the option belongs to that group.
// If the usage mask is a vector of UINT's, the option belongs to all the
@@ -1348,9 +1349,8 @@ private:
}
// This is the array ForEach for accumulating a group usage mask from
// an array of string descriptions of groups.
- auto groups_accumulator
- = [counter, &usage_mask, &error]
- (StructuredData::Object *obj) -> bool {
+ auto groups_accumulator = [counter, &usage_mask,
+ &error](StructuredData::Object *obj) -> bool {
StructuredData::UnsignedInteger *int_val = obj->GetAsUnsignedInteger();
if (int_val) {
uint32_t value = int_val->GetValue();
@@ -1404,7 +1404,6 @@ private:
return error;
}
-
Status SetOptionsFromArray(StructuredData::Dictionary &options) {
Status error;
m_num_options = options.GetSize();
@@ -1418,8 +1417,9 @@ private:
size_t counter = 0;
size_t short_opt_counter = 0;
// This is the Array::ForEach function for adding option elements:
- auto add_element = [this, &error, &counter, &short_opt_counter]
- (llvm::StringRef long_option, StructuredData::Object *object) -> bool {
+ auto add_element = [this, &error, &counter, &short_opt_counter](
+ llvm::StringRef long_option,
+ StructuredData::Object *object) -> bool {
StructuredData::Dictionary *opt_dict = object->GetAsDictionary();
if (!opt_dict) {
error.SetErrorString("Value in options dictionary is not a dictionary");
@@ -1441,8 +1441,8 @@ private:
// Usage Mask:
StructuredData::ObjectSP obj_sp = opt_dict->GetValueForKey("groups");
if (obj_sp) {
- error = ParseUsageMaskFromArray(obj_sp, counter,
- option_def.usage_mask);
+ error =
+ ParseUsageMaskFromArray(obj_sp, counter, option_def.usage_mask);
if (error.Fail())
return false;
}
@@ -1486,7 +1486,7 @@ private:
// Long Option is the key from the outer dict:
if (long_option.empty()) {
error.SetErrorStringWithFormatv("empty long_option for option {0}",
- counter);
+ counter);
return false;
}
auto inserted = g_string_storer.insert(long_option.str());
@@ -1495,8 +1495,8 @@ private:
// Value Type:
obj_sp = opt_dict->GetValueForKey("value_type");
if (obj_sp) {
- StructuredData::UnsignedInteger *uint_val
- = obj_sp->GetAsUnsignedInteger();
+ StructuredData::UnsignedInteger *uint_val =
+ obj_sp->GetAsUnsignedInteger();
if (!uint_val) {
error.SetErrorStringWithFormatv("Value type must be an unsigned "
"integer");
@@ -1546,7 +1546,7 @@ private:
usage_stref = obj_sp->GetStringValue();
if (usage_stref.empty()) {
error.SetErrorStringWithFormatv("empty usage text for option {0}",
- counter);
+ counter);
return false;
}
m_usage_container[counter] = usage_stref.str().c_str();
@@ -1571,8 +1571,8 @@ private:
// Since there are only two fields to specify the enum, use a simple
// two element array with value first, usage second.
// counter is only used for reporting so I pass it by value here.
- auto add_enum = [&enum_ctr, &curr_elem, counter, &error]
- (StructuredData::Object *object) -> bool {
+ auto add_enum = [&enum_ctr, &curr_elem, counter,
+ &error](StructuredData::Object *object) -> bool {
StructuredData::Array *enum_arr = object->GetAsArray();
if (!enum_arr) {
error.SetErrorStringWithFormatv("Enum values for option {0} not "
@@ -1600,8 +1600,8 @@ private:
}
llvm::StringRef usage_stref = obj_sp->GetStringValue();
std::string usage_cstr_str = usage_stref.str().c_str();
- curr_elem[enum_ctr] = EnumValueStorage(value_cstr_str,
- usage_cstr_str, enum_ctr);
+ curr_elem[enum_ctr] =
+ EnumValueStorage(value_cstr_str, usage_cstr_str, enum_ctr);
enum_ctr++;
return true;
@@ -1634,12 +1634,13 @@ private:
}
EnumValueStorage(std::string in_str_val, std::string in_usage,
- size_t in_value) : value(std::move(in_str_val)), usage(std::move(in_usage)) {
+ size_t in_value)
+ : value(std::move(in_str_val)), usage(std::move(in_usage)) {
SetElement(in_value);
}
- EnumValueStorage(const EnumValueStorage &in) : value(in.value),
- usage(in.usage) {
+ EnumValueStorage(const EnumValueStorage &in)
+ : value(in.value), usage(in.usage) {
SetElement(in.element.value);
}
@@ -1682,15 +1683,15 @@ private:
public:
static CommandObjectSP Create(CommandInterpreter &interpreter,
- std::string name,
- StructuredData::GenericSP cmd_obj_sp,
- ScriptedCommandSynchronicity synch,
- CommandReturnObject &result) {
+ std::string name,
+ StructuredData::GenericSP cmd_obj_sp,
+ ScriptedCommandSynchronicity synch,
+ CommandReturnObject &result) {
CommandObjectSP new_cmd_sp(new CommandObjectScriptingObjectParsed(
interpreter, name, cmd_obj_sp, synch));
- CommandObjectScriptingObjectParsed *parsed_cmd
- = static_cast<CommandObjectScriptingObjectParsed *>(new_cmd_sp.get());
+ CommandObjectScriptingObjectParsed *parsed_cmd =
+ static_cast<CommandObjectScriptingObjectParsed *>(new_cmd_sp.get());
// Now check all the failure modes, and report if found.
Status opt_error = parsed_cmd->GetOptionsError();
Status arg_error = parsed_cmd->GetArgsError();
@@ -1710,9 +1711,9 @@ public:
}
CommandObjectScriptingObjectParsed(CommandInterpreter &interpreter,
- std::string name,
- StructuredData::GenericSP cmd_obj_sp,
- ScriptedCommandSynchronicity synch)
+ std::string name,
+ StructuredData::GenericSP cmd_obj_sp,
+ ScriptedCommandSynchronicity synch)
: CommandObjectParsed(interpreter, name.c_str()),
m_cmd_obj_sp(cmd_obj_sp), m_synchro(synch),
m_options(interpreter, cmd_obj_sp), m_fetched_help_short(false),
@@ -1728,15 +1729,15 @@ public:
GetFlags().Set(scripter->GetFlagsForCommandObject(cmd_obj_sp));
// Now set up the options definitions from the options:
- StructuredData::ObjectSP options_object_sp
- = scripter->GetOptionsForCommandObject(cmd_obj_sp);
+ StructuredData::ObjectSP options_object_sp =
+ scripter->GetOptionsForCommandObject(cmd_obj_sp);
// It's okay not to have an options dict.
if (options_object_sp) {
// The options come as a dictionary of dictionaries. The key of the
// outer dict is the long option name (since that's required). The
// value holds all the other option specification bits.
- StructuredData::Dictionary *options_dict
- = options_object_sp->GetAsDictionary();
+ StructuredData::Dictionary *options_dict =
+ options_object_sp->GetAsDictionary();
// but if it exists, it has to be an array.
if (options_dict) {
m_options_error = m_options.SetOptionsFromArray(*(options_dict));
@@ -1750,8 +1751,8 @@ public:
}
// Then fetch the args. Since the arguments can have usage masks you need
// an array of arrays.
- StructuredData::ObjectSP args_object_sp
- = scripter->GetArgumentsForCommandObject(cmd_obj_sp);
+ StructuredData::ObjectSP args_object_sp =
+ scripter->GetArgumentsForCommandObject(cmd_obj_sp);
if (args_object_sp) {
StructuredData::Array *args_array = args_object_sp->GetAsArray();
if (!args_array) {
@@ -1762,21 +1763,21 @@ public:
// This is the Array::ForEach function that handles the
// CommandArgumentEntry arrays one by one:
- auto arg_array_adder = [this, &counter] (StructuredData::Object *object)
- -> bool {
+ auto arg_array_adder =
+ [this, &counter](StructuredData::Object *object) -> bool {
// This is the Array::ForEach function to add argument entries:
CommandArgumentEntry this_entry;
size_t elem_counter = 0;
- auto args_adder = [this, counter, &elem_counter, &this_entry]
- (StructuredData::Object *object) -> bool {
+ auto args_adder = [this, counter, &elem_counter, &this_entry](
+ StructuredData::Object *object) -> bool {
// The arguments definition has three fields, the argument type, the
// repeat and the usage mask.
CommandArgumentType arg_type = eArgTypeNone;
ArgumentRepetitionType arg_repetition = eArgRepeatOptional;
uint32_t arg_opt_set_association;
- auto report_error = [this, elem_counter, counter]
- (const char *err_txt) -> bool {
+ auto report_error = [this, elem_counter,
+ counter](const char *err_txt) -> bool {
m_args_error.SetErrorStringWithFormatv("Element {0} of arguments "
"list element {1}: %s.", elem_counter, counter, err_txt);
return false;
@@ -1788,11 +1789,11 @@ public:
return false;
}
// Argument Type:
- StructuredData::ObjectSP obj_sp
- = arg_dict->GetValueForKey("arg_type");
+ StructuredData::ObjectSP obj_sp =
+ arg_dict->GetValueForKey("arg_type");
if (obj_sp) {
- StructuredData::UnsignedInteger *uint_val
- = obj_sp->GetAsUnsignedInteger();
+ StructuredData::UnsignedInteger *uint_val =
+ obj_sp->GetAsUnsignedInteger();
if (!uint_val) {
report_error("value type must be an unsigned integer");
return false;
@@ -1823,10 +1824,10 @@ public:
// Usage Mask:
obj_sp = arg_dict->GetValueForKey("groups");
- m_args_error = CommandOptions::ParseUsageMaskFromArray(obj_sp,
- counter, arg_opt_set_association);
+ m_args_error = CommandOptions::ParseUsageMaskFromArray(
+ obj_sp, counter, arg_opt_set_association);
this_entry.emplace_back(arg_type, arg_repetition,
- arg_opt_set_association);
+ arg_opt_set_association);
elem_counter++;
return true;
};
@@ -2316,8 +2317,8 @@ protected:
}
if (m_options.m_parsed_command) {
- new_cmd_sp = CommandObjectScriptingObjectParsed::Create(m_interpreter,
- m_cmd_name, cmd_obj_sp, m_synchronicity, result);
+ new_cmd_sp = CommandObjectScriptingObjectParsed::Create(
+ m_interpreter, m_cmd_name, cmd_obj_sp, m_synchronicity, result);
if (!result.Succeeded())
return;
} else
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp
index e82e890d13..2c67c50560 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -318,12 +318,12 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
llvm::SmallVector<char, 256> result_path;
std::string object_name_model =
"jit-object-" + module->getModuleIdentifier() + "-%%%.o";
- FileSpec model_spec
- = m_out_dir.CopyByAppendingPathComponent(object_name_model);
+ FileSpec model_spec =
+ m_out_dir.CopyByAppendingPathComponent(object_name_model);
std::string model_path = model_spec.GetPath();
- std::error_code result
- = llvm::sys::fs::createUniqueFile(model_path, fd, result_path);
+ std::error_code result =
+ llvm::sys::fs::createUniqueFile(model_path, fd, result_path);
if (!result) {
llvm::raw_fd_ostream fds(fd, true);
fds.write(object.getBufferStart(), object.getBufferSize());
@@ -946,14 +946,14 @@ void IRExecutionUnit::GetStaticInitializers(
llvm::JITSymbol
IRExecutionUnit::MemoryManager::findSymbol(const std::string &Name) {
- bool missing_weak = false;
- uint64_t addr = GetSymbolAddressAndPresence(Name, missing_weak);
- // This is a weak symbol:
- if (missing_weak)
- return llvm::JITSymbol(addr,
- llvm::JITSymbolFlags::Exported | llvm::JITSymbolFlags::Weak);
- else
- return llvm::JITSymbol(addr, llvm::JITSymbolFlags::Exported);
+ bool missing_weak = false;
+ uint64_t addr = GetSymbolAddressAndPresence(Name, missing_weak);
+ // This is a weak symbol:
+ if (missing_weak)
+ return llvm::JITSymbol(addr, llvm::JITSymbolFlags::Exported |
+ llvm::JITSymbolFlags::Weak);
+ else
+ return llvm::JITSymbol(addr, llvm::JITSymbolFlags::Exported);
}
uint64_t
@@ -962,8 +962,7 @@ IRExecutionUnit::MemoryManager::getSymbolAddress(const std::string &Name) {
return GetSymbolAddressAndPresence(Name, missing_weak);
}
-uint64_t
-IRExecutionUnit::MemoryManager::GetSymbolAddressAndPresence(
+uint64_t IRExecutionUnit::MemoryManager::GetSymbolAddressAndPresence(
const std::string &Name, bool &missing_weak) {
Log *log = GetLog(LLDBLog::Expressions);
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index f1034fec62..da1db381a2 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -487,18 +487,18 @@ bool CommandObject::IsPairType(ArgumentRepetitionType arg_repeat_type) {
std::optional<ArgumentRepetitionType>
CommandObject::ArgRepetitionFromString(llvm::StringRef string) {
return llvm::StringSwitch<ArgumentRepetitionType>(string)
- .Case("plain", eArgRepeatPlain)
- .Case("optional", eArgRepeatOptional)
- .Case("plus", eArgRepeatPlus)
- .Case("star", eArgRepeatStar)
- .Case("range", eArgRepeatRange)
- .Case("pair-plain", eArgRepeatPairPlain)
- .Case("pair-optional", eArgRepeatPairOptional)
- .Case("pair-plus", eArgRepeatPairPlus)
- .Case("pair-star", eArgRepeatPairStar)
- .Case("pair-range", eArgRepeatPairRange)
- .Case("pair-range-optional", eArgRepeatPairRangeOptional)
- .Default({});
+ .Case("plain", eArgRepeatPlain)
+ .Case("optional", eArgRepeatOptional)
+ .Case("plus", eArgRepeatPlus)
+ .Case("star", eArgRepeatStar)
+ .Case("range", eArgRepeatRange)
+ .Case("pair-plain", eArgRepeatPairPlain)
+ .Case("pair-optional", eArgRepeatPairOptional)
+ .Case("pair-plus", eArgRepeatPairPlus)
+ .Case("pair-star", eArgRepeatPairStar)
+ .Case("pair-range", eArgRepeatPairRange)
+ .Case("pair-range-optional", eArgRepeatPairRangeOptional)
+ .Default({});
}
static CommandObject::CommandArgumentEntry
diff --git a/lldb/source/Interpreter/OptionGroupWatchpoint.cpp b/lldb/source/Interpreter/OptionGroupWatchpoint.cpp
index 39b4a6dc5e..48cbc9ec0e 100644
--- a/lldb/source/Interpreter/OptionGroupWatchpoint.cpp
+++ b/lldb/source/Interpreter/OptionGroupWatchpoint.cpp
@@ -43,8 +43,15 @@ static constexpr OptionDefinition g_option_table[] = {
{LLDB_OPT_SET_1, false, "watch", 'w', OptionParser::eRequiredArgument,
nullptr, OptionEnumValues(g_watch_type), 0, eArgTypeWatchType,
"Specify the type of watching to perform."},
- {LLDB_OPT_SET_1, false, "size", 's', OptionParser::eRequiredArgument,
- nullptr, {}, 0, eArgTypeByteSize,
+ {LLDB_OPT_SET_1,
+ false,
+ "size",
+ 's',
+ OptionParser::eRequiredArgument,
+ nullptr,
+ {},
+ 0,
+ eArgTypeByteSize,
"Number of bytes to use to watch a region."},
{LLDB_OPT_SET_2,
false,
diff --git a/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
index 4693d951ba..4a98547488 100644
--- a/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
@@ -66,8 +66,8 @@ void DynamicLoaderWindowsDYLD::OnLoadModule(lldb::ModuleSP module_sp,
// Resolve the module unless we already have one.
if (!module_sp) {
Status error;
- module_sp = m_process->GetTarget().GetOrCreateModule(module_spec,
- true /* notify */, &error);
+ module_sp = m_process->GetTarget().GetOrCreateModule(
+ module_spec, true /* notify */, &error);
if (error.Fail())
return;
}
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
index 0a6d57d840..28952a1ec4 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
@@ -416,9 +416,8 @@ bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
"CFStringCreateWithBytes");
bool missing_weak = false;
- CFStringCreateWithBytes_addr =
- m_execution_unit.FindSymbol(g_CFStringCreateWithBytes_str,
- missing_weak);
+ CFStringCreateWithBytes_addr = m_execution_unit.FindSymbol(
+ g_CFStringCreateWithBytes_str, missing_weak);
if (CFStringCreateWithBytes_addr == LLDB_INVALID_ADDRESS || missing_weak) {
LLDB_LOG(log, "Couldn't find CFStringCreateWithBytes in the target");
diff --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
index 143251e39e..0406817e93 100644
--- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
+++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
@@ -1005,11 +1005,10 @@ bool EmulateInstructionMIPS::SetInstruction(const Opcode &insn_opcode,
uint64_t next_inst_addr = (m_addr & (~1ull)) + current_inst_size;
Address next_addr(next_inst_addr);
- const size_t bytes_read =
- target->ReadMemory(next_addr, /* Address of next instruction */
- buf, sizeof(uint32_t), error,
- false, /* force_live_memory */
- &load_addr);
+ const size_t bytes_read = target->ReadMemory(
+ next_addr, /* Address of next instruction */
+ buf, sizeof(uint32_t), error, false, /* force_live_memory */
+ &load_addr);
if (bytes_read == 0)
return true;
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h
index 1369e1d52e..b8b77314c0 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h
@@ -48,8 +48,8 @@ public:
lldb::addr_t SetupDispatchFunction(Thread &thread,
ValueList &dispatch_values);
const DispatchFunction *FindDispatchFunction(lldb::addr_t addr);
- void ForEachDispatchFunction(std::function<void(lldb::addr_t,
- const DispatchFunction &)>);
+ void ForEachDispatchFunction(
+ std::function<void(lldb::addr_t, const DispatchFunction &)>);
private:
/// These hold the code for the function that finds the implementation of
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
index 5ec3678b10..678a8b1966 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
@@ -254,14 +254,13 @@ AppleThreadPlanStepThroughDirectDispatch ::
m_dispatch_func_name(std::string(dispatch_func_name)),
m_at_msg_send(false) {
// Set breakpoints on the dispatch functions:
- auto bkpt_callback = [&] (lldb::addr_t addr,
- const AppleObjCTrampolineHandler
- ::DispatchFunction &dispatch) {
- m_msgSend_bkpts.push_back(GetTarget().CreateBreakpoint(addr,
- true /* internal */,
- false /* hard */));
- m_msgSend_bkpts.back()->SetThreadID(GetThread().GetID());
- };
+ auto bkpt_callback =
+ [&](lldb::addr_t addr,
+ const AppleObjCTrampolineHandler ::DispatchFunction &dispatch) {
+ m_msgSend_bkpts.push_back(GetTarget().CreateBreakpoint(
+ addr, true /* internal */, false /* hard */));
+ m_msgSend_bkpts.back()->SetThreadID(GetThread().GetID());
+ };
handler.ForEachDispatchFunction(bkpt_callback);
// We'll set the step-out plan in the DidPush so it gets queued in the right
@@ -305,8 +304,8 @@ void AppleThreadPlanStepThroughDirectDispatch::GetDescription(
}
}
-bool
-AppleThreadPlanStepThroughDirectDispatch::DoPlanExplainsStop(Event *event_ptr) {
+bool AppleThreadPlanStepThroughDirectDispatch::DoPlanExplainsStop(
+ Event *event_ptr) {
if (ThreadPlanStepOut::DoPlanExplainsStop(event_ptr))
return true;
@@ -322,8 +321,8 @@ AppleThreadPlanStepThroughDirectDispatch::DoPlanExplainsStop(Event *event_ptr) {
if (stop_reason == eStopReasonBreakpoint) {
ProcessSP process_sp = GetThread().GetProcess();
uint64_t break_site_id = stop_info_sp->GetValue();
- BreakpointSiteSP site_sp
- = process_sp->GetBreakpointSiteList().FindByID(break_site_id);
+ BreakpointSiteSP site_sp =
+ process_sp->GetBreakpointSiteList().FindByID(break_site_id);
// Some other plan might have deleted the site's last owner before this
// got to us. In which case, it wasn't our breakpoint...
if (!site_sp)
@@ -398,8 +397,8 @@ bool AppleThreadPlanStepThroughDirectDispatch::ShouldStop(Event *event_ptr) {
// plan:
if (m_at_msg_send) {
- LanguageRuntime *objc_runtime
- = GetThread().GetProcess()->GetLanguageRuntime(eLanguageTypeObjC);
+ LanguageRuntime *objc_runtime =
+ GetThread().GetProcess()->GetLanguageRuntime(eLanguageTypeObjC);
// There's no way we could have gotten here without an ObjC language
// runtime.
assert(objc_runtime);
diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index 97a2149cec..39aadb0724 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -717,9 +717,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process,
// target.
uint32_t permissions = ePermissionsReadable|ePermissionsWritable;
size_t path_len = path.size() + 1;
- lldb::addr_t path_addr = process->AllocateMemory(path_len,
- permissions,
- utility_error);
+ lldb::addr_t path_addr =
+ process->AllocateMemory(path_len, permissions, utility_error);
if (path_addr == LLDB_INVALID_ADDRESS) {
error.SetErrorStringWithFormat(
"dlopen error: could not allocate memory for path: %s",
@@ -793,9 +792,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process,
}
path_array.push_back('\0');
- path_array_addr = process->AllocateMemory(path_array.size(),
- permissions,
- utility_error);
+ path_array_addr =
+ process->AllocateMemory(path_array.size(), permissions, utility_error);
if (path_array_addr == LLDB_INVALID_ADDRESS) {
error.SetErrorStringWithFormat(
"dlopen error: could not allocate memory for path array: %s",
@@ -809,8 +807,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process,
process->DeallocateMemory(path_array_addr);
});
- process->WriteMemory(path_array_addr, path_array.data(),
- path_array.size(), utility_error);
+ process->WriteMemory(path_array_addr, path_array.data(), path_array.size(),
+ utility_error);
if (utility_error.Fail()) {
error.SetErrorStringWithFormat(
@@ -822,9 +820,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process,
// the '/' that the utility function will insert and one for the '\0':
buffer_size += path.size() + 2;
- buffer_addr = process->AllocateMemory(buffer_size,
- permissions,
- utility_error);
+ buffer_addr =
+ process->AllocateMemory(buffer_size, permissions, utility_error);
if (buffer_addr == LLDB_INVALID_ADDRESS) {
error.SetErrorStringWithFormat(
"dlopen error: could not allocate memory for buffer: %s",
@@ -847,10 +844,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process,
lldb::addr_t func_args_addr = LLDB_INVALID_ADDRESS;
diagnostics.Clear();
- if (!do_dlopen_function->WriteFunctionArguments(exe_ctx,
- func_args_addr,
- arguments,
- diagnostics)) {
+ if (!do_dlopen_function->WriteFunctionArguments(exe_ctx, func_args_addr,
+ arguments, diagnostics)) {
error.SetErrorStringWithFormat(
"dlopen error: could not write function arguments: %s",
diagnostics.GetString().c_str());
@@ -900,8 +895,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process,
}
// Read the dlopen token from the return area:
- lldb::addr_t token = process->ReadPointerFromMemory(return_addr,
- utility_error);
+ lldb::addr_t token =
+ process->ReadPointerFromMemory(return_addr, utility_error);
if (utility_error.Fail()) {
error.SetErrorStringWithFormat(
"dlopen error: could not read the return struct: %s",
@@ -925,8 +920,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process,
// We got an error, lets read in the error string:
std::string dlopen_error_str;
- lldb::addr_t error_addr
- = process->ReadPointerFromMemory(return_addr + addr_size, utility_error);
+ lldb::addr_t error_addr =
+ process->ReadPointerFromMemory(return_addr + addr_size, utility_error);
if (utility_error.Fail()) {
error.SetErrorStringWithFormat(
"dlopen error: could not read error string: %s",
@@ -934,9 +929,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process,
return LLDB_INVALID_IMAGE_TOKEN;
}
- size_t num_chars = process->ReadCStringFromMemory(error_addr + addr_size,
- dlopen_error_str,
- utility_error);
+ size_t num_chars = process->ReadCStringFromMemory(
+ error_addr + addr_size, dlopen_error_str, utility_error);
if (utility_error.Success() && num_chars > 0)
error.SetErrorStringWithFormat("dlopen error: %s",
dlopen_error_str.c_str());
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
index 4242d32d7d..a54628be95 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
@@ -821,18 +821,18 @@ void CommunicationKDP::DumpPacket(Stream &s, const DataExtractor &packet) {
s.Printf(" (error = 0x%8.8x regs:\n", error);
if (count > 0)
DumpDataExtractor(packet,
- &s, // Stream to dump to
- offset, // Offset within "packet"
- eFormatHex, // Format to use
- m_addr_byte_size, // Size of each item
- // in bytes
+ &s, // Stream to dump to
+ offset, // Offset within "packet"
+ eFormatHex, // Format to use
+ m_addr_byte_size, // Size of each item
+ // in bytes
count / m_addr_byte_size, // Number of items
16 / m_addr_byte_size, // Number per line
LLDB_INVALID_ADDRESS,
- // Don't
- // show addresses before
- // each line
- 0, 0); // No bitfields
+ // Don't
+ // show addresses before
+ // each line
+ 0, 0); // No bitfields
} break;
case KDP_KERNELVERSION: {
@@ -856,12 +856,12 @@ void CommunicationKDP::DumpPacket(Stream &s, const DataExtractor &packet) {
s.Printf(" (error = 0x%8.8x io:\n", error);
if (count > 0)
DumpDataExtractor(packet,
- &s, // Stream to dump to
- offset, // Offset within "packet"
- eFormatHex, // Format to use
- 1, // Size of each item in bytes
- count, // Number of items
- 16, // Number per line
+ &s, // Stream to dump to
+ offset, // Offset within "packet"
+ eFormatHex, // Format to use
+ 1, // Size of each item in bytes
+ count, // Number of items
+ 16, // Number per line
LLDB_INVALID_ADDRESS, // Don't show addresses
// before each line
0, 0); // No bitfields
@@ -989,7 +989,7 @@ void CommunicationKDP::DumpPacket(Stream &s, const DataExtractor &packet) {
16 / m_addr_byte_size, // Number per line
LLDB_INVALID_ADDRESS, // Don't show addresses
// before each line
- 0, 0); // No bitfields
+ 0, 0); // No bitfields
} break;
case KDP_BREAKPOINT_SET:
@@ -1129,7 +1129,8 @@ void CommunicationKDP::DumpPacket(Stream &s, const DataExtractor &packet) {
const uint32_t count = packet.GetByteSize() - offset;
s.Printf(" (count = %u, bytes = \n", count);
if (count > 0)
- DumpDataExtractor(packet,
+ DumpDataExtractor(
+ packet,
&s, // Stream to dump to
offset, // Offset within "packet"
eFormatHex, // Format to use
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
index 054cb101bd..2a48a8f9bd 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
@@ -56,8 +56,8 @@ StateType GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(
// whether there is an interrupt request that has reached its endpoint.
// If we want a shorter interrupt timeout that kWakeupInterval, we need to
// choose the shorter interval for the wake up as well.
- std::chrono::seconds computed_timeout = std::min(interrupt_timeout,
- kWakeupInterval);
+ std::chrono::seconds computed_timeout =
+ std::min(interrupt_timeout, kWakeupInterval);
for (;;) {
PacketResult read_result = ReadPacket(response, computed_timeout, false);
// Reset the computed_timeout to the default value in case we are going
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
index 5040bb66b0..781061c056 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
@@ -213,12 +213,11 @@ public:
lldb::DebuggerSP debugger, const char *args,
lldb_private::CommandReturnObject &cmd_retobj,
lldb::ExecutionContextRefSP exe_ctx_ref_sp);
- static bool
- LLDBSwigPythonCallParsedCommandObject(PyObject *implementor,
- lldb::DebuggerSP debugger,
- StructuredDataImpl &args_impl,
- lldb_private::CommandReturnObject &cmd_retobj,
- lldb::ExecutionContextRefSP exe_ctx_ref_sp);
+ static bool LLDBSwigPythonCallParsedCommandObject(
+ PyObject *implementor, lldb::DebuggerSP debugger,
+ StructuredDataImpl &args_impl,
+ lldb_private::CommandReturnObject &cmd_retobj,
+ lldb::ExecutionContextRefSP exe_ctx_ref_sp);
static bool LLDBSwigPythonCallModuleInit(const char *python_module_name,
const char *session_dictionary_name,
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 51a1b93814..30916853e6 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -3036,8 +3036,7 @@ ScriptInterpreterPythonImpl::GetArgumentsForCommandObject(
return py_return.CreateStructuredObject();
}
-void
-ScriptInterpreterPythonImpl::OptionParsingStartedForCommandObject(
+void ScriptInterpreterPythonImpl::OptionParsingStartedForCommandObject(
StructuredData::GenericSP cmd_obj_sp) {
Locker py_lock(this, Locker::AcquireLock | Locker::NoSTDIN, Locker::FreeLock);
@@ -3126,9 +3125,9 @@ ScriptInterpreterPythonImpl::SetOptionValueForCommandObject(
exe_ctx_ref_sp.reset(new ExecutionContextRef(exe_ctx));
PythonObject ctx_ref_obj = SWIGBridge::ToSWIGWrapper(exe_ctx_ref_sp);
- bool py_return = unwrapOrSetPythonException(
- As<bool>(implementor.CallMethod(callee_name, ctx_ref_obj, long_option.str().c_str(),
- value.str().c_str())));
+ bool py_return = unwrapOrSetPythonException(As<bool>(
+ implementor.CallMethod(callee_name, ctx_ref_obj,
+ long_option.str().c_str(), value.str().c_str())));
// if it fails, print the error but otherwise go on
if (PyErr_Occurred()) {
diff --git a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
index c6020d2cc4..eb5894fde3 100644
--- a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
@@ -870,10 +870,8 @@ int32_t x86AssemblyInspectionEngine::extract_4_signed(uint8_t *b) {
return v;
}
-
-bool x86AssemblyInspectionEngine::instruction_length(uint8_t *insn_p,
- int &length,
- uint32_t buffer_remaining_bytes) {
+bool x86AssemblyInspectionEngine::instruction_length(
+ uint8_t *insn_p, int &length, uint32_t buffer_remaining_bytes) {
uint32_t max_op_byte_size = std::min(buffer_remaining_bytes, m_arch.GetMaximumOpcodeByteSize());
llvm::SmallVector<uint8_t, 32> opcode_data;
@@ -966,9 +964,9 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
bool row_updated = false; // The UnwindPlan::Row 'row' has been updated
m_cur_insn = data + current_func_text_offset;
- if (!instruction_length(m_cur_insn, insn_len, size - current_func_text_offset)
- || insn_len == 0
- || insn_len > kMaxInstructionByteSize) {
+ if (!instruction_length(m_cur_insn, insn_len,
+ size - current_func_text_offset) ||
+ insn_len == 0 || insn_len > kMaxInstructionByteSize) {
// An unrecognized/junk instruction
break;
}
@@ -1221,7 +1219,8 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
else if (prologue_completed_row.get() &&
(ret_pattern_p() ||
- non_local_branch_p (current_func_text_offset, func_range, insn_len) ||
+ non_local_branch_p(current_func_text_offset, func_range,
+ insn_len) ||
jmp_to_reg_p())) {
// Check if the current instruction is the end of an epilogue sequence,
// and if so, re-instate the prologue-completed unwind state.
@@ -1576,9 +1575,8 @@ bool x86AssemblyInspectionEngine::FindFirstNonPrologueInstruction(
int scratch;
m_cur_insn = data + offset;
- if (!instruction_length(m_cur_insn, insn_len, size - offset)
- || insn_len > kMaxInstructionByteSize
- || insn_len == 0) {
+ if (!instruction_length(m_cur_insn, insn_len, size - offset) ||
+ insn_len > kMaxInstructionByteSize || insn_len == 0) {
// An error parsing the instruction, i.e. probably data/garbage - stop
// scanning
break;
diff --git a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
index 4f44c71c50..cbaafbb43d 100644
--- a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
+++ b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
@@ -116,13 +116,13 @@ private:
bool ret_pattern_p();
bool jmp_to_reg_p();
bool pc_rel_branch_or_jump_p (const int instruction_length, int &offset);
- bool non_local_branch_p (const lldb::addr_t current_func_text_offset,
- const lldb_private::AddressRange &func_range,
- const int instruction_length);
- bool local_branch_p (const lldb::addr_t current_func_text_offset,
- const lldb_private::AddressRange &func_range,
- const int instruction_length,
- lldb::addr_t &target_insn_offset);
+ bool non_local_branch_p(const lldb::addr_t current_func_text_offset,
+ const lldb_private::AddressRange &func_range,
+ const int instruction_length);
+ bool local_branch_p(const lldb::addr_t current_func_text_offset,
+ const lldb_private::AddressRange &func_range,
+ const int instruction_length,
+ lldb::addr_t &target_insn_offset);
uint16_t extract_2(uint8_t *b);
int16_t extract_2_signed(uint8_t *b);
uint32_t extract_4(uint8_t *b);
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp
index c1391b8286..bac07eeac3 100644
--- a/lldb/source/Target/StackFrameList.cpp
+++ b/lldb/source/Target/StackFrameList.cpp
@@ -510,11 +510,11 @@ bool StackFrameList::GetFramesUpTo(uint32_t end_idx,
} else {
// Check for interruption when building the frames.
// Do the check in idx > 0 so that we'll always create a 0th frame.
- if (allow_interrupt
- && INTERRUPT_REQUESTED(dbg, "Interrupted having fetched {0} frames",
- m_frames.size())) {
- was_interrupted = true;
- break;
+ if (allow_interrupt &&
+ INTERRUPT_REQUESTED(dbg, "Interrupted having fetched {0} frames",
+ m_frames.size())) {
+ was_interrupted = true;
+ break;
}
const bool success =
@@ -966,9 +966,9 @@ size_t StackFrameList::GetStatus(Stream &strm, uint32_t first_frame,
// Check for interruption here. If we're fetching arguments, this loop
// can go slowly:
Debugger &dbg = m_thread.GetProcess()->GetTarget().GetDebugger();
- if (INTERRUPT_REQUESTED(dbg,
- "Interrupted dumping stack for thread {0:hex} with {1} shown.",
- m_thread.GetID(), num_frames_displayed))
+ if (INTERRUPT_REQUESTED(
+ dbg, "Interrupted dumping stack for thread {0:hex} with {1} shown.",
+ m_thread.GetID(), num_frames_displayed))
break;
diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp
index a78cfb6ed2..c62a3e4b66 100644
--- a/lldb/tools/debugserver/source/DNB.cpp
+++ b/lldb/tools/debugserver/source/DNB.cpp
@@ -423,10 +423,10 @@ nub_process_t DNBProcessGetPIDByName(const char *name) {
return INVALID_NUB_PROCESS;
}
-nub_process_t DNBProcessAttachByName(const char *name, struct timespec *timeout,
- const RNBContext::IgnoredExceptions
- &ignored_exceptions, char *err_str,
- size_t err_len) {
+nub_process_t
+DNBProcessAttachByName(const char *name, struct timespec *timeout,
+ const RNBContext::IgnoredExceptions &ignored_exceptions,
+ char *err_str, size_t err_len) {
if (err_str && err_len > 0)
err_str[0] = '\0';
std::vector<struct kinfo_proc> matching_proc_infos;
@@ -450,11 +450,10 @@ nub_process_t DNBProcessAttachByName(const char *name, struct timespec *timeout,
ignored_exceptions, err_str, err_len);
}
-nub_process_t DNBProcessAttach(nub_process_t attach_pid,
- struct timespec *timeout,
- const RNBContext::IgnoredExceptions
- &ignored_exceptions,
- char *err_str, size_t err_len) {
+nub_process_t
+DNBProcessAttach(nub_process_t attach_pid, struct timespec *timeout,
+ const RNBContext::IgnoredExceptions &ignored_exceptions,
+ char *err_str, size_t err_len) {
if (err_str && err_len > 0)
err_str[0] = '\0';
@@ -501,9 +500,8 @@ nub_process_t DNBProcessAttach(nub_process_t attach_pid,
if (processSP.get()) {
DNBLogThreadedIf(LOG_PROCESS, "(DebugNub) attaching to pid %d...",
attach_pid);
- pid =
- processSP->AttachForDebug(attach_pid, ignored_exceptions, err_str,
- err_len);
+ pid = processSP->AttachForDebug(attach_pid, ignored_exceptions, err_str,
+ err_len);
if (pid != INVALID_NUB_PROCESS) {
bool res = AddProcessToMap(pid, processSP);
@@ -805,10 +803,10 @@ DNBProcessAttachWait(RNBContext *ctx, const char *waitfor_process_name,
// next event to also be our short pause...
struct timespec short_timeout;
DNBTimer::OffsetTimeOfDay(&short_timeout, 0, waitfor_interval);
- uint32_t event_mask = RNBContext::event_read_packet_available
- | RNBContext::event_read_thread_exiting;
- nub_event_t set_events = ctx->Events().WaitForSetEvents(event_mask,
- &short_timeout);
+ uint32_t event_mask = RNBContext::event_read_packet_available |
+ RNBContext::event_read_thread_exiting;
+ nub_event_t set_events =
+ ctx->Events().WaitForSetEvents(event_mask, &short_timeout);
if (set_events & RNBContext::event_read_packet_available) {
// If we get any packet from the debugger while waiting on the async,
// it has to be telling us to interrupt. So always exit here.
@@ -825,7 +823,6 @@ DNBProcessAttachWait(RNBContext *ctx, const char *waitfor_process_name,
"%s to appear.\n", waitfor_process_name);
break;
}
-
}
}
@@ -840,9 +837,9 @@ DNBProcessAttachWait(RNBContext *ctx, const char *waitfor_process_name,
// for an additional `waitfor_interval` number of microseconds before
// attaching.
::usleep(waitfor_interval);
- waitfor_pid = DNBProcessAttach(waitfor_pid, timeout_abstime,
- ctx->GetIgnoredExceptions(), err_str,
- err_len);
+ waitfor_pid =
+ DNBProcessAttach(waitfor_pid, timeout_abstime,
+ ctx->GetIgnoredExceptions(), err_str, err_len);
}
bool success = waitfor_pid != INVALID_NUB_PROCESS;
diff --git a/lldb/tools/debugserver/source/DNB.h b/lldb/tools/debugserver/source/DNB.h
index f7d16ff41a..e96d1e2b0d 100644
--- a/lldb/tools/debugserver/source/DNB.h
+++ b/lldb/tools/debugserver/source/DNB.h
@@ -51,16 +51,14 @@ nub_process_t DNBProcessLaunch(
size_t err_len);
nub_process_t DNBProcessGetPIDByName(const char *name);
-nub_process_t DNBProcessAttach(nub_process_t pid, struct timespec *timeout,
- const RNBContext::IgnoredExceptions
- &ignored_exceptions,
- char *err_str,
- size_t err_len);
-nub_process_t DNBProcessAttachByName(const char *name, struct timespec *timeout,
- const RNBContext::IgnoredExceptions
- &ignored_exceptions,
- char *err_str,
- size_t err_len);
+nub_process_t
+DNBProcessAttach(nub_process_t pid, struct timespec *timeout,
+ const RNBContext::IgnoredExceptions &ignored_exceptions,
+ char *err_str, size_t err_len);
+nub_process_t
+DNBProcessAttachByName(const char *name, struct timespec *timeout,
+ const RNBContext::IgnoredExceptions &ignored_exceptions,
+ char *err_str, size_t err_len);
nub_process_t DNBProcessAttachWait(RNBContext *ctx, const char *wait_name,
bool ignore_existing,
struct timespec *timeout,
diff --git a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
index 66d2bed6f8..bed98d3caf 100644
--- a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
@@ -180,10 +180,8 @@ kern_return_t DNBArchMachARM64::GetGPRState(bool force) {
reinterpret_cast<uint64_t>(m_state.context.gpr.__opaque_sp),
reinterpret_cast<uint64_t>(m_state.context.gpr.__opaque_pc)
#else
- m_state.context.gpr.__fp,
- m_state.context.gpr.__lr,
- m_state.context.gpr.__sp,
- m_state.context.gpr.__pc
+ m_state.context.gpr.__fp, m_state.context.gpr.__lr,
+ m_state.context.gpr.__sp, m_state.context.gpr.__pc
#endif
);
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp
index 7135cd5c3c..8ec2912e21 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -636,20 +636,24 @@ std::string RNBRemote::CompressString(const std::string &orig) {
}
size_t scratchbuf_size = 0;
switch (compression_type) {
- case compression_types::lz4:
- scratchbuf_size = compression_encode_scratch_buffer_size (COMPRESSION_LZ4_RAW);
- break;
- case compression_types::zlib_deflate:
- scratchbuf_size = compression_encode_scratch_buffer_size (COMPRESSION_ZLIB);
- break;
- case compression_types::lzma:
- scratchbuf_size = compression_encode_scratch_buffer_size (COMPRESSION_LZMA);
- break;
- case compression_types::lzfse:
- scratchbuf_size = compression_encode_scratch_buffer_size (COMPRESSION_LZFSE);
- break;
- default:
- break;
+ case compression_types::lz4:
+ scratchbuf_size =
+ compression_encode_scratch_buffer_size(COMPRESSION_LZ4_RAW);
+ break;
+ case compression_types::zlib_deflate:
+ scratchbuf_size =
+ compression_encode_scratch_buffer_size(COMPRESSION_ZLIB);
+ break;
+ case compression_types::lzma:
+ scratchbuf_size =
+ compression_encode_scratch_buffer_size(COMPRESSION_LZMA);
+ break;
+ case compression_types::lzfse:
+ scratchbuf_size =
+ compression_encode_scratch_buffer_size(COMPRESSION_LZFSE);
+ break;
+ default:
+ break;
}
if (scratchbuf_size > 0) {
g_libcompress_scratchbuf = (void*) malloc (scratchbuf_size);
@@ -661,29 +665,25 @@ std::string RNBRemote::CompressString(const std::string &orig) {
compressed_size = compression_encode_buffer(
encoded_data.data(), encoded_data_buf_size,
(const uint8_t *)orig.c_str(), orig.size(),
- g_libcompress_scratchbuf,
- COMPRESSION_LZ4_RAW);
+ g_libcompress_scratchbuf, COMPRESSION_LZ4_RAW);
}
if (compression_type == compression_types::zlib_deflate) {
compressed_size = compression_encode_buffer(
encoded_data.data(), encoded_data_buf_size,
(const uint8_t *)orig.c_str(), orig.size(),
- g_libcompress_scratchbuf,
- COMPRESSION_ZLIB);
+ g_libcompress_scratchbuf, COMPRESSION_ZLIB);
}
if (compression_type == compression_types::lzma) {
compressed_size = compression_encode_buffer(
encoded_data.data(), encoded_data_buf_size,
(const uint8_t *)orig.c_str(), orig.size(),
- g_libcompress_scratchbuf,
- COMPRESSION_LZMA);
+ g_libcompress_scratchbuf, COMPRESSION_LZMA);
}
if (compression_type == compression_types::lzfse) {
compressed_size = compression_encode_buffer(
encoded_data.data(), encoded_data_buf_size,
(const uint8_t *)orig.c_str(), orig.size(),
- g_libcompress_scratchbuf,
- COMPRESSION_LZFSE);
+ g_libcompress_scratchbuf, COMPRESSION_LZFSE);
}
if (compressed_size > 0) {
@@ -3898,8 +3898,8 @@ rnb_err_t RNBRemote::HandlePacket_v(const char *p) {
DNBLog("[LaunchAttach] START %d vAttach to pid %d", getpid(),
pid_attaching_to);
attach_pid = DNBProcessAttach(pid_attaching_to, &attach_timeout_abstime,
- m_ctx.GetIgnoredExceptions(),
- err_str, sizeof(err_str));
+ m_ctx.GetIgnoredExceptions(), err_str,
+ sizeof(err_str));
}
} else {
return HandlePacket_UNIMPLEMENTED(p);
@@ -3956,8 +3956,8 @@ rnb_err_t RNBRemote::HandlePacket_v(const char *p) {
return SendPacket(return_message);
}
uid_t my_uid, process_uid;
- if (attach_failed_due_to_uid_mismatch (pid_attaching_to,
- my_uid, process_uid)) {
+ if (attach_failed_due_to_uid_mismatch(pid_attaching_to, my_uid,
+ process_uid)) {
std::string my_username = "uid " + std::to_string (my_uid);
std::string process_username = "uid " + std::to_string (process_uid);
struct passwd *pw = getpwuid (my_uid);
@@ -3970,9 +3970,11 @@ rnb_err_t RNBRemote::HandlePacket_v(const char *p) {
}
DNBLogError("Tried to attach to process with uid mismatch");
std::string return_message = "E96;";
- std::string msg = "tried to attach to process as user '"
- + my_username + "' and process is running "
- "as user '" + process_username + "'";
+ std::string msg = "tried to attach to process as user '" +
+ my_username +
+ "' and process is running "
+ "as user '" +
+ process_username + "'";
return_message += cstring_to_asciihex_string(msg.c_str());
return SendPacket(return_message);
}
@@ -4014,8 +4016,7 @@ rnb_err_t RNBRemote::HandlePacket_v(const char *p) {
error_explainer += ")";
}
std::string default_return_msg = "E96;";
- default_return_msg += cstring_to_asciihex_string
- (error_explainer.c_str());
+ default_return_msg += cstring_to_asciihex_string(error_explainer.c_str());
SendPacket (default_return_msg);
DNBLogError("Attach failed: \"%s\".", err_str);
return rnb_err;
diff --git a/lldb/tools/debugserver/source/RNBRemote.h b/lldb/tools/debugserver/source/RNBRemote.h
index 07ce6e2b9a..7d68cd2cfb 100644
--- a/lldb/tools/debugserver/source/RNBRemote.h
+++ b/lldb/tools/debugserver/source/RNBRemote.h
@@ -108,35 +108,35 @@ public:
json_query_get_shared_cache_info, // 'jGetSharedCacheInfo'
pass_signals_to_inferior, // 'QPassSignals'
start_noack_mode, // 'QStartNoAckMode'
- prefix_reg_packets_with_tid, // 'QPrefixRegisterPacketsWithThreadID
- set_logging_mode, // 'QSetLogging:'
- set_ignored_exceptions, // 'QSetIgnoredExceptions'
- set_max_packet_size, // 'QSetMaxPacketSize:'
- set_max_payload_size, // 'QSetMaxPayloadSize:'
- set_environment_variable, // 'QEnvironment:'
- set_environment_variable_hex, // 'QEnvironmentHexEncoded:'
- set_launch_arch, // 'QLaunchArch:'
- set_disable_aslr, // 'QSetDisableASLR:'
- set_stdin, // 'QSetSTDIN:'
- set_stdout, // 'QSetSTDOUT:'
- set_stderr, // 'QSetSTDERR:'
- set_working_dir, // 'QSetWorkingDir:'
- set_list_threads_in_stop_reply, // 'QListThreadsInStopReply:'
- sync_thread_state, // 'QSyncThreadState:'
- memory_region_info, // 'qMemoryRegionInfo:'
- get_profile_data, // 'qGetProfileData'
- set_enable_profiling, // 'QSetEnableAsyncProfiling'
- enable_compression, // 'QEnableCompression:'
- watchpoint_support_info, // 'qWatchpointSupportInfo:'
- allocate_memory, // '_M'
- deallocate_memory, // '_m'
- set_process_event, // 'QSetProcessEvent:'
- save_register_state, // '_g'
- restore_register_state, // '_G'
- speed_test, // 'qSpeedTest:'
- set_detach_on_error, // 'QSetDetachOnError:'
- query_transfer, // 'qXfer:'
- json_query_dyld_process_state, // 'jGetDyldProcessState'
+ prefix_reg_packets_with_tid, // 'QPrefixRegisterPacketsWithThreadID
+ set_logging_mode, // 'QSetLogging:'
+ set_ignored_exceptions, // 'QSetIgnoredExceptions'
+ set_max_packet_size, // 'QSetMaxPacketSize:'
+ set_max_payload_size, // 'QSetMaxPayloadSize:'
+ set_environment_variable, // 'QEnvironment:'
+ set_environment_variable_hex, // 'QEnvironmentHexEncoded:'
+ set_launch_arch, // 'QLaunchArch:'
+ set_disable_aslr, // 'QSetDisableASLR:'
+ set_stdin, // 'QSetSTDIN:'
+ set_stdout, // 'QSetSTDOUT:'
+ set_stderr, // 'QSetSTDERR:'
+ set_working_dir, // 'QSetWorkingDir:'
+ set_list_threads_in_stop_reply, // 'QListThreadsInStopReply:'
+ sync_thread_state, // 'QSyncThreadState:'
+ memory_region_info, // 'qMemoryRegionInfo:'
+ get_profile_data, // 'qGetProfileData'
+ set_enable_profiling, // 'QSetEnableAsyncProfiling'
+ enable_compression, // 'QEnableCompression:'
+ watchpoint_support_info, // 'qWatchpointSupportInfo:'
+ allocate_memory, // '_M'
+ deallocate_memory, // '_m'
+ set_process_event, // 'QSetProcessEvent:'
+ save_register_state, // '_g'
+ restore_register_state, // '_G'
+ speed_test, // 'qSpeedTest:'
+ set_detach_on_error, // 'QSetDetachOnError:'
+ query_transfer, // 'qXfer:'
+ json_query_dyld_process_state, // 'jGetDyldProcessState'
unknown_type
};
diff --git a/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp b/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
index 6ab9ac60f5..1aa7037763 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
+++ b/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
@@ -1103,14 +1103,12 @@ extern "C" double putchard(double X) {
}
/// printd - printf that takes a double prints it as "%f\n", returning 0.
-extern "C"
-double printd(double X) {
+extern "C" double printd(double X) {
printf("%f", X);
return 0;
}
-extern "C"
-double printlf() {
+extern "C" double printlf() {
printf("\n");
return 0;
}
diff --git a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
index 63621bbc1a..82a4f2d959 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
+++ b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
@@ -1075,21 +1075,18 @@ static void MainLoop() {
//===----------------------------------------------------------------------===//
/// putchard - putchar that takes a double and returns 0.
-extern "C"
-double putchard(double X) {
+extern "C" double putchard(double X) {
putchar((char)X);
return 0;
}
/// printd - printf that takes a double prints it as "%f\n", returning 0.
-extern "C"
-double printd(double X) {
+extern "C" double printd(double X) {
printf("%f", X);
return 0;
}
-extern "C"
-double printlf() {
+extern "C" double printlf() {
printf("\n");
return 0;
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 5f3ee090bc..b405a43eb0 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -897,10 +897,10 @@ SDValue DAGTypeLegalizer::ScalarizeVecOp_STRICT_FP_ROUND(SDNode *N,
unsigned OpNo) {
assert(OpNo == 1 && "Wrong operand for scalarization!");
SDValue Elt = GetScalarizedVector(N->getOperand(1));
- SDValue Res = DAG.getNode(ISD::STRICT_FP_ROUND, SDLoc(N),
- { N->getValueType(0).getVectorElementType(),
- MVT::Other },
- { N->getOperand(0), Elt, N->getOperand(2) });
+ SDValue Res =
+ DAG.getNode(ISD::STRICT_FP_ROUND, SDLoc(N),
+ {N->getValueType(0).getVectorElementType(), MVT::Other},
+ {N->getOperand(0), Elt, N->getOperand(2)});
// Legalize the chain result - switch anything that used the old chain to
// use the new one.
ReplaceValueWith(SDValue(N, 1), Res.getValue(1));
@@ -3222,10 +3222,10 @@ SDValue DAGTypeLegalizer::SplitVecOp_UnaryOp(SDNode *N) {
InVT.getVectorElementCount());
if (N->isStrictFPOpcode()) {
- Lo = DAG.getNode(N->getOpcode(), dl, { OutVT, MVT::Other },
- { N->getOperand(0), Lo });
- Hi = DAG.getNode(N->getOpcode(), dl, { OutVT, MVT::Other },
- { N->getOperand(0), Hi });
+ Lo = DAG.getNode(N->getOpcode(), dl, {OutVT, MVT::Other},
+ {N->getOperand(0), Lo});
+ Hi = DAG.getNode(N->getOpcode(), dl, {OutVT, MVT::Other},
+ {N->getOperand(0), Hi});
// Build a factor node to remember that this operation is independent
// of the other one.
@@ -3965,10 +3965,10 @@ SDValue DAGTypeLegalizer::SplitVecOp_FP_ROUND(SDNode *N) {
InVT.getVectorElementCount());
if (N->isStrictFPOpcode()) {
- Lo = DAG.getNode(N->getOpcode(), DL, { OutVT, MVT::Other },
- { N->getOperand(0), Lo, N->getOperand(2) });
- Hi = DAG.getNode(N->getOpcode(), DL, { OutVT, MVT::Other },
- { N->getOperand(0), Hi, N->getOperand(2) });
+ Lo = DAG.getNode(N->getOpcode(), DL, {OutVT, MVT::Other},
+ {N->getOperand(0), Lo, N->getOperand(2)});
+ Hi = DAG.getNode(N->getOpcode(), DL, {OutVT, MVT::Other},
+ {N->getOperand(0), Hi, N->getOperand(2)});
// Legalize the chain result - switch anything that used the old chain to
// use the new one.
SDValue NewChain = DAG.getNode(ISD::TokenFactor, DL, MVT::Other,
diff --git a/llvm/lib/ExecutionEngine/IntelJITEvents/jitprofiling.c b/llvm/lib/ExecutionEngine/IntelJITEvents/jitprofiling.c
index e6748dabb5..6b6ce9c62b 100644
--- a/llvm/lib/ExecutionEngine/IntelJITEvents/jitprofiling.c
+++ b/llvm/lib/ExecutionEngine/IntelJITEvents/jitprofiling.c
@@ -90,10 +90,9 @@ static pthread_key_t threadLocalStorageHandle = (pthread_key_t)0;
#define INIT_TOP_Stack 10000
-typedef struct
-{
- unsigned int TopStack;
- unsigned int CurrentStack;
+typedef struct {
+ unsigned int TopStack;
+ unsigned int CurrentStack;
} ThreadStack, *pThreadStack;
/* end of virtual stack. */
@@ -108,65 +107,61 @@ typedef struct
* it will be -1 if EventSpecificData == 0 otherwise it will be 0.
*/
-ITT_EXTERN_C int JITAPI
-iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData)
-{
- int ReturnValue;
-
- /*
- * This section is for debugging outside of VTune.
- * It creates the environment variables that indicates call graph mode.
- * If running outside of VTune remove the remark.
- *
- *
- * static int firstTime = 1;
- * char DoCallGraph[12] = "DoCallGraph";
- * if (firstTime)
- * {
- * firstTime = 0;
- * SetEnvironmentVariable( "BISTRO_COLLECTORS_DO_CALLGRAPH", DoCallGraph);
- * }
- *
- * end of section.
- */
-
- /* initialization part - the functions have not been loaded yet. This part
- * will load the functions, and check if we are in Call Graph mode.
- * (for special treatment).
- */
- if (!FUNC_NotifyEvent)
- {
- if (iJIT_DLL_is_missing)
- return 0;
-
- /* load the Function from the DLL */
- if (!loadiJIT_Funcs())
- return 0;
-
- /* Call Graph initialization. */
- }
-
- /* If the event is method entry/exit, check that in the current mode
- * VTune is allowed to receive it
- */
- if ((event_type == iJVM_EVENT_TYPE_ENTER_NIDS ||
- event_type == iJVM_EVENT_TYPE_LEAVE_NIDS) &&
- (executionMode != iJIT_CALLGRAPH_ON))
- {
- return 0;
- }
- /* This section is performed when method enter event occurs.
- * It updates the virtual stack, or creates it if this is the first
- * method entry in the thread. The stack pointer is decreased.
- */
- if (event_type == iJVM_EVENT_TYPE_ENTER_NIDS)
- {
+ITT_EXTERN_C int JITAPI iJIT_NotifyEvent(iJIT_JVM_EVENT event_type,
+ void *EventSpecificData) {
+ int ReturnValue;
+
+ /*
+ * This section is for debugging outside of VTune.
+ * It creates the environment variables that indicates call graph mode.
+ * If running outside of VTune remove the remark.
+ *
+ *
+ * static int firstTime = 1;
+ * char DoCallGraph[12] = "DoCallGraph";
+ * if (firstTime)
+ * {
+ * firstTime = 0;
+ * SetEnvironmentVariable( "BISTRO_COLLECTORS_DO_CALLGRAPH", DoCallGraph);
+ * }
+ *
+ * end of section.
+ */
+
+ /* initialization part - the functions have not been loaded yet. This part
+ * will load the functions, and check if we are in Call Graph mode.
+ * (for special treatment).
+ */
+ if (!FUNC_NotifyEvent) {
+ if (iJIT_DLL_is_missing)
+ return 0;
+
+ /* load the Function from the DLL */
+ if (!loadiJIT_Funcs())
+ return 0;
+
+ /* Call Graph initialization. */
+ }
+
+ /* If the event is method entry/exit, check that in the current mode
+ * VTune is allowed to receive it
+ */
+ if ((event_type == iJVM_EVENT_TYPE_ENTER_NIDS ||
+ event_type == iJVM_EVENT_TYPE_LEAVE_NIDS) &&
+ (executionMode != iJIT_CALLGRAPH_ON)) {
+ return 0;
+ }
+ /* This section is performed when method enter event occurs.
+ * It updates the virtual stack, or creates it if this is the first
+ * method entry in the thread. The stack pointer is decreased.
+ */
+ if (event_type == iJVM_EVENT_TYPE_ENTER_NIDS) {
#if ITT_PLATFORM==ITT_PLATFORM_WIN
- pThreadStack threadStack =
- (pThreadStack)TlsGetValue (threadLocalStorageHandle);
+ pThreadStack threadStack =
+ (pThreadStack)TlsGetValue(threadLocalStorageHandle);
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
- pThreadStack threadStack =
- (pThreadStack)pthread_getspecific(threadLocalStorageHandle);
+ pThreadStack threadStack =
+ (pThreadStack)pthread_getspecific(threadLocalStorageHandle);
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/* check for use of reserved method IDs */
@@ -187,7 +182,7 @@ iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData)
}
/* decrease the stack. */
- ((piJIT_Method_NIDS) EventSpecificData)->stack_id =
+ ((piJIT_Method_NIDS)EventSpecificData)->stack_id =
(threadStack->CurrentStack)--;
}
@@ -200,11 +195,11 @@ iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData)
if (event_type == iJVM_EVENT_TYPE_LEAVE_NIDS)
{
#if ITT_PLATFORM==ITT_PLATFORM_WIN
- pThreadStack threadStack =
- (pThreadStack)TlsGetValue (threadLocalStorageHandle);
+ pThreadStack threadStack =
+ (pThreadStack)TlsGetValue(threadLocalStorageHandle);
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
- pThreadStack threadStack =
- (pThreadStack)pthread_getspecific(threadLocalStorageHandle);
+ pThreadStack threadStack =
+ (pThreadStack)pthread_getspecific(threadLocalStorageHandle);
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/* check for use of reserved method IDs */
@@ -217,13 +212,12 @@ iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData)
exit (1);
}
- ((piJIT_Method_NIDS) EventSpecificData)->stack_id =
+ ((piJIT_Method_NIDS)EventSpecificData)->stack_id =
++(threadStack->CurrentStack) + 1;
- if (((piJIT_Method_NIDS) EventSpecificData)->stack_id
- > threadStack->TopStack)
- ((piJIT_Method_NIDS) EventSpecificData)->stack_id =
- (unsigned int)-1;
+ if (((piJIT_Method_NIDS)EventSpecificData)->stack_id >
+ threadStack->TopStack)
+ ((piJIT_Method_NIDS)EventSpecificData)->stack_id = (unsigned int)-1;
}
if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED)
@@ -239,19 +233,16 @@ iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData)
}
/* The new mode call back routine */
-ITT_EXTERN_C void JITAPI
-iJIT_RegisterCallbackEx(void *userdata, iJIT_ModeChangedEx
- NewModeCallBackFuncEx)
-{
- /* is it already missing... or the load of functions from the DLL failed */
- if (iJIT_DLL_is_missing || !loadiJIT_Funcs())
- {
- /* then do not bother with notifications */
- NewModeCallBackFuncEx(userdata, iJIT_NO_NOTIFICATIONS);
- /* Error: could not load JIT functions. */
- return;
- }
- /* nothing to do with the callback */
+ITT_EXTERN_C void JITAPI iJIT_RegisterCallbackEx(
+ void *userdata, iJIT_ModeChangedEx NewModeCallBackFuncEx) {
+ /* is it already missing... or the load of functions from the DLL failed */
+ if (iJIT_DLL_is_missing || !loadiJIT_Funcs()) {
+ /* then do not bother with notifications */
+ NewModeCallBackFuncEx(userdata, iJIT_NO_NOTIFICATIONS);
+ /* Error: could not load JIT functions. */
+ return;
+ }
+ /* nothing to do with the callback */
}
/*
@@ -291,8 +282,7 @@ static int loadiJIT_Funcs(void)
iJIT_DLL_is_missing = 1;
FUNC_NotifyEvent = NULL;
- if (m_libHandle)
- {
+ if (m_libHandle) {
#if ITT_PLATFORM==ITT_PLATFORM_WIN
FreeLibrary(m_libHandle);
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
@@ -308,13 +298,13 @@ static int loadiJIT_Funcs(void)
{
DWORD envret = 0;
dllName = (char*)malloc(sizeof(char) * (dNameLength + 1));
- envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR,
- dllName, dNameLength);
+ envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR, dllName,
+ dNameLength);
if (envret)
{
/* Try to load the dll from the PATH... */
- m_libHandle = LoadLibraryExA(dllName,
- NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ m_libHandle =
+ LoadLibraryExA(dllName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
}
free(dllName);
} else {
@@ -324,8 +314,8 @@ static int loadiJIT_Funcs(void)
{
DWORD envret = 0;
dllName = (char*)malloc(sizeof(char) * (dNameLength + 1));
- envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR,
- dllName, dNameLength);
+ envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, dllName,
+ dNameLength);
if (envret)
{
/* Try to load the dll from the PATH... */
@@ -361,10 +351,10 @@ static int loadiJIT_Funcs(void)
/* if the dll wasn't loaded - exit. */
if (!m_libHandle)
{
- iJIT_DLL_is_missing = 1; /* don't try to initialize
- * JIT agent the second time
- */
- return 0;
+ iJIT_DLL_is_missing = 1; /* don't try to initialize
+ * JIT agent the second time
+ */
+ return 0;
}
#if ITT_PLATFORM==ITT_PLATFORM_WIN
@@ -372,10 +362,9 @@ static int loadiJIT_Funcs(void)
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
FUNC_NotifyEvent = (TPNotify)(intptr_t)dlsym(m_libHandle, "NotifyEvent");
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
- if (!FUNC_NotifyEvent)
- {
- FUNC_Initialize = NULL;
- return 0;
+ if (!FUNC_NotifyEvent) {
+ FUNC_Initialize = NULL;
+ return 0;
}
#if ITT_PLATFORM==ITT_PLATFORM_WIN
@@ -383,10 +372,9 @@ static int loadiJIT_Funcs(void)
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
FUNC_Initialize = (TPInitialize)(intptr_t)dlsym(m_libHandle, "Initialize");
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
- if (!FUNC_Initialize)
- {
- FUNC_NotifyEvent = NULL;
- return 0;
+ if (!FUNC_Initialize) {
+ FUNC_NotifyEvent = NULL;
+ return 0;
}
executionMode = (iJIT_IsProfilingActiveFlags)FUNC_Initialize();
@@ -421,11 +409,11 @@ ITT_EXTERN_C void JITAPI FinalizeThread(void)
if (threadLocalStorageHandle)
{
#if ITT_PLATFORM==ITT_PLATFORM_WIN
- pThreadStack threadStack =
- (pThreadStack)TlsGetValue (threadLocalStorageHandle);
+ pThreadStack threadStack =
+ (pThreadStack)TlsGetValue(threadLocalStorageHandle);
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
- pThreadStack threadStack =
- (pThreadStack)pthread_getspecific(threadLocalStorageHandle);
+ pThreadStack threadStack =
+ (pThreadStack)pthread_getspecific(threadLocalStorageHandle);
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
if (threadStack)
{
@@ -443,18 +431,17 @@ ITT_EXTERN_C void JITAPI FinalizeThread(void)
/*
* This function should be called by the user when the process ends,
* to free the local storage index
-*/
+ */
ITT_EXTERN_C void JITAPI FinalizeProcess(void)
{
- if (m_libHandle)
- {
+ if (m_libHandle) {
#if ITT_PLATFORM==ITT_PLATFORM_WIN
FreeLibrary(m_libHandle);
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
dlclose(m_libHandle);
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
m_libHandle = NULL;
- }
+ }
if (threadLocalStorageHandle)
#if ITT_PLATFORM==ITT_PLATFORM_WIN
diff --git a/llvm/lib/Support/regerror.c b/llvm/lib/Support/regerror.c
index b73d0cb787..20e8ef072f 100644
--- a/llvm/lib/Support/regerror.c
+++ b/llvm/lib/Support/regerror.c
@@ -96,7 +96,7 @@ llvm_regerror(int errcode, const llvm_regex_t *preg, char *errbuf, size_t errbuf
if (r->code == target)
break;
- if (errcode®_ITOA) {
+ if (errcode®_ITOA) {
if (r->code != 0) {
assert(strlen(r->name) < sizeof(convbuf));
(void) llvm_strlcpy(convbuf, r->name, sizeof convbuf);
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp
index 52d1ac40b6..b4c184cd05 100644
--- a/llvm/lib/TableGen/TGParser.cpp
+++ b/llvm/lib/TableGen/TGParser.cpp
@@ -1632,8 +1632,8 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) {
!ArgType->typeIsConvertibleTo(StringRecTy::get(Records)) &&
!ArgType->typeIsConvertibleTo(RecordRecTy::get(Records, {}))) {
Error(InitLoc, Twine("expected bit, bits, int, string, or record; "
- "got value of type '") + ArgType->getAsString() +
- "'");
+ "got value of type '") +
+ ArgType->getAsString() + "'");
return nullptr;
}
break;
@@ -1646,8 +1646,8 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) {
if (!ArgType->typeIsConvertibleTo(IntRecTy::get(Records)) &&
!ArgType->typeIsConvertibleTo(StringRecTy::get(Records))) {
Error(InitLoc, Twine("expected bit, bits, int, or string; "
- "got value of type '") + ArgType->getAsString() +
- "'");
+ "got value of type '") +
+ ArgType->getAsString() + "'");
return nullptr;
}
break;
diff --git a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index 9d06c05a51..75c3a15b0b 100644
--- a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -5318,9 +5318,11 @@ void PPCDAGToDAGISel::Select(SDNode *N) {
SDValue MDV = N->getOperand(MDIndex);
const MDNode *MD = cast<MDNodeSDNode>(MDV)->getMD();
assert(MD->getNumOperands() != 0 && "Empty MDNode in operands!");
- assert((isa<MDString>(MD->getOperand(0)) && cast<MDString>(
- MD->getOperand(0))->getString().equals("ppc-trap-reason"))
- && "Unsupported annotation data type!");
+ assert((isa<MDString>(MD->getOperand(0)) &&
+ cast<MDString>(MD->getOperand(0))
+ ->getString()
+ .equals("ppc-trap-reason")) &&
+ "Unsupported annotation data type!");
for (unsigned i = 1; i < MD->getNumOperands(); i++) {
assert(isa<MDString>(MD->getOperand(i)) &&
"Invalid data type for annotation ppc-trap-reason!");
diff --git a/llvm/lib/Target/PowerPC/PPCMachineScheduler.cpp b/llvm/lib/Target/PowerPC/PPCMachineScheduler.cpp
index 4e71364811..87aebe2096 100644
--- a/llvm/lib/Target/PowerPC/PPCMachineScheduler.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMachineScheduler.cpp
@@ -11,10 +11,11 @@
using namespace llvm;
-static cl::opt<bool>
-DisableAddiLoadHeuristic("disable-ppc-sched-addi-load",
- cl::desc("Disable scheduling addi instruction before"
- "load for ppc"), cl::Hidden);
+static cl::opt<bool> DisableAddiLoadHeuristic(
+ "disable-ppc-sched-addi-load",
+ cl::desc("Disable scheduling addi instruction before"
+ "load for ppc"),
+ cl::Hidden);
static cl::opt<bool>
EnableAddiHeuristic("ppc-postra-bias-addi",
cl::desc("Enable scheduling addi instruction as early"
diff --git a/llvm/lib/Target/PowerPC/PPCMacroFusion.cpp b/llvm/lib/Target/PowerPC/PPCMacroFusion.cpp
index eecf093c6b..301ab5d1f4 100644
--- a/llvm/lib/Target/PowerPC/PPCMacroFusion.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMacroFusion.cpp
@@ -49,9 +49,9 @@ private:
FusionOpSet OpSet2;
public:
FusionFeature(FusionKind Kind, bool HasFeature, int Index,
- const FusionOpSet &First, const FusionOpSet &Second) :
- Kd(Kind), Supported(HasFeature), DepOpIdx(Index), OpSet1(First),
- OpSet2(Second) {}
+ const FusionOpSet &First, const FusionOpSet &Second)
+ : Kd(Kind), Supported(HasFeature), DepOpIdx(Index), OpSet1(First),
+ OpSet2(Second) {}
bool hasOp1(unsigned Opc) const { return OpSet1.contains(Opc); }
bool hasOp2(unsigned Opc) const { return OpSet2.contains(Opc); }
diff --git a/llvm/tools/llvm-mca/Views/BottleneckAnalysis.h b/llvm/tools/llvm-mca/Views/BottleneckAnalysis.h
index 8c6adb45f6..adb5013658 100644
--- a/llvm/tools/llvm-mca/Views/BottleneckAnalysis.h
+++ b/llvm/tools/llvm-mca/Views/BottleneckAnalysis.h
@@ -46,12 +46,14 @@
/// | < loop carried >
/// |
/// | 0. vmulps %xmm0, %xmm0, %xmm2
-/// +----> 1. vhaddps %xmm2, %xmm2, %xmm3 ## RESOURCE interference: JFPA [ probability: 73% ]
+/// +----> 1. vhaddps %xmm2, %xmm2, %xmm3 ## RESOURCE interference: JFPA
+/// [ probability: 73% ]
/// +----> 2. vhaddps %xmm3, %xmm3, %xmm4 ## REGISTER dependency: %xmm3
/// |
/// | < loop carried >
/// |
-/// +----> 1. vhaddps %xmm2, %xmm2, %xmm3 ## RESOURCE interference: JFPA [ probability: 73% ]
+/// +----> 1. vhaddps %xmm2, %xmm2, %xmm3 ## RESOURCE interference: JFPA
+/// [ probability: 73% ]
///
///
/// The algorithm that computes the critical sequence is very similar to a
``````````
</details>
https://github.com/llvm/llvm-project/pull/82838
More information about the llvm-commits
mailing list