Line data Source code
1 : // Copyright 2017 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #include "src/torque/torque-compiler.h"
6 :
7 : namespace v8 {
8 : namespace internal {
9 : namespace torque {
10 :
11 1 : int WrappedMain(int argc, const char** argv) {
12 : std::string output_directory;
13 : bool verbose = false;
14 1 : std::vector<std::string> files;
15 :
16 97 : for (int i = 1; i < argc; ++i) {
17 : // Check for options
18 48 : if (!strcmp("-o", argv[i])) {
19 1 : output_directory = argv[++i];
20 : continue;
21 : }
22 47 : if (!strcmp("-v", argv[i])) {
23 : verbose = true;
24 : continue;
25 : }
26 :
27 : // Otherwise it's a .tq file. Remember it for compilation.
28 47 : files.emplace_back(argv[i]);
29 : }
30 :
31 1 : SourceFileMap::Scope source_file_map_scope;
32 :
33 : TorqueCompilerOptions options;
34 : options.output_directory = output_directory;
35 1 : options.verbose = verbose;
36 1 : options.collect_language_server_data = false;
37 1 : options.abort_on_lint_errors = true;
38 :
39 2 : CompileTorque(files, options);
40 :
41 1 : return 0;
42 : }
43 :
44 : } // namespace torque
45 : } // namespace internal
46 : } // namespace v8
47 :
48 1 : int main(int argc, const char** argv) {
49 1 : return v8::internal::torque::WrappedMain(argc, argv);
50 2 : }
|