Lines Matching refs:DirLang
46 const DirectiveLanguage &DirLang) { in GenerateEnumClass() argument
63 if (DirLang.hasMakeEnumAvailableInNamespace()) { in GenerateEnumClass()
68 << "llvm::" << DirLang.getCppNamespace() << "::" << Enum in GenerateEnumClass()
77 raw_ostream &OS, const DirectiveLanguage &DirLang, in GenerateEnumClauseVal() argument
100 if (DirLang.hasMakeEnumAvailableInNamespace()) { in GenerateEnumClauseVal()
104 << "llvm::" << DirLang.getCppNamespace() << "::" << EnumName in GenerateEnumClauseVal()
173 const auto DirLang = DirectiveLanguage{Records}; in EmitDirectivesDecl()
174 if (DirLang.HasValidityErrors()) in EmitDirectivesDecl()
177 OS << "#ifndef LLVM_" << DirLang.getName() << "_INC\n"; in EmitDirectivesDecl()
178 OS << "#define LLVM_" << DirLang.getName() << "_INC\n"; in EmitDirectivesDecl()
180 if (DirLang.hasEnableBitmaskEnumInNamespace()) in EmitDirectivesDecl()
189 llvm::SplitString(DirLang.getCppNamespace(), Namespaces, "::"); in EmitDirectivesDecl()
193 if (DirLang.hasEnableBitmaskEnumInNamespace()) in EmitDirectivesDecl()
197 GenerateEnumClass(DirLang.getDirectives(), OS, "Directive", in EmitDirectivesDecl()
198 DirLang.getDirectivePrefix(), DirLang); in EmitDirectivesDecl()
201 GenerateEnumClass(DirLang.getClauses(), OS, "Clause", in EmitDirectivesDecl()
202 DirLang.getClausePrefix(), DirLang); in EmitDirectivesDecl()
206 GenerateEnumClauseVal(DirLang.getClauses(), OS, DirLang, EnumHelperFuncs); in EmitDirectivesDecl()
211 OS << "Directive get" << DirLang.getName() in EmitDirectivesDecl()
214 OS << "llvm::StringRef get" << DirLang.getName() in EmitDirectivesDecl()
217 OS << "Clause get" << DirLang.getName() in EmitDirectivesDecl()
220 OS << "llvm::StringRef get" << DirLang.getName() << "ClauseName(Clause C);\n"; in EmitDirectivesDecl()
238 OS << "#endif // LLVM_" << DirLang.getName() << "_INC\n"; in EmitDirectivesDecl()
243 StringRef Enum, const DirectiveLanguage &DirLang, in GenerateGetName() argument
246 OS << "llvm::StringRef llvm::" << DirLang.getCppNamespace() << "::get" in GenerateGetName()
247 << DirLang.getName() << Enum << "Name(" << Enum << " Kind) {\n"; in GenerateGetName()
260 OS << " llvm_unreachable(\"Invalid " << DirLang.getName() << " " << Enum in GenerateGetName()
267 StringRef Enum, const DirectiveLanguage &DirLang, in GenerateGetKind() argument
282 OS << Enum << " llvm::" << DirLang.getCppNamespace() << "::get" in GenerateGetKind()
283 << DirLang.getName() << Enum << "Kind(llvm::StringRef Str) {\n"; in GenerateGetKind()
301 void GenerateGetKindClauseVal(const DirectiveLanguage &DirLang, in GenerateGetKindClauseVal() argument
303 for (const auto &R : DirLang.getClauses()) { in GenerateGetKindClauseVal()
329 OS << EnumName << " llvm::" << DirLang.getCppNamespace() << "::get" in GenerateGetKindClauseVal()
344 const DirectiveLanguage &DirLang, in GenerateCaseForVersionedClauses() argument
353 OS << " case " << DirLang.getClausePrefix() << ClauseFormattedName in GenerateCaseForVersionedClauses()
362 void GenerateIsAllowedClause(const DirectiveLanguage &DirLang, in GenerateIsAllowedClause() argument
365 OS << "bool llvm::" << DirLang.getCppNamespace() in GenerateIsAllowedClause()
368 OS << " assert(unsigned(D) <= llvm::" << DirLang.getCppNamespace() in GenerateIsAllowedClause()
370 OS << " assert(unsigned(C) <= llvm::" << DirLang.getCppNamespace() in GenerateIsAllowedClause()
375 for (const auto &D : DirLang.getDirectives()) { in GenerateIsAllowedClause()
378 OS << " case " << DirLang.getDirectivePrefix() << Dir.getFormattedName() in GenerateIsAllowedClause()
391 Dir.getName(), DirLang, Cases); in GenerateIsAllowedClause()
394 Dir.getName(), DirLang, Cases); in GenerateIsAllowedClause()
397 Dir.getName(), DirLang, Cases); in GenerateIsAllowedClause()
400 Dir.getName(), DirLang, Cases); in GenerateIsAllowedClause()
410 OS << " llvm_unreachable(\"Invalid " << DirLang.getName() in GenerateIsAllowedClause()
418 const DirectiveLanguage &DirLang) { in GenerateClauseSet() argument
421 OS << " static " << DirLang.getClauseEnumSetClass() << " " << ClauseSetPrefix in GenerateClauseSet()
422 << DirLang.getDirectivePrefix() << Dir.getFormattedName() << " {\n"; in GenerateClauseSet()
426 OS << " llvm::" << DirLang.getCppNamespace() in GenerateClauseSet()
427 << "::Clause::" << DirLang.getClausePrefix() in GenerateClauseSet()
434 void GenerateDirectiveClauseSets(const DirectiveLanguage &DirLang, in GenerateDirectiveClauseSets() argument
444 llvm::SplitString(DirLang.getCppNamespace(), Namespaces, "::"); in GenerateDirectiveClauseSets()
448 for (const auto &D : DirLang.getDirectives()) { in GenerateDirectiveClauseSets()
455 DirLang); in GenerateDirectiveClauseSets()
457 Dir, DirLang); in GenerateDirectiveClauseSets()
459 "allowedExclusiveClauses_", Dir, DirLang); in GenerateDirectiveClauseSets()
461 DirLang); in GenerateDirectiveClauseSets()
474 void GenerateDirectiveClauseMap(const DirectiveLanguage &DirLang, in GenerateDirectiveClauseMap() argument
482 for (const auto &D : DirLang.getDirectives()) { in GenerateDirectiveClauseMap()
484 OS << " {llvm::" << DirLang.getCppNamespace() in GenerateDirectiveClauseMap()
485 << "::Directive::" << DirLang.getDirectivePrefix() in GenerateDirectiveClauseMap()
488 OS << " llvm::" << DirLang.getCppNamespace() << "::allowedClauses_" in GenerateDirectiveClauseMap()
489 << DirLang.getDirectivePrefix() << Dir.getFormattedName() << ",\n"; in GenerateDirectiveClauseMap()
490 OS << " llvm::" << DirLang.getCppNamespace() << "::allowedOnceClauses_" in GenerateDirectiveClauseMap()
491 << DirLang.getDirectivePrefix() << Dir.getFormattedName() << ",\n"; in GenerateDirectiveClauseMap()
492 OS << " llvm::" << DirLang.getCppNamespace() in GenerateDirectiveClauseMap()
493 << "::allowedExclusiveClauses_" << DirLang.getDirectivePrefix() in GenerateDirectiveClauseMap()
495 OS << " llvm::" << DirLang.getCppNamespace() << "::requiredClauses_" in GenerateDirectiveClauseMap()
496 << DirLang.getDirectivePrefix() << Dir.getFormattedName() << ",\n"; in GenerateDirectiveClauseMap()
509 void GenerateFlangClauseParserClass(const DirectiveLanguage &DirLang, in GenerateFlangClauseParserClass() argument
516 for (const auto &C : DirLang.getClauses()) { in GenerateFlangClauseParserClass()
541 void GenerateFlangClauseParserClassList(const DirectiveLanguage &DirLang, in GenerateFlangClauseParserClassList() argument
547 llvm::interleaveComma(DirLang.getClauses(), OS, [&](Record *C) { in GenerateFlangClauseParserClassList()
557 void GenerateFlangClauseDump(const DirectiveLanguage &DirLang, in GenerateFlangClauseDump() argument
563 for (const auto &C : DirLang.getClauses()) { in GenerateFlangClauseDump()
569 OS << "NODE(" << DirLang.getFlangClauseBaseClass() << ", " in GenerateFlangClauseDump()
576 void GenerateFlangClauseUnparse(const DirectiveLanguage &DirLang, in GenerateFlangClauseUnparse() argument
583 for (const auto &C : DirLang.getClauses()) { in GenerateFlangClauseUnparse()
590 OS << "void Unparse(const " << DirLang.getFlangClauseBaseClass() in GenerateFlangClauseUnparse()
597 OS << "void Unparse(const " << DirLang.getFlangClauseBaseClass() in GenerateFlangClauseUnparse()
611 OS << "void Unparse(const " << DirLang.getFlangClauseBaseClass() in GenerateFlangClauseUnparse()
623 OS << "void Before(const " << DirLang.getFlangClauseBaseClass() in GenerateFlangClauseUnparse()
632 void EmitDirectivesFlangImpl(const DirectiveLanguage &DirLang, in EmitDirectivesFlangImpl() argument
635 GenerateDirectiveClauseSets(DirLang, OS); in EmitDirectivesFlangImpl()
637 GenerateDirectiveClauseMap(DirLang, OS); in EmitDirectivesFlangImpl()
639 GenerateFlangClauseParserClass(DirLang, OS); in EmitDirectivesFlangImpl()
641 GenerateFlangClauseParserClassList(DirLang, OS); in EmitDirectivesFlangImpl()
643 GenerateFlangClauseDump(DirLang, OS); in EmitDirectivesFlangImpl()
645 GenerateFlangClauseUnparse(DirLang, OS); in EmitDirectivesFlangImpl()
651 const auto DirLang = DirectiveLanguage{Records}; in EmitDirectivesGen()
652 if (DirLang.HasValidityErrors()) in EmitDirectivesGen()
655 EmitDirectivesFlangImpl(DirLang, OS); in EmitDirectivesGen()
661 const auto DirLang = DirectiveLanguage{Records}; in EmitDirectivesImpl()
662 if (DirLang.HasValidityErrors()) in EmitDirectivesImpl()
665 if (!DirLang.getIncludeHeader().empty()) in EmitDirectivesImpl()
666 OS << "#include \"" << DirLang.getIncludeHeader() << "\"\n\n"; in EmitDirectivesImpl()
674 llvm::SplitString(DirLang.getCppNamespace(), Namespaces, "::"); in EmitDirectivesImpl()
679 GenerateGetKind(DirLang.getDirectives(), OS, "Directive", DirLang, in EmitDirectivesImpl()
680 DirLang.getDirectivePrefix(), /*ImplicitAsUnknown=*/false); in EmitDirectivesImpl()
683 GenerateGetName(DirLang.getDirectives(), OS, "Directive", DirLang, in EmitDirectivesImpl()
684 DirLang.getDirectivePrefix()); in EmitDirectivesImpl()
687 GenerateGetKind(DirLang.getClauses(), OS, "Clause", DirLang, in EmitDirectivesImpl()
688 DirLang.getClausePrefix(), in EmitDirectivesImpl()
692 GenerateGetName(DirLang.getClauses(), OS, "Clause", DirLang, in EmitDirectivesImpl()
693 DirLang.getClausePrefix()); in EmitDirectivesImpl()
696 GenerateGetKindClauseVal(DirLang, OS); in EmitDirectivesImpl()
699 GenerateIsAllowedClause(DirLang, OS); in EmitDirectivesImpl()