[Lldb-commits] [clang] [lldb] [llvm] [mlir] [lldb][Core] Remove pointless condition (PR #89480)

2024-04-19 Thread Troy Butler via lldb-commits

https://github.com/Troy-Butler created 
https://github.com/llvm/llvm-project/pull/89480

Addresses issue #85984

>From fba4b0556340a00c1e059a8abdba5fdd1b0e38ea Mon Sep 17 00:00:00 2001
From: Troy-Butler 
Date: Mon, 25 Mar 2024 13:28:45 -0400
Subject: [PATCH 1/4] [LLVM][LIB] Refactor Redundant Condition

Signed-off-by: Troy-Butler 
---
 llvm/lib/TextAPI/TextStub.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/TextAPI/TextStub.cpp b/llvm/lib/TextAPI/TextStub.cpp
index 0f742523f8207c..d903ba409360d6 100644
--- a/llvm/lib/TextAPI/TextStub.cpp
+++ b/llvm/lib/TextAPI/TextStub.cpp
@@ -276,7 +276,7 @@ namespace yaml {
 template <> struct MappingTraits {
   static void mapping(IO &IO, ExportSection &Section) {
 const auto *Ctx = reinterpret_cast(IO.getContext());
-assert((!Ctx || (Ctx && Ctx->FileKind != FileType::Invalid)) &&
+assert((!Ctx || Ctx->FileKind != FileType::Invalid) &&
"File type is not set in YAML context");
 
 IO.mapRequired("archs", Section.Architectures);
@@ -298,7 +298,7 @@ template <> struct MappingTraits {
 template <> struct MappingTraits {
   static void mapping(IO &IO, UndefinedSection &Section) {
 const auto *Ctx = reinterpret_cast(IO.getContext());
-assert((!Ctx || (Ctx && Ctx->FileKind != FileType::Invalid)) &&
+assert((!Ctx || Ctx->FileKind != FileType::Invalid) &&
"File type is not set in YAML context");
 
 IO.mapRequired("archs", Section.Architectures);

>From 780151b741f5a992ee253f74f96cefbb2a2df960 Mon Sep 17 00:00:00 2001
From: Troy-Butler 
Date: Mon, 25 Mar 2024 13:28:45 -0400
Subject: [PATCH 2/4] [LLVM][TextAPI] Refactor Redundant Condition

Signed-off-by: Troy-Butler 
---
 llvm/lib/TextAPI/TextStub.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/TextAPI/TextStub.cpp b/llvm/lib/TextAPI/TextStub.cpp
index 0f742523f8207c..d903ba409360d6 100644
--- a/llvm/lib/TextAPI/TextStub.cpp
+++ b/llvm/lib/TextAPI/TextStub.cpp
@@ -276,7 +276,7 @@ namespace yaml {
 template <> struct MappingTraits {
   static void mapping(IO &IO, ExportSection &Section) {
 const auto *Ctx = reinterpret_cast(IO.getContext());
-assert((!Ctx || (Ctx && Ctx->FileKind != FileType::Invalid)) &&
+assert((!Ctx || Ctx->FileKind != FileType::Invalid) &&
"File type is not set in YAML context");
 
 IO.mapRequired("archs", Section.Architectures);
@@ -298,7 +298,7 @@ template <> struct MappingTraits {
 template <> struct MappingTraits {
   static void mapping(IO &IO, UndefinedSection &Section) {
 const auto *Ctx = reinterpret_cast(IO.getContext());
-assert((!Ctx || (Ctx && Ctx->FileKind != FileType::Invalid)) &&
+assert((!Ctx || Ctx->FileKind != FileType::Invalid) &&
"File type is not set in YAML context");
 
 IO.mapRequired("archs", Section.Architectures);

>From 7315c8468ac411f73f1ba9c304aae7d6bdfa2132 Mon Sep 17 00:00:00 2001
From: Troy-Butler 
Date: Thu, 18 Apr 2024 15:47:14 -0400
Subject: [PATCH 3/4] Fix Definition Mismatches

Signed-off-by: Troy-Butler 
---
 .../include/clang/StaticAnalyzer/Core/PathSensitive/Store.h | 4 ++--
 llvm/lib/Transforms/InstCombine/InstCombineInternal.h   | 2 +-
 llvm/lib/Transforms/Vectorize/VPlan.h   | 4 ++--
 .../SparseTensor/Transforms/Utils/SparseTensorLevel.h   | 6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h 
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h
index fac0c04ae2caab..e60a49f68b7a0d 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h
@@ -227,12 +227,12 @@ class StoreManager {
   ///   information will not be used.
   virtual StoreRef invalidateRegions(Store store,
   ArrayRef Values,
-  const Expr *E, unsigned Count,
+  const Expr *Ex, unsigned Count,
   const LocationContext *LCtx,
   const CallEvent *Call,
   InvalidatedSymbols &IS,
   RegionAndSymbolInvalidationTraits &ITraits,
-  InvalidatedRegions *InvalidatedTopLevel,
+  InvalidatedRegions *TopLevelRegions,
   InvalidatedRegions *Invalidated) = 0;
 
   /// enterStackFrame - Let the StoreManager to do something when execution
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h 
b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
index b9ad3a74007929..90293feb9c1b82 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
@@ -433,7 +433,7 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final
   Value *foldAndOrOfICmpsOf

[Lldb-commits] [clang] [lldb] [llvm] [mlir] [lldb][Core] Remove pointless condition (PR #89480)

2024-04-19 Thread Troy Butler via lldb-commits

https://github.com/Troy-Butler closed 
https://github.com/llvm/llvm-project/pull/89480
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [mlir] [lldb][Core] Remove pointless condition (PR #89480)

2024-04-19 Thread Troy Butler via lldb-commits

Troy-Butler wrote:

I apologize - I'm not sure how this happened. I was careful to refresh my 
fork/clone before starting on this issue, but somehow not all of the files were 
updated, and now my PR requests are getting wires crossed. I think it would be 
safest for me to close this issue, delete my existing fork/clone, and start 
fresh.

https://github.com/llvm/llvm-project/pull/89480
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][Core] Fix pointless if conditon (PR #89650)

2024-04-22 Thread Troy Butler via lldb-commits

https://github.com/Troy-Butler created 
https://github.com/llvm/llvm-project/pull/89650

Addresses #85984 

>From 8aed7cb301347db507de10106ed41f9c6be50b1b Mon Sep 17 00:00:00 2001
From: Troy-Butler 
Date: Mon, 22 Apr 2024 14:56:11 -0400
Subject: [PATCH] [lldb][Core] Fix pointless if conditon

Signed-off-by: Troy-Butler 
---
 lldb/source/Core/Debugger.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index ebd112110e5f2d..19b3cf3bbf46b1 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1115,9 +1115,6 @@ void Debugger::RunIOHandlerSync(const IOHandlerSP 
&reader_sp) {
   IOHandlerSP top_reader_sp = reader_sp;
 
   while (top_reader_sp) {
-if (!top_reader_sp)
-  break;
-
 top_reader_sp->Run();
 
 // Don't unwind past the starting point.

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


[Lldb-commits] [lldb] [lldb] Replace condition that always evaluates to false (PR #89685)

2024-04-22 Thread Troy Butler via lldb-commits

https://github.com/Troy-Butler created 
https://github.com/llvm/llvm-project/pull/89685

Addresses issue #87243. 

>From 20c093a1cd51adab9387e9a15fca7c8b592f3f21 Mon Sep 17 00:00:00 2001
From: Troy-Butler 
Date: Mon, 22 Apr 2024 19:17:08 -0400
Subject: [PATCH] [lldb] Replace always-false condition

Signed-off-by: Troy-Butler 
---
 .../Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index ea0a1cdff40f1e..7c7035e0c86c9e 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -61,7 +61,7 @@ Expected 
python::As(Expected &&obj) {
   if (!obj)
 return obj.takeError();
   PyObject *str_obj = PyObject_Str(obj.get().get());
-  if (!obj)
+  if (!str_obj)
 return llvm::make_error();
   auto str = Take(str_obj);
   auto utf8 = str.AsUTF8();

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


[Lldb-commits] [lldb] [lldb] Replace condition that always evaluates to false (PR #89685)

2024-04-22 Thread Troy Butler via lldb-commits

https://github.com/Troy-Butler edited 
https://github.com/llvm/llvm-project/pull/89685
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Replace condition that always evaluates to false (PR #89685)

2024-04-22 Thread Troy Butler via lldb-commits

Troy-Butler wrote:

> Otherwise this LGTM!



> Even though you link the issue, I would recommend also summarizing the issue 
> in the commit. Something like "The current code is checking the validity of 
> `obj` twice, instead of checking the new `str_obj` pointer."
> 
> Otherwise this LGTM!

I appreciate the advice, thank you! 

Also, I do not have the ability to merge. If everything looks good on your end, 
can you please merge with main? Thank you again!

https://github.com/llvm/llvm-project/pull/89685
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits