mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 14:16:41 +00:00
Add Dump methods to printable types. (#681)
This commit is contained in:
1 parent
61abc44aef
commit
a8f56797b8
15 files changed
+43
-3
No files matched your search
@@ -14,6 +14,7 @@
|
||||
#include "executable_semantics/ast/struct_definition.h"
|
||||
#include "executable_semantics/interpreter/address.h"
|
||||
#include "executable_semantics/interpreter/dictionary.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
@@ -84,6 +85,7 @@ class Declaration {
|
||||
auto GetVariableDeclaration() const -> const VariableDeclaration&;
|
||||
|
||||
void Print(llvm::raw_ostream& out) const;
|
||||
LLVM_DUMP_METHOD void Dump() const { Print(llvm::errs()); }
|
||||
|
||||
inline auto tag() const -> DeclarationKind {
|
||||
return std::visit([](const auto& t) { return t.Kind; }, value);
|
||||
|
||||
Reference in new issue
Block a user