allow undefined data-* and aria-* XHP attributes with ->:
[hiphop-php.git] / hphp / hhbbc / debug.h
blob7b68ad3abcf6b90d89ace58f5fd0788487732377
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2014 Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #ifndef incl_HHBBC_DEBUG_H_
17 #define incl_HHBBC_DEBUG_H_
19 #include "hphp/util/trace.h"
21 #include "hphp/hhbbc/misc.h"
22 #include "hphp/hhbbc/representation.h"
23 #include "hphp/hhbbc/unit-util.h"
25 namespace HPHP { namespace HHBBC {
27 //////////////////////////////////////////////////////////////////////
30 * If the hhbbc_dump trace module is on, dump the entire program to a
31 * temporary directory as readable text.
33 void debug_dump_program(const Index&, const php::Program&);
36 * Utilities for printing the state of the program after various
37 * transformations.
40 inline void banner(const char* what) {
41 TRACE_SET_MOD(hhbbc);
42 FTRACE(2, "{:-^70}\n", what);
45 inline void state_after(const char* when, const php::Program& program) {
46 TRACE_SET_MOD(hhbbc);
47 banner(when);
48 for (auto& u : program.units) {
49 Trace::Bump bumper{Trace::hhbbc, kSystemLibBump, is_systemlib_part(*u)};
50 FTRACE(4, "{}", show(*u));
52 banner("");
55 //////////////////////////////////////////////////////////////////////
59 #endif