v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
torque-compiler.h
Go to the documentation of this file.
1// Copyright 2019 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#ifndef V8_TORQUE_TORQUE_COMPILER_H_
6#define V8_TORQUE_TORQUE_COMPILER_H_
7
8#include <optional>
9
10#include "src/base/contextual.h"
11#include "src/torque/ast.h"
15#include "src/torque/utils.h"
16
17namespace v8::internal::torque {
18
20 std::string output_directory = "";
21 std::string v8_root = "";
23 bool collect_kythe_data = false;
24
25 // dcheck(...) are only generated for debug builds. To provide
26 // language server support for statements inside dchecks, this flag
27 // can force generate them.
29
30 // Forge (Google3) can only run 64-bit executables. As Torque runs as part
31 // of the build process, we need a "cross-compile" mode when we target 32-bit
32 // architectures. Note that this does not needed in Chromium/V8 land, since we
33 // always build with the same bit width as the target architecture.
34 bool force_32bit_output = false;
35
36 // Adds extra comments in output that show Torque intermediate representation.
37 bool annotate_ir = false;
38
39 // Strips the v8-root in case the source path contains it as a prefix.
40 bool strip_v8_root = false;
41};
42
44 // Map translating SourceIds to filenames. This field is
45 // set on errors, so the SourcePosition of the error can be
46 // resolved.
47 std::optional<SourceFileMap> source_file_map;
48
49 // Eagerly collected data needed for the LanguageServer.
50 // Set the corresponding options flag to enable.
52
53 // Errors collected during compilation.
54 std::vector<TorqueMessage> messages;
55};
56
58 std::string source_file_path;
59 std::string file_content;
60};
61
63CompileTorque(const std::string& source, TorqueCompilerOptions options);
64TorqueCompilerResult CompileTorque(const std::vector<std::string>& files,
65 TorqueCompilerOptions options);
67 std::vector<TorqueCompilationUnit> units, TorqueCompilerOptions options,
68 KytheConsumer* kythe_consumer);
69
70} // namespace v8::internal::torque
71
72#endif // V8_TORQUE_TORQUE_COMPILER_H_
std::priority_queue< BigUnit > units[CompilationTier::kNumTiers]
TorqueCompilerResult CompileTorque(const std::string &source, TorqueCompilerOptions options)
TorqueCompilerResult CompileTorqueForKythe(std::vector< TorqueCompilationUnit > units, TorqueCompilerOptions options, KytheConsumer *consumer)
#define V8_EXPORT_PRIVATE
Definition macros.h:460
std::optional< SourceFileMap > source_file_map
std::vector< TorqueMessage > messages