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 | //===----------------------------------------------------------------------===// |
Andrew Scull | 9612d32 | 2015-07-06 14:53:25 -0700 | [diff] [blame] | 9 | /// |
| 10 | /// \file |
| 11 | /// This file defines the entry point for translating PNaCl bitcode into |
| 12 | /// native code. |
| 13 | /// |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 14 | //===----------------------------------------------------------------------===// |
| 15 | |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 16 | #include "IceBrowserCompileServer.h" |
| 17 | #include "IceCompiler.h" |
| 18 | #include "IceCompileServer.h" |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 19 | |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 20 | int main(int argc, char **argv) { |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 21 | // Start file server and "wait" for compile request. |
| 22 | Ice::Compiler Comp; |
| 23 | // Can only compile the BrowserCompileServer w/ the NaCl compiler. |
| 24 | #if PNACL_BROWSER_TRANSLATOR |
| 25 | // There are no real commandline arguments in the browser case. |
| 26 | // They are supplied via IPC. |
| 27 | assert(argc == 1); |
Jan Voung | 871b97f | 2015-06-30 13:31:02 -0700 | [diff] [blame] | 28 | (void)argc; |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 29 | (void)argv; |
| 30 | Ice::BrowserCompileServer Server(Comp); |
| 31 | Server.run(); |
| 32 | return Server.getErrorCode().value(); |
| 33 | #else // !PNACL_BROWSER_TRANSLATOR |
| 34 | Ice::CLCompileServer Server(Comp, argc, argv); |
| 35 | Server.run(); |
| 36 | return Server.getErrorCode().value(); |
| 37 | #endif // !PNACL_BROWSER_TRANSLATOR |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 38 | } |