Remove duplicate code in compile.rs
commit9ce3dd0177871a37e9fde90a43a3797d3ff29b27
authorMillie Chen <milliechen@fb.com>
Tue, 21 Sep 2021 23:43:27 +0000 (21 16:43 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 21 Sep 2021 23:45:21 +0000 (21 16:45 -0700)
tree573829cb12a345ce227bc055cdbb5f7051a251f7
parent2a73739c5762f45f41263c47aa105a7880cd9512
Remove duplicate code in compile.rs

Summary: Previously `hhbc_by_ref_compile:from_text_` and `hhbc_by_ref_compile:hhas_from_text_` use the same block of code to generate an hhas program, except the former also prints the program and the latter simply returns the generated program. This diff factors out the common bits to minimize duplicate code.

Reviewed By: shayne-fletcher

Differential Revision: D31072068

fbshipit-source-id: 4636aa75a39db21e644f87cbfdfc7ed3f2ea6535
hphp/hack/src/hhbc/compile_ffi.rs
hphp/hack/src/hhbc/hhbc_by_ref/compile.rs