Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip (#9029) #9030

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions hphp/hack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ invoke_dune(hack_dune all)

set(CARGO_BUILD "${CMAKE_SOURCE_DIR}/hphp/hack/scripts/build_rust_to_ocaml.sh")

set(OPCODES "${CMAKE_SOURCE_DIR}/hphp/tools/hhbc-gen/opcodes.rs")

add_executable(gen-rust1 "${CMAKE_SOURCE_DIR}/hphp/tools/hhbc-gen/gen-rust.cpp")
target_link_libraries(gen-rust1 folly)
add_custom_command(
OUTPUT "${OPCODES}"
COMMAND gen-rust1 >> "${OPCODES}"
COMMENT "Generating opcodes.rs"
)

if(DEFINED ENV{HACKDEBUG})
set(PROFILE "debug")
else()
Expand Down Expand Up @@ -196,7 +206,7 @@ add_custom_command(
${CARGO_BUILD} ffi_cbindgen ffi_cbindgen --exe
--header "${HHBC_AST_HEADER}" --srcs "${HHBC_AST_SRC_ARG}" --namespaces "HPHP,hackc,hhbc"
--includes "${FFI_HEADER},${NAMING_SPECIAL_NAMES_HEADER},${TYPE_CONSTRAINT_HEADER},${ATTR_HEADER},${FCALL_HEADER},${HHBC_HEADER}"
DEPENDS rustc cargo
DEPENDS rustc cargo "${OPCODES}"
COMMENT "Generating hhbc-ast.h"
)

Expand Down Expand Up @@ -230,7 +240,7 @@ function(build_cxx_bridge NAME FFI_BRIDGE_DIR)
${CMAKE_COMMAND} -E copy "${GENERATED}.rs.cc" "${RUST_PART_CXX}" &&
${CMAKE_COMMAND} -E copy "${GENERATED}.rs.h" "${RUST_PART_HEADER}"
WORKING_DIRECTORY ${FFI_BRIDGE_SRC}
DEPENDS rustc cargo
DEPENDS rustc cargo "${OPCODES}"
)
add_custom_target(
"${NAME}_cxx"
Expand Down Expand Up @@ -264,8 +274,8 @@ endif()
# you're working with Hack, but means that e.g. hhvm can't find
# `hh_single_compile` in the source tree. Keep it around, but require it to be
# explicitly used
add_custom_target(hack ALL DEPENDS hack_dune)
add_custom_target(hack_test DEPENDS hack_dune_test)
add_custom_target(hack ALL DEPENDS hack_dune "${OPCODES}")
add_custom_target(hack_test DEPENDS hack_dune_test "${OPCODES}")

configure_file(dev_env.sh.in dev_env.sh ESCAPE_QUOTES @ONLY)
configure_file(dev_env_common.sh.in dev_env_common.sh ESCAPE_QUOTES @ONLY)
Expand Down
2 changes: 1 addition & 1 deletion hphp/hack/src/facts/dune
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
(name facts)
(wrapped false)
(modules facts facts_parser rust_facts_ffi)
(libraries core_kernel hhbc parser rust_facts_ffi utils_hash)
(libraries core_kernel parser rust_facts_ffi utils_hash)
(preprocess
(pps ppx_deriving.std)))
1 change: 0 additions & 1 deletion hphp/hack/src/facts/symbols/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
facts
folly_stubs
heap_shared_mem_hash
hhbc
hhi
parser
process
Expand Down
57 changes: 0 additions & 57 deletions hphp/hack/src/hackc/dune

This file was deleted.

268 changes: 1 addition & 267 deletions hphp/runtime/vm/hhbc.h

Large diffs are not rendered by default.

292 changes: 292 additions & 0 deletions hphp/runtime/vm/opcodes.h

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion hphp/tools/hhbc-gen/gen-rust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/

#include <cstdio>
#include "hphp/runtime/vm/hhbc.h"
#include <cstring>
#include "hphp/runtime/vm/opcodes.h"

using namespace HPHP;

Expand Down