Split up compiler.cpp (#15355)
authorZachary DeVito <zdevito@fb.com>
Wed, 19 Dec 2018 03:41:00 +0000 (19:41 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 19 Dec 2018 03:43:35 +0000 (19:43 -0800)
commit0368054a6d2aaa07d53c45cae374663d83425612
treed0590cb7b699c6366ef664f1e25657f8fb5ce086
parent6ab2e7442ddaa1aee9fc5cb936b4bcca03f2c121
Split up compiler.cpp (#15355)

Summary:
This separates the different parts of compiler.cpp to make their relationship more clear. In particular it adds:

* sugared_value.{h,cpp} - all the public SugaredValues that the compiler defines and a few that were inside compiler.cpp
* type_parser.{h, cpp} - Turns TreeRef's defining types into TypePtr
* schema_matching.{h, cpp} - infrastructure for matching arguments against overloaded schema and emitting builtin operators with a particular schema.
Retains:
* compiler.{h, cpp} - now responsible simply for the `defineMethodsInModule` infra structure.

Some utility functions like inlineCallTo have moved to ir.h.

Only thing that is not a move is some changes in module.h/cpp that remove multiple returns from `Method::emit_call_to`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15355

Reviewed By: suo, wanchaol

Differential Revision: D13507524

Pulled By: zdevito

fbshipit-source-id: 69ec936a9ff1a383c12a883616346b219c72e393
18 files changed:
tools/build_pytorch_libs.sh
tools/build_variables.py
torch/CMakeLists.txt
torch/csrc/jit/graph_executor.cpp
torch/csrc/jit/ir.cpp
torch/csrc/jit/ir.h
torch/csrc/jit/passes/to_batch.cpp
torch/csrc/jit/script/compiler.cpp
torch/csrc/jit/script/compiler.h
torch/csrc/jit/script/init.cpp
torch/csrc/jit/script/module.cpp
torch/csrc/jit/script/module.h
torch/csrc/jit/script/schema_matching.cpp [new file with mode: 0644]
torch/csrc/jit/script/schema_matching.h [new file with mode: 0644]
torch/csrc/jit/script/sugared_value.cpp [new file with mode: 0644]
torch/csrc/jit/script/sugared_value.h [new file with mode: 0644]
torch/csrc/jit/script/type_parser.cpp [new file with mode: 0644]
torch/csrc/jit/script/type_parser.h [new file with mode: 0644]