14#ifndef LLVM_TABLEGEN_DIRECTIVEEMITTER_H
15#define LLVM_TABLEGEN_DIRECTIVEEMITTER_H
34 const auto &DirectiveLanguages = getDirectiveLanguages();
35 Def = DirectiveLanguages[0];
41 return Def->getValueAsString(
"cppNamespace");
45 return Def->getValueAsString(
"directivePrefix");
49 return Def->getValueAsString(
"clausePrefix");
53 return Def->getValueAsString(
"loopModifierPrefix");
57 return Def->getValueAsString(
"clauseEnumSetClass");
61 return Def->getValueAsString(
"flangClauseBaseClass");
65 return Def->getValueAsBit(
"makeEnumAvailableInNamespace");
69 return Def->getValueAsBit(
"enableBitmaskEnumInNamespace");
73 return Records.getAllDerivedDefinitions(
"Association");
77 return Records.getAllDerivedDefinitions(
"Category");
81 return Records.getAllDerivedDefinitions(
"SourceLanguage");
85 return Records.getAllDerivedDefinitions(
"Directive");
89 return Records.getAllDerivedDefinitions(
"Clause");
93 return Records.getAllDerivedDefinitions(
"LoopModifier");
103 return Records.getAllDerivedDefinitions(
"DirectiveLanguage");
110 int64_t Min = R->getValueAsInt(
"minVersion");
112 "Value out of range of non-negative 'int'");
117 int64_t Max = R->getValueAsInt(
"maxVersion");
119 "Value out of range of non-negative 'int'");
124 constexpr static int IntWidth = 8 *
sizeof(int);
162 std::vector<Spelling::Value>
List;
164 std::back_inserter(
List),
165 [](
const Record *R) { return Spelling(R).get(); });
191 std::string
N = Name.str();
201 std::string Camel = Name.str();
205 if (Sep.contains(C)) {
206 assert(!Cap &&
"No initial or repeated separators");
216 for (
size_t In = 0,
End = Camel.size(); In !=
End; ++In) {
217 unsigned char C = Camel[In];
218 if (!Sep.contains(
C))
226 if (
auto maybeName =
Def->getValueAsOptionalString(
"name"))
249 return Def->getValueAsListOfDefs(
"allowedClauses");
253 return Def->getValueAsListOfDefs(
"allowedOnceClauses");
257 return Def->getValueAsListOfDefs(
"allowedExclusiveClauses");
261 return Def->getValueAsListOfDefs(
"requiredClauses");
265 return Def->getValueAsListOfDefs(
"leafConstructs");
269 return Def->getValueAsDef(
"association");
275 return Def->getValueAsListOfDefs(
"languages");
279 return Def->getValueAsListOfDefs(
"allowedLoopModifiers");
289 if (Name ==
"unknown")
304 return Def->getValueAsString(
"clangClass");
309 return Def->getValueAsString(
"flangClass");
326 if (
StringRef ClangSpelling =
Def->getValueAsString(
"clangAccSpelling");
327 !ClangSpelling.empty())
328 return ClangSpelling.str();
336 return Def->getValueAsString(
"enumClauseValue");
340 return Def->getValueAsListOfDefs(
"allowedClauseValues");
344 return Def->getValueAsBit(
"skipFlangUnparser");
352 return Def->getValueAsString(
"defaultValue");
358 return Def->getValueAsListOfStrings(
"aliases");
364 return Def->getValueAsBit(
"isPrefixOptional");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef getSpellingForIdentifier() const
static std::string getSnakeName(StringRef Name)
StringRef getRecordName() const
static std::string getUpperCamelName(StringRef Name, StringRef Sep)
std::string getFormattedName() const
std::vector< Spelling::Value > getSpellings() const
BaseRecord(const Record *Def)
const Record * getRecord() const
StringRef getClangClass() const
std::vector< const Record * > getClauseVals() const
bool skipFlangUnparser() const
Clause(const Record *Def)
StringRef getDefaultValue() const
bool isValueOptional() const
StringRef getFlangClass() const
std::vector< StringRef > getAliases() const
std::string getClangAccSpelling() const
StringRef getEnumName() const
bool isPrefixOptional() const
std::string getFormattedParserClassName() const
StringRef getPrefix() const
bool hasMakeEnumAvailableInNamespace() const
bool HasValidityErrors() const
StringRef getClausePrefix() const
StringRef getClauseEnumSetClass() const
DirectiveLanguage(const RecordKeeper &Records)
ArrayRef< const Record * > getAssociations() const
StringRef getLoopModifierPrefix() const
ArrayRef< const Record * > getDirectives() const
ArrayRef< const Record * > getClauses() const
ArrayRef< const Record * > getLoopModifiers() const
StringRef getName() const
ArrayRef< const Record * > getCategories() const
StringRef getDirectivePrefix() const
bool hasEnableBitmaskEnumInNamespace() const
StringRef getCppNamespace() const
ArrayRef< const Record * > getSourceLanguages() const
StringRef getFlangClauseBaseClass() const
const Record * getAssociation() const
std::vector< const Record * > getLeafConstructs() const
const Record * getCategory() const
std::vector< const Record * > getAllowedClauses() const
Directive(const Record *Def)
std::vector< const Record * > getAllowedOnceClauses() const
std::vector< const Record * > getRequiredClauses() const
std::vector< const Record * > getSourceLanguages() const
std::vector< const Record * > getAllowedLoopModifiers() const
std::string getClangAccSpelling() const
std::vector< const Record * > getAllowedExclusiveClauses() const
bool isUserVisible() const
EnumVal(const Record *Def)
Spelling(const Record *Def)
StringRef getText() const
directive::Spelling Value
llvm::directive::VersionRange getVersions() const
Represent a constant reference to a string, i.e.
int64_t getMinVersion() const
int64_t getMaxVersion() const
VersionedClause(const Record *Def)
unsigned getMinVersion(const Record *R) const
unsigned getMaxVersion(const Record *R) const
This is an optimization pass for GlobalISel generic memory operations.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
OutputIt transform(R &&Range, OutputIt d_first, UnaryFunction F)
Wrapper function around std::transform to apply a function to a range and store the result elsewhere.
void replace(R &&Range, const T &OldValue, const T &NewValue)
Provide wrappers to std::replace which take ranges instead of having to pass begin/end explicitly.
char toUpper(char x)
Returns the corresponding uppercase character if x is lowercase.
@ End
Run the machine verifier once, at the end of the pipeline.