Lines Matching +full:options +full:-
7 * http://www.apache.org/licenses/LICENSE-2.0
40 if (parser_->Extension() == ScriptExtension::TS) { in Compiler()
41 transformer_ = std::make_unique<parser::Transformer>(parser_->Allocator()); in Compiler()
56 context.GetEmitter()->GenRecordNameInfo(); in CreateJsonContentProgram()
57 return context.GetEmitter()->Finalize(false, nullptr); in CreateJsonContentProgram()
60 … Compiler::CheckOptionsAndFileForAbcInput(const std::string &fname, const CompilerOptions &options) in CheckOptionsAndFileForAbcInput() argument
62 if (!options.enableAbcInput) { in CheckOptionsAndFileForAbcInput()
63 throw Error(ErrorType::GENERIC, "\"--enable-abc-input\" is not enabled, abc file " + fname + in CheckOptionsAndFileForAbcInput()
66 if (options.targetApiVersion < util::Helpers::ABC_TO_PROGRAM_MIN_SUPPORTED_API_VERSION) { in CheckOptionsAndFileForAbcInput()
67 …throw Error(ErrorType::GENERIC, "Target api version '" + std::to_string(options.targetApiVersion) + in CheckOptionsAndFileForAbcInput()
71 if (!options.mergeAbc && options.sourceFiles.size() != 1) { in CheckOptionsAndFileForAbcInput()
73 "when the option '--merge-abc' is not enabled."); in CheckOptionsAndFileForAbcInput()
75 if (!abcToAsmCompiler_->OpenAbcFile(fname)) { in CheckOptionsAndFileForAbcInput()
78 …if (!abcToAsmCompiler_->CheckFileVersionIsSupported(util::Helpers::ABC_TO_PROGRAM_MIN_SUPPORTED_BY… in CheckOptionsAndFileForAbcInput()
79 … options.targetApiVersion, options.targetApiSubVersion)) { in CheckOptionsAndFileForAbcInput()
85 …andasm::Program *Compiler::CompileAbcFile(const std::string &fname, const CompilerOptions &options) in CompileAbcFile() argument
88 CheckOptionsAndFileForAbcInput(fname, options); in CompileAbcFile()
89 return abcToAsmCompiler_->CompileAbcFile(); in CompileAbcFile()
97 void Compiler::CompileAbcFileInParallel(SourceFile *src, const CompilerOptions &options, in CompileAbcFileInParallel() argument
102 CheckOptionsAndFileForAbcInput(src->fileName, options); in CompileAbcFileInParallel()
105 std::cerr << " [" << src->fileName << "]" << std::endl; in CompileAbcFileInParallel()
108 if (options.compileContextInfo.needModifyRecord) { in CompileAbcFileInParallel()
109 abcToAsmCompiler_->SetBundleName(options.compileContextInfo.bundleName); in CompileAbcFileInParallel()
111 if (!options.modifiedPkgName.empty()) { in CompileAbcFileInParallel()
112 abcToAsmCompiler_->SetModifyPkgName(options.modifiedPkgName); in CompileAbcFileInParallel()
115 auto *compileAbcClassQueue = new compiler::CompileAbcClassQueue(options.abcClassThreadCount, in CompileAbcFileInParallel()
116 options, in CompileAbcFileInParallel()
122 compileAbcClassQueue->Schedule(); in CompileAbcFileInParallel()
123 compileAbcClassQueue->Consume(); in CompileAbcFileInParallel()
124 compileAbcClassQueue->Wait(); in CompileAbcFileInParallel()
133 panda::pandasm::Program *Compiler::Compile(const SourceFile &input, const CompilerOptions &options, in Compile() argument
144 auto *patchFixHelper = InitPatchFixHelper(input, options, symbolTable); in Compile()
152 auto ast = parser_->Parse(input, options); in Compile()
153 ast.Binder()->SetProgram(&ast); in Compile()
155 if (options.dumpAst) { in Compile()
159 ProcessAstForTS(&ast, options); in Compile()
161 if (options.parseOnly) { in Compile()
167 std::string debugInfoSourceFile = options.debugInfoSourceFile.empty() ? in Compile()
168 sourcefile : options.debugInfoSourceFile; in Compile()
169 auto *prog = compiler_->Compile(&ast, options, debugInfoSourceFile, pkgName); in Compile()
182 …il::PatchFix *Compiler::InitPatchFixHelper(const SourceFile &input, const CompilerOptions &options, in InitPatchFixHelper() argument
186 bool needDumpSymbolFile = !options.patchFixOptions.dumpSymbolTable.empty(); in InitPatchFixHelper()
187 …bool needGeneratePatch = options.patchFixOptions.generatePatch && !options.patchFixOptions.symbolT… in InitPatchFixHelper()
188 bool isHotReload = options.patchFixOptions.hotReload; in InitPatchFixHelper()
189 bool isColdReload = options.patchFixOptions.coldReload; in InitPatchFixHelper()
190 bool isColdFix = options.patchFixOptions.coldFix; in InitPatchFixHelper()
204 parser_->AddPatchFixHelper(patchFixHelper); in InitPatchFixHelper()
205 compiler_->AddPatchFixHelper(patchFixHelper); in InitPatchFixHelper()
223 int Compiler::CompileFiles(CompilerOptions &options, in CompileFiles() argument
227 …if (!options.patchFixOptions.symbolTable.empty() || !options.patchFixOptions.dumpSymbolTable.empty… in CompileFiles()
228 symbolTable = std::make_unique<util::SymbolTable>(options.patchFixOptions.symbolTable, in CompileFiles()
229 options.patchFixOptions.dumpSymbolTable); in CompileFiles()
230 if (!symbolTable->Initialize(options.targetApiVersion, options.targetApiSubVersion)) { in CompileFiles()
238 auto queue = new compiler::CompileFileQueue(options.fileThreadCount, &options, progsInfo, in CompileFiles()
242 queue->Schedule(); in CompileFiles()
243 queue->Consume(); in CompileFiles()
244 queue->Wait(); in CompileFiles()
256 if (!options.patchFixOptions.dumpSymbolTable.empty()) { in CompileFiles()
257 symbolTable->WriteSymbolTable(); in CompileFiles()
261 if (options.requireGlobalOptimization) { in CompileFiles()
262 …auto postAnalysisOptimizeQueue = new compiler::PostAnalysisOptimizeFileQueue(options.fileThreadCou… in CompileFiles()
266 postAnalysisOptimizeQueue->Schedule(); in CompileFiles()
267 postAnalysisOptimizeQueue->Consume(); in CompileFiles()
268 postAnalysisOptimizeQueue->Wait(); in CompileFiles()
278 panda::pandasm::Program *Compiler::CompileFile(const CompilerOptions &options, SourceFile *src, in CompileFile() argument
281 auto *program = Compile(*src, options, symbolTable); in CompileFile()
284 if (err.Message().empty() && options.parseOnly) { in CompileFile()
289 …ss << err.TypeString() << ": " << err.Message() << " [" << util::Helpers::BaseName(src->fileName) … in CompileFile()
299 void Compiler::ProcessAstForTS(parser::Program *ast, const es2panda::CompilerOptions &options) in ProcessAstForTS() argument
301 if (ast->Extension() != ScriptExtension::TS) { in ProcessAstForTS()
304 if (options.enableTypeCheck) { in ProcessAstForTS()
306 auto checker = std::make_unique<checker::Checker>(&localAllocator, ast->Binder()); in ProcessAstForTS()
307 checker->StartChecker(); in ProcessAstForTS()
310 transformer_->Transform(ast); in ProcessAstForTS()
311 ast->Binder()->IdentifierAnalysis(binder::ResolveBindingFlags::TS_AFTER_TRANSFORM); in ProcessAstForTS()
312 if (options.dumpTransformedAst) { in ProcessAstForTS()
313 std::cout << ast->Dump() << std::endl; in ProcessAstForTS()
315 if (options.checkTransformedAstStructure) { in ProcessAstForTS()
316 transformer_->CheckTransformedAstStructure(ast); in ProcessAstForTS()