[Mlir-commits] [clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

Aaron Ballman llvmlistbot at llvm.org
Mon Jun 17 10:59:18 PDT 2024


================
@@ -430,11 +430,10 @@ class HTMLLogger : public Logger {
               AST.getSourceManager(), AST.getLangOpts());
           if (EltRange.isInvalid())
             continue;
-          if (EltRange.getBegin() < Range.getBegin() ||
-              EltRange.getEnd() >= Range.getEnd() ||
-              EltRange.getEnd() < Range.getBegin() ||
-              EltRange.getEnd() >= Range.getEnd())
+          if (EltRange.getEnd() <= Range.getBegin() ||
----------------
AaronBallman wrote:

This looks like it misses the case where `EltRange.getBegin() < Range.getBegin()`; shouldn't this be:
```
if (EltRange.getBegin() < Range.getBegin() ||
    EltRange.getEnd() >= Range.getEnd())
```

https://github.com/llvm/llvm-project/pull/95715


More information about the Mlir-commits mailing list