[all-commits] [llvm/llvm-project] fba68b: [LLDB][NFC] Remove unneeded conditional (#138321)

satyajanga via All-commits all-commits at lists.llvm.org
Fri May 2 18:36:29 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fba68b41190805d1755d24a829d7cdc74e946095
      https://github.com/llvm/llvm-project/commit/fba68b41190805d1755d24a829d7cdc74e946095
  Author: satyajanga <satyajanga at gmail.com>
  Date:   2025-05-02 (Fri, 02 May 2025)

  Changed paths:
    M lldb/source/Commands/CommandObjectPlatform.cpp

  Log Message:
  -----------
  [LLDB][NFC] Remove unneeded conditional (#138321)

we already check for `platform_sp` not null in one line below. 

existing code
```
if (platform_sp) {
      Status error;
      if (platform_sp) {
...
...
     }
}
```

`platform_sp` null check is redundant and error variable is unused. 

### TEST PLAN 
manual test 

```
satyajanga at devvm21837:toolchain $ ./bin/lldb
LLDB logging initialized. Logs stored in: /tmp
(lldb) platform select host
  Platform: host
    Triple: x86_64-*-linux-gnu
OS Version: 6.9.0 (6.9.0-0_fbk5_hardened_1_gf368ae920c1a)
  Hostname: 127.0.0.1
WorkingDir: /home/satyajanga/llvm-sand/build/Debug/fbcode-x86_64/toolchain
    Kernel: #1 SMP Tue Feb 11 07:24:41 PST 2025
    Kernel: Linux
   Release: 6.9.0-0_fbk5_hardened_1_gf368ae920c1a
   Version: #1 SMP Tue Feb 11 07:24:41 PST 2025
(lldb) platform process list
144 matching processes were found on "host"

PID    PARENT USER       TRIPLE                         NAME
====== ====== ========== ============================== ============================
130461 874915 satyajanga x86_64-*-linux-gnu             sushd
135505 874915 satyajanga x86_64-*-linux-gnu             hg.real
817146 874915 satyajanga x86_64-*-linux-gnu             vscode-thrift
874915 1      satyajanga                                
874947 874915 satyajanga                                
```

and running the existing tests
```
satyajanga at devvm21837:toolchain $ ./bin/llvm-lit -v  ~/llvm-sand/external/llvm-project/lldb/test/API/commands/platform/
-- Testing: 9 tests, 9 workers --
PASS: lldb-api :: commands/platform/file/read/TestPlatformFileRead.py (1 of 9)
PASS: lldb-api :: commands/platform/file/close/TestPlatformFileClose.py (2 of 9)
UNSUPPORTED: lldb-api :: commands/platform/sdk/TestPlatformSDK.py (3 of 9)
PASS: lldb-api :: commands/platform/basic/TestPlatformPython.py (4 of 9)
PASS: lldb-api :: commands/platform/basic/TestPlatformCommand.py (5 of 9)
PASS: lldb-api :: commands/platform/connect/TestPlatformConnect.py (6 of 9)
PASS: lldb-api :: commands/platform/process/launch/TestPlatformProcessLaunch.py (7 of 9)
PASS: lldb-api :: commands/platform/launchgdbserver/TestPlatformLaunchGDBServer.py (8 of 9)
PASS: lldb-api :: commands/platform/process/list/TestProcessList.py (9 of 9)

Testing Time: 13.48s

Total Discovered Tests: 9
  Unsupported: 1 (11.11%)
  Passed     : 8 (88.89%)
satyajanga at devvm21837:toolchain $ 
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list