Ensure that destructor's needed by lldb make it into binary in non-inlined fashion

This commit is contained in:
breathe1
2024-11-15 17:15:09 +00:00
committed by Charles Schlosser
parent 0fb2ed140d
commit 040180078d
2 changed files with 21 additions and 0 deletions

View File

@@ -109,6 +109,20 @@ struct EigenBase {
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper<Derived, Device> device(Device& device);
template <typename Device>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper<const Derived, Device> device(Device& device) const;
/**
* By defining the empty destructor here, subclasses which override the destructor with `~SubClass = default` will not
* inline their destructor. This ensures ensures the destructor symbol will exists in the binary.
* This is needed to support expression evaluation in lldb (for _some_ reason). Without this hack, the destructor
* will be inlined and lldb will produce a missing symbol error (referring to eg ~MatrixBase destructor) when trying
* to evaluate an expression that returns an Eigen::Matrix.
*
* We use the normal default destructor to make the object trivially destructible when not debugging or when testing
* as the testsuite asserts std::is_trivially_destructible
*/
#if !defined(EIGEN_NO_DEBUG) && !defined(EIGEN_TESTING_PLAINOBJECT_CTOR)
EIGEN_DEVICE_FUNC ~EigenBase() {}
#endif
};
/***************************************************************************