blob: 50556f66f645bace991f42c8c6c08a62ad4141bf [file] [log] [blame]
Jan Voung44c3a802015-03-27 16:29:08 -07001//===- subzero/src/main.cpp - Entry point for bitcode translation ---------===//
Jim Stichnothf7c9a142014-04-29 10:52:43 -07002//
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 Voung44c3a802015-03-27 16:29:08 -070010// This file defines the entry point for translating PNaCl bitcode into
11// native code.
Jim Stichnothf7c9a142014-04-29 10:52:43 -070012//
13//===----------------------------------------------------------------------===//
14
Jan Voung44c3a802015-03-27 16:29:08 -070015#include "IceBrowserCompileServer.h"
16#include "IceCompiler.h"
17#include "IceCompileServer.h"
Karl Schimpfb262c5e2014-10-27 14:41:57 -070018
Jim Stichnothf7c9a142014-04-29 10:52:43 -070019int main(int argc, char **argv) {
Jan Voung44c3a802015-03-27 16:29:08 -070020 // 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 Stichnothf7c9a142014-04-29 10:52:43 -070036}