Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 1 | //===- subzero/src/main.cpp - Entry point for bitcode translation ---------===// |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 2 | // |
| 3 | // The Subzero Code Generator |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 10 | // This file defines the entry point for translating PNaCl bitcode into |
| 11 | // native code. |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 15 | #include "IceBrowserCompileServer.h" |
| 16 | #include "IceCompiler.h" |
| 17 | #include "IceCompileServer.h" |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 18 | |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 19 | int main(int argc, char **argv) { |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 20 | // Start file server and "wait" for compile request. |
| 21 | Ice::Compiler Comp; |
| 22 | // Can only compile the BrowserCompileServer w/ the NaCl compiler. |
| 23 | #if PNACL_BROWSER_TRANSLATOR |
| 24 | // There are no real commandline arguments in the browser case. |
| 25 | // They are supplied via IPC. |
| 26 | assert(argc == 1); |
| 27 | (void)argv; |
| 28 | Ice::BrowserCompileServer Server(Comp); |
| 29 | Server.run(); |
| 30 | return Server.getErrorCode().value(); |
| 31 | #else // !PNACL_BROWSER_TRANSLATOR |
| 32 | Ice::CLCompileServer Server(Comp, argc, argv); |
| 33 | Server.run(); |
| 34 | return Server.getErrorCode().value(); |
| 35 | #endif // !PNACL_BROWSER_TRANSLATOR |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 36 | } |