[Lldb-commits] [PATCH] D142007: [NFC] Fix "form/from" typos

2023-01-22 Thread Piotr Fusik via Phabricator via lldb-commits
pfusik added a comment.

@ldionne Can you check it in?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142007/new/

https://reviews.llvm.org/D142007

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D142309: [LLDB][NFC] Fix a incorrect use of shared_ptr in RenderScriptRuntime.cpp

2023-01-22 Thread Shivam Gupta via Phabricator via lldb-commits
xgupta created this revision.
xgupta added reviewers: jingham, JDevlieghere.
Herald added a project: All.
xgupta requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Incorrect use of shared_ptr.

found by PVS-Studio https://pvs-studio.com/en/blog/posts/cpp/1003/, N8 & N9.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142309

Files:
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp


Index: 
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
===
--- 
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ 
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -2368,10 +2368,7 @@
 
   // Allocate a buffer to copy data into
   const uint32_t size = *alloc->size.get();
-  std::shared_ptr buffer(new uint8_t[size]);
-  if (!buffer) {
-LLDB_LOGF(log, "%s - couldn't allocate a %" PRIu32 " byte buffer",
-  __FUNCTION__, size);
+  std::shared_ptr buffer(new uint8_t[size]);
 return nullptr;
   }
 


Index: lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
===
--- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -2368,10 +2368,7 @@
 
   // Allocate a buffer to copy data into
   const uint32_t size = *alloc->size.get();
-  std::shared_ptr buffer(new uint8_t[size]);
-  if (!buffer) {
-LLDB_LOGF(log, "%s - couldn't allocate a %" PRIu32 " byte buffer",
-  __FUNCTION__, size);
+  std::shared_ptr buffer(new uint8_t[size]);
 return nullptr;
   }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D142007: [NFC] Fix "form/from" typos

2023-01-22 Thread Mark de Wever via Phabricator via lldb-commits
Mordante added a comment.

In D142007#4071765 , @pfusik wrote:

> @ldionne Can you check it in?

Can you provide your name and email address to we can attribute the patch to 
you?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142007/new/

https://reviews.llvm.org/D142007

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D142007: [NFC] Fix "form/from" typos

2023-01-22 Thread Piotr Fusik via Phabricator via lldb-commits
pfusik added a comment.

In D142007#4072036 , @Mordante wrote:

> Can you provide your name and email address to we can attribute the patch to 
> you?

Piotr Fusik 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142007/new/

https://reviews.llvm.org/D142007

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 898b5c9 - [NFC] Fix "form/from" typos

2023-01-22 Thread Mark de Wever via lldb-commits

Author: Piotr Fusik
Date: 2023-01-22T20:05:51+01:00
New Revision: 898b5c9f5e7715f3ea4bb0ca2a8f23c301efa9c2

URL: 
https://github.com/llvm/llvm-project/commit/898b5c9f5e7715f3ea4bb0ca2a8f23c301efa9c2
DIFF: 
https://github.com/llvm/llvm-project/commit/898b5c9f5e7715f3ea4bb0ca2a8f23c301efa9c2.diff

LOG: [NFC] Fix "form/from" typos

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D142007

Added: 


Modified: 
clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
libcxx/include/__format/extended_grapheme_cluster_table.h
libcxx/utils/generate_extended_grapheme_cluster_table.py
lldb/include/lldb/Host/File.h
lldb/source/Plugins/CMakeLists.txt
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
llvm/lib/Analysis/IVDescriptors.cpp
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
llvm/test/DebugInfo/ARM/PR26163.ll
llvm/tools/llvm-exegesis/lib/Clustering.cpp
llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp
mlir/lib/Dialect/Transform/IR/TransformDialect.cpp

Removed: 




diff  --git a/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp 
b/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
index 7286f940328ee..44166aaf5b85b 100644
--- a/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
@@ -1095,7 +1095,7 @@ ObjCLoopChecker::checkPointerEscape(ProgramStateRef State,
 PointerEscapeKind Kind) const {
   SymbolRef ImmutableReceiver = getMethodReceiverIfKnownImmutable(Call);
 
-  // Remove the invalidated symbols form the collection count map.
+  // Remove the invalidated symbols from the collection count map.
   for (InvalidatedSymbols::const_iterator I = Escaped.begin(),
E = Escaped.end();
I != E; ++I) {

diff  --git a/libcxx/include/__format/extended_grapheme_cluster_table.h 
b/libcxx/include/__format/extended_grapheme_cluster_table.h
index 0e00670df780b..1ffcfeb549686 100644
--- a/libcxx/include/__format/extended_grapheme_cluster_table.h
+++ b/libcxx/include/__format/extended_grapheme_cluster_table.h
@@ -111,7 +111,7 @@ enum class __property : uint8_t {
 /// - https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt
 ///
 /// The data has 3 values
-/// - bits [0, 3] The property. One of the values generated form the datafiles
+/// - bits [0, 3] The property. One of the values generated from the datafiles
 ///   of \ref __property
 /// - bits [4, 10] The size of the range.
 /// - bits [11, 31] The lower bound code point of the range. The upper bound of

diff  --git a/libcxx/utils/generate_extended_grapheme_cluster_table.py 
b/libcxx/utils/generate_extended_grapheme_cluster_table.py
index 7dd201615ee03..2762c013214f9 100755
--- a/libcxx/utils/generate_extended_grapheme_cluster_table.py
+++ b/libcxx/utils/generate_extended_grapheme_cluster_table.py
@@ -99,7 +99,7 @@ def compactPropertyRanges(input: list[PropertyRange]) -> 
list[PropertyRange]:
 /// - https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt
 ///
 /// The data has 3 values
-/// - bits [0, 3] The property. One of the values generated form the datafiles
+/// - bits [0, 3] The property. One of the values generated from the datafiles
 ///   of \\ref __property
 /// - bits [4, 10] The size of the range.
 /// - bits [11, 31] The lower bound code point of the range. The upper bound of

diff  --git a/lldb/include/lldb/Host/File.h b/lldb/include/lldb/Host/File.h
index b2e7ebf5bba35..a1199a51b8a69 100644
--- a/lldb/include/lldb/Host/File.h
+++ b/lldb/include/lldb/Host/File.h
@@ -226,7 +226,7 @@ class File : public IOObject {
   /// A buffer where to put the bytes that are read.
   ///
   /// \param[in,out] num_bytes
-  /// The number of bytes to read form the current file position
+  /// The number of bytes to read from the current file position
   /// which gets modified with the number of bytes that were read.
   ///
   /// \param[in,out] offset

diff  --git a/lldb/source/Plugins/CMakeLists.txt 
b/lldb/source/Plugins/CMakeLists.txt
index 84cc065c3ca5a..855c9f671f479 100644
--- a/lldb/source/Plugins/CMakeLists.txt
+++ b/lldb/source/Plugins/CMakeLists.txt
@@ -36,7 +36,7 @@ set(LLDB_PROCESS_WINDOWS_PLUGIN "")
 set(LLDB_PROCESS_GDB_PLUGIN "")
 
 foreach(p ${LLDB_ALL_PLUGINS})
-  # Strip lldbPlugin form the plugin name.
+  # Strip lldbPlugin from the plugin name.
   string(SUBSTRING ${p} 10 -1 pStripped)
   if(${pStripped} MATCHES "^ScriptInterpreter*")
 set(LLDB_ENUM_PLUGINS 
"${LLDB_ENUM_PLUGINS}LLDB_SCRIPT_PLUGIN(${pStripped})\n")

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSyste

[Lldb-commits] [PATCH] D142007: [NFC] Fix "form/from" typos

2023-01-22 Thread Mark de Wever via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG898b5c9f5e77: [NFC] Fix "form/from" typos 
(authored by pfusik, committed by Mordante).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142007/new/

https://reviews.llvm.org/D142007

Files:
  clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
  libcxx/include/__format/extended_grapheme_cluster_table.h
  libcxx/utils/generate_extended_grapheme_cluster_table.py
  lldb/include/lldb/Host/File.h
  lldb/source/Plugins/CMakeLists.txt
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
  llvm/lib/Analysis/IVDescriptors.cpp
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
  llvm/test/DebugInfo/ARM/PR26163.ll
  llvm/tools/llvm-exegesis/lib/Clustering.cpp
  llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
  llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp
  mlir/lib/Dialect/Transform/IR/TransformDialect.cpp

Index: mlir/lib/Dialect/Transform/IR/TransformDialect.cpp
===
--- mlir/lib/Dialect/Transform/IR/TransformDialect.cpp
+++ mlir/lib/Dialect/Transform/IR/TransformDialect.cpp
@@ -74,7 +74,7 @@
 
 void transform::TransformDialect::mergeInPDLMatchHooks(
 llvm::StringMap &&constraintFns) {
-  // Steal the constraint functions form the given map.
+  // Steal the constraint functions from the given map.
   for (auto &it : constraintFns)
 pdlMatchHooks.registerConstraintFunction(it.getKey(), std::move(it.second));
 }
Index: llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp
===
--- llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp
+++ llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp
@@ -130,7 +130,7 @@
 }
 
 TEST(RandomIRBuilderTest, ShuffleVectorSink) {
-  // Check that we will never use shuffle vector mask as a sink form the
+  // Check that we will never use shuffle vector mask as a sink from the
   // unrelated operation.
 
   LLVMContext Ctx;
Index: llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
===
--- llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
+++ llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
@@ -6,7 +6,7 @@
 //
 //===--===//
 //
-// This test suite verifies basic MCJIT functionality when invoked form the C
+// This test suite verifies basic MCJIT functionality when invoked from the C
 // API.
 //
 //===--===//
Index: llvm/tools/llvm-exegesis/lib/Clustering.cpp
===
--- llvm/tools/llvm-exegesis/lib/Clustering.cpp
+++ llvm/tools/llvm-exegesis/lib/Clustering.cpp
@@ -314,7 +314,7 @@
   // Actually append to-be-moved points to the new cluster.
   UnstableCluster.PointIndices.insert(UnstableCluster.PointIndices.end(),
   it, OldCluster.PointIndices.end());
-  // And finally, remove "to-be-moved" points form the old cluster.
+  // And finally, remove "to-be-moved" points from the old cluster.
   OldCluster.PointIndices.erase(it, OldCluster.PointIndices.end());
   // Now, the old cluster may end up being empty, but let's just keep it
   // in whatever state it ended up. Purging empty clusters isn't worth it.
Index: llvm/test/DebugInfo/ARM/PR26163.ll
===
--- llvm/test/DebugInfo/ARM/PR26163.ll
+++ llvm/test/DebugInfo/ARM/PR26163.ll
@@ -17,7 +17,7 @@
 ; CHECK-NEXT: DW_AT_location (DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4)
 ; CHECK-NEXT: DW_AT_abstract_origin
 
-; Created form the following test case (PR26163) with
+; Created from the following test case (PR26163) with
 ; clang -cc1 -triple armv4t--freebsd11.0-gnueabi -emit-obj -debug-info-kind=standalone -O2 -x c test.c
 ;
 ; typedef	unsigned int	size_t;
Index: llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
===
--- llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
+++ llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
@@ -722,7 +722,7 @@
 
 /// Updates the operand at Idx in instruction Inst with the result of
 ///instruction Mat. If the instruction is a PHI node then special
-///handling for duplicate values form the same incoming basic block is
+///handling for duplicate values from the same incoming basic block is
 ///required.
 /// \return The update will always succeed, but the return value indicated if
 /// Mat was used for the update or not.
Index: ll

[Lldb-commits] [PATCH] D142007: [NFC] Fix "form/from" typos

2023-01-22 Thread Mark de Wever via Phabricator via lldb-commits
Mordante added a comment.

Thanks for your contribution, I just landed this patch on your behalf.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142007/new/

https://reviews.llvm.org/D142007

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] caa99a0 - Use llvm::popcount instead of llvm::countPopulation(NFC)

2023-01-22 Thread Kazu Hirata via lldb-commits

Author: Kazu Hirata
Date: 2023-01-22T12:48:51-08:00
New Revision: caa99a01f5dd2f865df318a2f93abc811273a25d

URL: 
https://github.com/llvm/llvm-project/commit/caa99a01f5dd2f865df318a2f93abc811273a25d
DIFF: 
https://github.com/llvm/llvm-project/commit/caa99a01f5dd2f865df318a2f93abc811273a25d.diff

LOG: Use llvm::popcount instead of llvm::countPopulation(NFC)

Added: 


Modified: 
clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h
clang/lib/Basic/Sanitizers.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Symbol/CompactUnwindInfo.cpp
llvm/include/llvm/ADT/APInt.h
llvm/include/llvm/ADT/BitVector.h
llvm/include/llvm/ADT/SmallBitVector.h
llvm/include/llvm/ADT/SparseBitVector.h
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/include/llvm/MC/LaneBitmask.h
llvm/include/llvm/MC/SubtargetFeature.h
llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h
llvm/lib/Analysis/MemoryProfileInfo.cpp
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/lib/CodeGen/MachinePipeliner.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp
llvm/lib/MC/MCSchedule.cpp
llvm/lib/MCA/HardwareUnits/ResourceManager.cpp
llvm/lib/MCA/InstrBuilder.cpp
llvm/lib/MCA/Stages/ExecuteStage.cpp
llvm/lib/Support/APInt.cpp
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
llvm/lib/Target/AMDGPU/EvergreenInstructions.td
llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.h
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.h
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp
llvm/lib/Target/X86/X86FloatingPoint.cpp
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/tools/llvm-exegesis/lib/SchedClassResolution.cpp
llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
llvm/utils/TableGen/CodeGenDAGPatterns.h
mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

Removed: 




diff  --git a/clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h 
b/clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h
index 9fc4689da22b7..1706b6936c9ea 100644
--- a/clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h
+++ b/clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h
@@ -226,7 +226,7 @@ class LRTable {
   // Count the number of values since the checkpoint.
   Word BelowKeyMask = KeyMask - 1;
   unsigned CountSinceCheckpoint =
-  llvm::countPopulation(HasValue[KeyWord] & BelowKeyMask);
+  llvm::popcount(HasValue[KeyWord] & BelowKeyMask);
   // Find the value relative to the last checkpoint.
   return Values[Checkpoints[KeyWord] + CountSinceCheckpoint];
 }

diff  --git a/clang/lib/Basic/Sanitizers.cpp b/clang/lib/Basic/Sanitizers.cpp
index 7d903c8fdf5ec..62ccdf8e9bbf2 100644
--- a/clang/lib/Basic/Sanitizers.cpp
+++ b/clang/lib/Basic/Sanitizers.cpp
@@ -61,7 +61,7 @@ namespace clang {
 unsigned SanitizerMask::countPopulation() const {
   unsigned total = 0;
   for (const auto &Val : maskLoToHigh)
-total += llvm::countPopulation(Val);
+total += llvm::popcount(Val);
   return total;
 }
 

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 2716cf0cc56a8..d1745d970c441 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -8970,7 +8970,7 @@ static bool DumpEnumValue(const clang::QualType 
&qual_type, Stream *s,
   for (auto *enumerator : enum_decl->enumerators()) {
 uint64_t val = enumerator->getInitVal().getSExtValue();
 val = llvm::SignExtend64(val, 8*byte_size);
-if (llvm::countPopulation(val) != 1 && (val & ~covered_bits) != 0)
+if (llvm::popcount(val) != 1 && (val & ~covered_bits) != 0)
   can_be_bitfield = false;
 covered_bits |= val;
 ++num_enumerators;
@@ -9006,9 +9006,10 @@ st