[all-commits] [llvm/llvm-project] ccd909: [lldb][NFC] Don't let Process inherit from UserID

Raphael Isemann via All-commits all-commits at lists.llvm.org
Wed Nov 18 05:34:19 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ccd9091d4a2fd55cb455e61fa77530e1a5de6e69
      https://github.com/llvm/llvm-project/commit/ccd9091d4a2fd55cb455e61fa77530e1a5de6e69
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-11-18 (Wed, 18 Nov 2020)

  Changed paths:
    M lldb/include/lldb/Target/Process.h
    M lldb/source/Target/Process.cpp

  Log Message:
  -----------
  [lldb][NFC] Don't let Process inherit from UserID

I noticed that Process is inheriting from UserID to store its PID value. This patch
replaces this with a dedicated field in the Process class. This is NFC, but has some
small effects on the code using Process:
* `GetID()` now returns a `lldb::pid_t` like all other process code instead of `lldb::user_id_t`. Both are typedefs for `uint64_t`, so no change in behaviour.
* The equality operators defined for UserID no longer accept Process instances.
* Removes the inherited method `Process::Clear()` which didn't actually clear anything beside the PID value.

We maybe should also remove the getters/setters to `S/GetPID` or something like that. I can update all the code for that
in a follow-up NFC commit.

Reviewed By: labath

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




More information about the All-commits mailing list