1 //===-- tools/f18/dump.cpp ------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines Dump routines available for calling from the debugger.
10 // Each is based on operator<< for that type. There are overloadings for
11 // reference and pointer, and for dumping to a provided raw_ostream or errs().
15 #include "llvm/Support/raw_ostream.h"
17 #define DEFINE_DUMP(ns, name) \
20 llvm::raw_ostream &operator<<(llvm::raw_ostream &, const name &); \
22 void Dump(llvm::raw_ostream &os, const ns::name &x) { os << x << '\n'; } \
23 void Dump(llvm::raw_ostream &os, const ns::name *x) { \
29 void Dump(const ns::name &x) { Dump(llvm::errs(), x); } \
30 void Dump(const ns::name *x) { Dump(llvm::errs(), *x); }
33 DEFINE_DUMP(parser
, Name
)
34 DEFINE_DUMP(parser
, CharBlock
)
35 DEFINE_DUMP(semantics
, Symbol
)
36 DEFINE_DUMP(semantics
, Scope
)
37 DEFINE_DUMP(semantics
, IntrinsicTypeSpec
)
38 DEFINE_DUMP(semantics
, DerivedTypeSpec
)
39 DEFINE_DUMP(semantics
, DeclTypeSpec
)
40 } // namespace Fortran