codemod 2010-2016 to 2010-present
[hiphop-php.git] / hphp / hhbbc / hhbbc.h
blobfc0740f6310975114383bb475e868ad3a3aa0bd8
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present 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_HPHP_HHBBC_H_
17 #define incl_HPHP_HHBBC_H_
19 #include <vector>
20 #include <memory>
21 #include <string>
22 #include <utility>
24 #include "hphp/hhbbc/options.h"
26 #include "hphp/runtime/base/repo-auth-type-array.h"
28 namespace HPHP { struct UnitEmitter; }
29 namespace HPHP { namespace HHBBC {
31 //////////////////////////////////////////////////////////////////////
34 * This is the public API to this subsystem.
37 //////////////////////////////////////////////////////////////////////
39 // Create a method map for the options structure from a SinglePassReadableRange
40 // containing a list of Class::methodName strings.
41 template<class SinglePassReadableRange>
42 MethodMap make_method_map(SinglePassReadableRange&);
44 //////////////////////////////////////////////////////////////////////
47 * Perform whole-program optimization on a set of UnitEmitters.
49 * Currently this process relies on some information from HPHPc. It
50 * expects AttrUnique/AttrPersistent have already been set up
51 * correctly (but won't be wrong if they aren't set up at all), and
52 * expects traits are already flattened (it might be wrong if they
53 * aren't).
55 std::pair<
56 std::vector<std::unique_ptr<UnitEmitter>>,
57 std::unique_ptr<ArrayTypeTable::Builder>
59 whole_program(std::vector<std::unique_ptr<UnitEmitter>>);
61 //////////////////////////////////////////////////////////////////////
64 * Main entry point when the program should behave like hhbbc.
66 int main(int argc, char** argv);
68 //////////////////////////////////////////////////////////////////////
72 #include "hphp/hhbbc/hhbbc-inl.h"
74 #endif