[sil] Add SILValue::dump() for use in the debugger.

It just trampolines to calling ValueBase::dump(). The reason I added this is
sometimes one wants to do this in the debugger and confuses if one has a
ValueBase or a SILValue causing lldb to be unhappy. By mirroring this API, one
can do the same operation on either type and just move on with ones life.

I also wrapped this in LLVM_ATTRIBUTE_DEPRECATED with a msg saying only for use
in the debugger so people do not call dump() in the codebase by mistake.
This commit is contained in:
Michael Gottesman
2021-11-02 09:53:47 -07:00
parent de0aaec6d8
commit a670a34f75
2 changed files with 8 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
namespace swift {
@@ -642,6 +643,9 @@ public:
/// Verify that this SILValue and its uses respects ownership invariants.
void verifyOwnership(DeadEndBlocks *DEBlocks) const;
LLVM_ATTRIBUTE_DEPRECATED(void dump() const LLVM_ATTRIBUTE_USED,
"Only for use in the debugger");
};
inline SILNodePointer::SILNodePointer(SILValue value) : node(value) { }