blob: 9ee21153a86f04207ae247686909a29579e023c2 [file] [log] [blame]
Chris Lattnerf42cce72006-10-25 04:09:21 +00001//===--- 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>
17using namespace llvm;
18using namespace clang;
19
20void 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}