Chris Lattner | f42cce7 | 2006-10-25 04:09:21 +0000 | [diff] [blame^] | 1 | //===--- Stmt.cpp - Statement AST Node Implementation ---------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Chris Lattner and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the Stmt class and statement subclasses. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "clang/AST/Stmt.h" |
| 15 | #include "clang/AST/Expr.h" |
| 16 | #include <iostream> |
| 17 | using namespace llvm; |
| 18 | using namespace clang; |
| 19 | |
| 20 | void Stmt::dump() const { |
| 21 | if (this == 0) { |
| 22 | std::cerr << "<null>"; |
| 23 | return; |
| 24 | } |
| 25 | bool isExpr = dynamic_cast<const Expr*>(this) != 0; |
| 26 | if (isExpr) std::cerr << "("; |
| 27 | dump_impl(); |
| 28 | if (isExpr) std::cerr << ")"; |
| 29 | } |