• Home
  • Raw
  • Download

Lines Matching +full:panda +full:- +full:options

7  * http://www.apache.org/licenses/LICENSE-2.0
31 namespace panda::es2panda { namespace
41 abcToAsmCompiler_(new panda::abc2program::Abc2ProgramCompiler) in Compiler()
43 if (parser_->Extension() == ScriptExtension::TS) { in Compiler()
44 transformer_ = std::make_unique<parser::Transformer>(parser_->Allocator()); in Compiler()
55 panda::pandasm::Program *CreateJsonContentProgram(std::string src, std::string rname, util::PatchFi… in CreateJsonContentProgram()
57 panda::es2panda::compiler::CompilerContext context(nullptr, false, false, false, true, false, in CreateJsonContentProgram()
59 context.GetEmitter()->GenRecordNameInfo(); in CreateJsonContentProgram()
60 return context.GetEmitter()->Finalize(false, nullptr); in CreateJsonContentProgram()
63 … Compiler::CheckOptionsAndFileForAbcInput(const std::string &fname, const CompilerOptions &options) in CheckOptionsAndFileForAbcInput() argument
65 if (!options.enableAbcInput) { in CheckOptionsAndFileForAbcInput()
66 throw Error(ErrorType::GENERIC, "\"--enable-abc-input\" is not enabled, abc file " + fname + in CheckOptionsAndFileForAbcInput()
69 if (options.targetApiVersion < util::Helpers::ABC_TO_PROGRAM_MIN_SUPPORTED_API_VERSION) { in CheckOptionsAndFileForAbcInput()
70 …throw Error(ErrorType::GENERIC, "Target api version '" + std::to_string(options.targetApiVersion) + in CheckOptionsAndFileForAbcInput()
74 if (!options.mergeAbc && options.sourceFiles.size() != 1) { in CheckOptionsAndFileForAbcInput()
76 "when the option '--merge-abc' is not enabled."); in CheckOptionsAndFileForAbcInput()
78 if (!abcToAsmCompiler_->OpenAbcFile(fname)) { in CheckOptionsAndFileForAbcInput()
81 …if (!abcToAsmCompiler_->CheckFileVersionIsSupported(util::Helpers::ABC_TO_PROGRAM_MIN_SUPPORTED_BY… in CheckOptionsAndFileForAbcInput()
82options.targetApiVersion, options.targetApiSubVersion)) { in CheckOptionsAndFileForAbcInput()
88 panda::pandasm::Program *Compiler::CompileAbcFile(const std::string &fname, const CompilerOptions & in CompileAbcFile() argument
91 CheckOptionsAndFileForAbcInput(fname, options); in CompileAbcFile()
92 return abcToAsmCompiler_->CompileAbcFile(); in CompileAbcFile()
100 void Compiler::CompileAbcFileInParallel(SourceFile *src, const CompilerOptions &options, in CompileAbcFileInParallel() argument
101 … std::map<std::string, panda::es2panda::util::ProgramCache*> &progsInfo, in CompileAbcFileInParallel()
102 panda::ArenaAllocator *allocator) in CompileAbcFileInParallel()
105 CheckOptionsAndFileForAbcInput(src->fileName, options); in CompileAbcFileInParallel()
108 std::cerr << " [" << src->fileName << "]" << std::endl; in CompileAbcFileInParallel()
112 auto *compileAbcClassQueue = new compiler::CompileAbcClassQueue(options.abcClassThreadCount, in CompileAbcFileInParallel()
113 options, in CompileAbcFileInParallel()
119 compileAbcClassQueue->Schedule(); in CompileAbcFileInParallel()
120 compileAbcClassQueue->Consume(); in CompileAbcFileInParallel()
121 compileAbcClassQueue->Wait(); in CompileAbcFileInParallel()
130 panda::pandasm::Program *Compiler::Compile(const SourceFile &input, const CompilerOptions &options, in Compile() argument
141 auto *patchFixHelper = InitPatchFixHelper(input, options, symbolTable); in Compile()
148 auto ast = parser_->Parse(input, options); in Compile()
149 ast.Binder()->SetProgram(&ast); in Compile()
151 if (options.dumpAst) { in Compile()
155 if (ast.Extension() == ScriptExtension::TS && options.enableTypeCheck) { in Compile()
158 checker->StartChecker(); in Compile()
162 transformer_->Transform(&ast); in Compile()
163 ast.Binder()->IdentifierAnalysis(binder::ResolveBindingFlags::TS_AFTER_TRANSFORM); in Compile()
164 if (options.dumpTransformedAst) { in Compile()
167 if (options.checkTransformedAstStructure) { in Compile()
168 transformer_->CheckTransformedAstStructure(&ast); in Compile()
172 if (options.parseOnly) { in Compile()
176 std::string debugInfoSourceFile = options.debugInfoSourceFile.empty() ? in Compile()
177 sourcefile : options.debugInfoSourceFile; in Compile()
178 auto *prog = compiler_->Compile(&ast, options, debugInfoSourceFile, pkgName); in Compile()
190 …il::PatchFix *Compiler::InitPatchFixHelper(const SourceFile &input, const CompilerOptions &options, in InitPatchFixHelper() argument
194 bool needDumpSymbolFile = !options.patchFixOptions.dumpSymbolTable.empty(); in InitPatchFixHelper()
195 …bool needGeneratePatch = options.patchFixOptions.generatePatch && !options.patchFixOptions.symbolT… in InitPatchFixHelper()
196 bool isHotReload = options.patchFixOptions.hotReload; in InitPatchFixHelper()
197 bool isColdReload = options.patchFixOptions.coldReload; in InitPatchFixHelper()
198 bool isColdFix = options.patchFixOptions.coldFix; in InitPatchFixHelper()
212 parser_->AddPatchFixHelper(patchFixHelper); in InitPatchFixHelper()
213 compiler_->AddPatchFixHelper(patchFixHelper); in InitPatchFixHelper()
226 void Compiler::DumpAsm(const panda::pandasm::Program *prog) in DumpAsm()
231 int Compiler::CompileFiles(CompilerOptions &options, in CompileFiles() argument
232 …std::map<std::string, panda::es2panda::util::ProgramCache*> &progsInfo, panda::ArenaAllocator *all… in CompileFiles()
235 …if (!options.patchFixOptions.symbolTable.empty() || !options.patchFixOptions.dumpSymbolTable.empty… in CompileFiles()
236 symbolTable = new util::SymbolTable(options.patchFixOptions.symbolTable, in CompileFiles()
237 options.patchFixOptions.dumpSymbolTable); in CompileFiles()
238 if (!symbolTable->Initialize(options.targetApiVersion, options.targetApiSubVersion)) { in CompileFiles()
246 auto queue = new compiler::CompileFileQueue(options.fileThreadCount, &options, progsInfo, in CompileFiles()
250 queue->Schedule(); in CompileFiles()
251 queue->Consume(); in CompileFiles()
252 queue->Wait(); in CompileFiles()
264 if (!options.patchFixOptions.dumpSymbolTable.empty()) { in CompileFiles()
265 symbolTable->WriteSymbolTable(); in CompileFiles()
271 if (options.requireGlobalOptimization) { in CompileFiles()
272 …auto postAnalysisOptimizeQueue = new compiler::PostAnalysisOptimizeFileQueue(options.fileThreadCou… in CompileFiles()
276 postAnalysisOptimizeQueue->Schedule(); in CompileFiles()
277 postAnalysisOptimizeQueue->Consume(); in CompileFiles()
278 postAnalysisOptimizeQueue->Wait(); in CompileFiles()
288 panda::pandasm::Program *Compiler::CompileFile(const CompilerOptions &options, SourceFile *src, in CompileFile() argument
291 auto *program = Compile(*src, options, symbolTable); in CompileFile()
294 if (err.Message().empty() && options.parseOnly) { in CompileFile()
299 std::cerr << " [" << util::Helpers::BaseName(src->fileName) << ":" in CompileFile()
308 } // namespace panda::es2panda