[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 1 10:31:43 PDT 2019


teemperor added a comment.

As we're anyway throwing in reduced test cases, here is another version:

  struct PassByRef {
    // PassByRef should be pass by reference since the destructor is
    // user-defined which means it can not be passed in registers.
    ~PassByRef() {}
    int x = 0;
  };
  
  struct Foo {
    PassByRef bar(Foo *f) const {
      PassByRef b;
      if (this == f)
        b.x = 11223344;
      return b;
    }
  };
  
  int main() {
    Foo f;
    return f.bar(&f).x; // break here
  }

We can save the typing work for the two constructors by just making a non-trivial destructor.

(Also this patch currently deletes `TestGlobalVariables.py` which seems unintentional)


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

https://reviews.llvm.org/D61146





More information about the lldb-commits mailing list