Home
last modified time | relevance | path

Searched refs:Rule (Results 1 – 25 of 76) sorted by relevance

1234

/llvm-project-15.0.7/clang-tools-extra/pseudo/lib/cxx/
H A DCXX.cpp116 using cxx::Rule; in isFunctionDeclarator()
122 switch ((cxx::Rule)Declarator->rule()) { in isFunctionDeclarator()
131 case Rule:: in isFunctionDeclarator()
138 case Rule:: in isFunctionDeclarator()
148 case Rule::ptr_declarator_0noptr_declarator: in isFunctionDeclarator()
149 case Rule::declarator_0ptr_declarator: in isFunctionDeclarator()
220 case (RuleID)Rule::decl_specifier_0inline: in hasExclusiveType()
221 case (RuleID)Rule::decl_specifier_0friend: in hasExclusiveType()
283 {(RuleID)Rule:: in buildGuards()
304 {(RuleID)Rule:: in buildGuards()
[all …]
/llvm-project-15.0.7/clang/include/clang/Tooling/Transformer/
H A DTransformer.h81 : Transformer(std::move(Rule),
97 transformer::RewriteRuleWith<MetadataT> Rule,
120 assert(llvm::all_of(Rule.Metadata,
138 auto Metadata = Rule.Metadata[SelectedCase]->eval(Match);
156 transformer::RewriteRuleWith<T> Rule;
164 assert(llvm::all_of(Rule.Cases,
168 assertMetadataSet(Rule);
174 auto Transformations = Rule.Cases[I].Edits(Result);
206 return transformer::detail::buildMatchers(Rule);
213 transformer::RewriteRuleWith<MetadataT> Rule,
[all …]
H A DRewriteRule.h411 for (auto &Rule : Rules) {
412 assert(Rule.Cases.size() == Rule.Metadata.size() &&
414 R.Cases.append(Rule.Cases.begin(), Rule.Cases.end());
415 R.Metadata.append(Rule.Metadata.begin(), Rule.Metadata.end());
440 stripMetadata(RewriteRuleWith<MetadataT> Rule) {
442 R.Cases = std::move(Rule.Cases);
488 rewriteDescendants(const Decl &Node, RewriteRule Rule,
492 rewriteDescendants(const Stmt &Node, RewriteRule Rule,
509 buildMatcher(const RewriteRuleBase &Rule);
519 buildMatchers(const RewriteRuleBase &Rule);
[all …]
/llvm-project-15.0.7/clang/lib/Tooling/Transformer/
H A DRewriteRule.cpp254 ApplyRuleCallback(RewriteRule Rule) : Rule(std::move(Rule)) {} in ApplyRuleCallback() argument
267 auto Transformations = Rule.Cases[I].Edits(Result); in run()
275 RewriteRule Rule; member in __anonde3286510611::ApplyRuleCallback
284 rewriteDescendantsImpl(const T &Node, RewriteRule Rule, in rewriteDescendantsImpl() argument
286 ApplyRuleCallback Callback(std::move(Rule)); in rewriteDescendantsImpl()
331 Rule = std::move(Rule)](const MatchResult &Result) in rewriteDescendants()
345 for (auto &Case : Rule.Cases) in addInclude()
388 for (auto &Rule : Rules) in applyFirst() local
389 R.Cases.append(Rule.Cases.begin(), Rule.Cases.end()); in applyFirst()
427 std::vector<DynTypedMatcher> Ms = buildMatchers(Rule); in buildMatcher()
[all …]
/llvm-project-15.0.7/llvm/utils/TableGen/
H A DGICombinerEmitter.cpp331 format("__anon%" PRIu64 "_%u", Rule.getID(), Rule.allocUID()))); in makeNameForAnonInstr()
340 format("__anonpred%" PRIu64 "_%u", Rule.getID(), Rule.allocUID()))); in makeNameForAnonPredicate()
659 if (!Rule->parseDefs()) in makeCombineRule()
664 Rule->reorientToRoots(); in makeCombineRule()
668 Rule->getMatchDag().dump(); in makeCombineRule()
669 Rule->getMatchDag().writeDOTGraph(dbgs(), Rule->getName()); in makeCombineRule()
672 return Rule; in makeCombineRule()
695 if (Rule->getNumRoots() > 1) { in makeCombineRule()
699 return Rule; in makeCombineRule()
709 if (Rule == nullptr) { in gatherRules()
[all …]
H A DGlobalISelEmitter.cpp689 for (Matcher *Rule : Rules) in buildTable()
690 Rule->emit(Table); in buildTable()
2278 RuleMatcher &Rule; member in __anoncee47b830111::InstructionMatcher
2296 : Rule(Rule), NumOperandsCheck(NumOpsCheck), SymbolicName(SymbolicName) { in InstructionMatcher()
2379 }, Table, Rule); in emitPredicateOpcodes()
2390 }, Table, Rule); in emitPredicateOpcodes()
5578 for (Matcher *Rule : Rules) { in optimizeRules()
5604 for (Matcher &Rule : Rules) in buildMatchTable()
5628 Rule->optimize(); in buildMatchTable()
5635 Rule->optimize(); in buildMatchTable()
[all …]
H A DAttributes.cpp86 for (auto *Rule : CompatRules) { in emitFnAttrCompatCheck() local
87 StringRef FuncName = Rule->getValueAsString("CompatFunc"); in emitFnAttrCompatCheck()
100 for (auto *Rule : MergeRules) { in emitFnAttrCompatCheck() local
101 StringRef FuncName = Rule->getValueAsString("MergeFunc"); in emitFnAttrCompatCheck()
/llvm-project-15.0.7/polly/test/CodeGen/
H A Dinv-load-lnt-crash-wrong-order-2.ll10 …88.721.754.886.985.1216.2436.2469.2634.2667.2766.2898.2997.3035*, %struct.Rule.33.66.99.264.594.62…
11Rule.33.66.99.264.594.627.693.726.759.891.990.1221.2441.2474.2639.2672.2771.2903.3002.3018 = type …
13 … { i32, i32, %struct.Rule.33.66.99.264.594.627.693.726.759.891.990.1221.2441.2474.2639.2672.2771.2…
17 …9.1200.2420.2453.2618.2651.2750.2882.2981.3021 = type { i32, i32, %struct.Rule.33.66.99.264.594.62…
22 …898.2997.3035*, %struct.Rule.33.66.99.264.594.627.693.726.759.891.990.1221.2441.2474.2639.2672.277…
28 …78.711.744.876.975.1206.2426.2459.2624.2657.2756.2888.2987.3013*, %struct.Rule.33.66.99.264.594.62…
30 …88.721.754.886.985.1216.2436.2469.2634.2667.2766.2898.2997.3035*, %struct.Rule.33.66.99.264.594.62…
71 …%2 = load %struct.Rule.33.66.99.264.594.627.693.726.759.891.990.1221.2441.2474.2639.2672.2771.2903…
75 …entptr inbounds %struct.Rule.33.66.99.264.594.627.693.726.759.891.990.1221.2441.2474.2639.2672.277…
81 …%4 = bitcast %struct.Rule.33.66.99.264.594.627.693.726.759.891.990.1221.2441.2474.2639.2672.2771.2…
[all …]
H A Dinv-load-lnt-crash-wrong-order.ll10 …State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, %struct.Rule.33.66.99.330.495.85…
11Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588 = type { i32, %struct.Production.29…
12 ….42.75.306.471.834.900.933.966.1032.2020.2119.2152.2581, i32, i8, %struct.Rule.33.66.99.330.495.85…
13 …52.2581 = type { i32, i32, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588*…
17 …9.474.837.903.936.969.1035.2023.2122.2155.2591 = type { i32, i32, %struct.Rule.33.66.99.330.495.85…
22 …85.1051.2039.2138.2171.2605*, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.25…
28 ….Term.18.51.84.315.480.843.909.942.975.1041.2029.2128.2161.2583*, %struct.Rule.33.66.99.330.495.85…
30 …State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, %struct.Rule.33.66.99.330.495.85…
65 …%2 = load %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588*, %struct.Rule.33…
69 …n380 = getelementptr inbounds %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.25…
[all …]
/llvm-project-15.0.7/llvm/lib/CodeGen/GlobalISel/
H A DLegalizerInfo.cpp99 switch (Rule.getAction()) { in hasNoSimpleLoops()
113 static bool mutationIsSane(const LegalizeRule &Rule, in mutationIsSane() argument
118 if (Rule.getAction() == Custom || Rule.getAction() == Legal) in mutationIsSane()
125 switch (Rule.getAction()) { in mutationIsSane()
135 if (Rule.getAction() == FewerElements) { in mutationIsSane()
144 } else if (Rule.getAction() == MoreElements) in mutationIsSane()
162 if (Rule.getAction() == NarrowScalar) { in mutationIsSane()
190 for (const LegalizeRule &Rule : Rules) { in apply() local
191 if (Rule.match(Query)) { in apply()
194 LLVM_DEBUG(dbgs() << ".. .. " << Rule.getAction() << ", " in apply()
[all …]
/llvm-project-15.0.7/clang/unittests/Tooling/
H A DRefactoringActionRulesTest.cpp37 createReplacements(const std::unique_ptr<RefactoringActionRule> &Rule, in createReplacements() argument
54 Rule->invoke(C, Context); in createReplacements()
96 auto Rule = in TEST_F() local
108 createReplacements(Rule, RefContext); in TEST_F()
135 createReplacements(Rule, RefContext); in TEST_F()
162 auto Rule = in TEST_F() local
168 Expected<AtomicChanges> Result = createReplacements(Rule, RefContext); in TEST_F()
178 Optional<SymbolOccurrences> findOccurrences(RefactoringActionRule &Rule, in findOccurrences() argument
194 Rule.invoke(C, Context); in findOccurrences()
220 auto Rule = createRefactoringActionRule<FindOccurrences>( in TEST_F() local
[all …]
H A DTransformerTest.cpp234 RewriteRule Rule = makeRule( in TEST_F() local
256 RewriteRule Rule = in TEST_F() local
270 testRule(Rule, Input, Expected); in TEST_F()
274 RewriteRule Rule = makeRule( in TEST_F() local
289 testRule(Rule, Input, Expected); in TEST_F()
307 testRule(Rule, Input, Expected); in TEST_F()
325 testRule(Rule, Input, Expected); in TEST_F()
342 testRule(Rule, Input, Expected); in TEST_F()
389 RewriteRule Rule = in TEST_F() local
412 testRule(Rule, Input, Expected); in TEST_F()
[all …]
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/utils/
H A DTransformerClangTidyCheck.cpp24 static void verifyRule(const RewriteRuleWith<std::string> &Rule) { in verifyRule() argument
25 assert(llvm::all_of(Rule.Metadata, hasGenerator) && in verifyRule()
88 Rule = std::move(R); in setRule()
98 if (!Rule.Cases.empty()) in registerMatchers()
99 for (auto &Matcher : transformer::detail::buildMatchers(Rule)) in registerMatchers()
108 size_t I = transformer::detail::findSelectedCase(Result, Rule); in check()
110 Rule.Cases[I].Edits(Result); in check()
121 Expected<std::string> Explanation = Rule.Metadata[I]->eval(Result); in check()
/llvm-project-15.0.7/clang-tools-extra/pseudo/lib/
H A DGLR.cpp348 RuleID Rule; member
358 return Rule > Other.Rule; in operator <()
423 bool canReduce(const Rule &R, RuleID RID, in canReduce()
436 void pop(const GSS::Node *Head, RuleID RID, const Rule &Rule) { in pop() argument
439 TempSequence.resize_for_overwrite(Rule.Size); in pop()
442 if (I + 1 == Rule.Size) { in pop()
448 if (!canReduce(Rule, RID, TempSequence)) in pop()
475 pop((*Heads)[NextPopHead], RID, Rule); in popPending()
568 const auto &Rule = Lang.G.lookupRule(*RID); in popAndPushTrivial() local
573 for (unsigned I = 0; I < Rule.Size; ++I) { in popAndPushTrivial()
[all …]
/llvm-project-15.0.7/clang-tools-extra/pseudo/include/clang-pseudo/grammar/
H A DGrammar.h103 struct Rule { struct
104 Rule(SymbolID Target, llvm::ArrayRef<SymbolID> Seq);
135 friend bool operator==(const Rule &L, const Rule &R) { argument
158 llvm::ArrayRef<Rule> rulesFor(SymbolID SID) const;
159 const Rule &lookupRule(RuleID RID) const;
230 std::vector<Rule> Rules;
/llvm-project-15.0.7/llvm/lib/CodeGen/MIRParser/
H A DMILexer.cpp330 if (!C.remaining().startswith(Rule) || !isdigit(C.peek(Rule.size()))) in maybeLexIndex()
333 C.advance(Rule.size()); in maybeLexIndex()
343 if (!C.remaining().startswith(Rule) || !isdigit(C.peek(Rule.size()))) in maybeLexIndexAndName()
346 C.advance(Rule.size()); in maybeLexIndexAndName()
382 const StringRef Rule = "%subreg."; in maybeLexSubRegisterIndex() local
383 if (!C.remaining().startswith(Rule)) in maybeLexSubRegisterIndex()
391 const StringRef Rule = "%ir-block."; in maybeLexIRBlock() local
394 if (isdigit(C.peek(Rule.size()))) in maybeLexIRBlock()
401 const StringRef Rule = "%ir."; in maybeLexIRValue() local
404 if (isdigit(C.peek(Rule.size()))) in maybeLexIRValue()
[all …]
/llvm-project-15.0.7/clang-tools-extra/pseudo/lib/grammar/
H A DGrammarBNF.cpp100 assert(Spec.Sequence.size() <= Rule::MaxElements); in build()
104 T->Rules.push_back(Rule(Lookup(Spec.Target), Symbols)); in build()
112 T->Rules, [&SymbolOrder](const Rule &Left, const Rule &Right) { in build()
117 auto StartIt = llvm::partition_point(T->Rules, [&](const Rule &R) { in build()
140 for (const auto &Rule : T->Rules) { in getTopologicalOrder() local
142 if (Rule.Size == 1 && pseudo::isNonterminal(Rule.Sequence[0])) in getTopologicalOrder()
143 Dependencies.push_back({Rule.Target, Rule.Sequence[0]}); in getTopologicalOrder()
207 RuleSpec Rule; in parse() local
208 if (parseLine(Line, Rule)) in parse()
209 Specs.push_back(std::move(Rule)); in parse()
[all …]
H A DLRGraph.cpp127 const auto &Rule = G.lookupRule(I.rule()); in availableRecovery() local
128 if (I.dot() != Rule.RecoveryIndex) in availableRecovery()
130 Result.push_back({Rule.Recovery, Rule.seq()[Rule.RecoveryIndex]}); in availableRecovery()
140 const auto &Rule = G.lookupRule(RID); in dump() local
147 return llvm::formatv("{0} := {1} • {2}{3}", G.symbolName(Rule.Target), in dump()
148 llvm::join(ToNames(Rule.seq().take_front(DotPos)), " "), in dump()
149 llvm::join(ToNames(Rule.seq().drop_front(DotPos)), " "), in dump()
150 Rule.RecoveryIndex == DotPos ? " [recovery]" : "") in dump()
242 const Rule &StartRule = G.lookupRule(RID); in buildLR0()
/llvm-project-15.0.7/clang/include/clang/Tooling/Refactoring/
H A DRefactoringActionRulesInternal.h59 auto Rule = in invokeRuleAfterValidatingRequirements() local
61 if (!Rule) in invokeRuleAfterValidatingRequirements()
62 return Consumer.handleError(Rule.takeError()); in invokeRuleAfterValidatingRequirements()
63 Rule->invoke(Consumer, Context); in invokeRuleAfterValidatingRequirements()
125 class Rule final : public RefactoringActionRule {
127 Rule(std::tuple<RequirementTypes...> Requirements)
151 return std::make_unique<Rule>(std::make_tuple(Requirements...));
/llvm-project-15.0.7/clang-tools-extra/pseudo/unittests/
H A DGrammarTest.cpp25 template <typename... T> testing::Matcher<const Rule &> Sequence(T... IDs) { in Sequence()
26 return testing::Property(&Rule::seq, ElementsAre(IDs...)); in Sequence()
70 const auto &Rule = G.lookupRule(/*RID=*/0); in TEST_F() local
71 EXPECT_THAT(Rule, ExpectedRule); in TEST_F()
72 EXPECT_THAT(G.symbolName(Rule.seq()[0]), "IDENTIFIER"); in TEST_F()
73 EXPECT_THAT(G.symbolName(Rule.seq()[1]), "+"); in TEST_F()
74 EXPECT_THAT(G.symbolName(Rule.seq()[2]), "_"); in TEST_F()
/llvm-project-15.0.7/clang-tools-extra/clangd/
H A DCompileCommands.h85 struct Rule { struct
92 static llvm::ArrayRef<Rule> rulesFor(llvm::StringRef Arg); argument
93 const Rule *matchingRule(llvm::StringRef Arg, unsigned Mode,
95 llvm::SmallVector<Rule> Rules;
/llvm-project-15.0.7/clang/tools/clang-refactor/
H A DClangRefactor.cpp261 for (const auto &Rule : this->ActionRules) { in RefactoringActionSubcommand()
262 if (Rule->hasSelectionRequirement()) { in RefactoringActionSubcommand()
274 for (const auto &Rule : this->ActionRules) { in RefactoringActionSubcommand()
376 auto Rule = getMatchingRule(**Subcommand); in Init() local
377 if (!Rule) in Init()
378 return Rule.takeError(); in Init()
381 MatchingRule = *Rule; in Init()
538 Rule->visitRefactoringOptions(Visitor); in getMatchingRule()
540 if (!Rule->hasSelectionRequirement()) { in getMatchingRule()
541 MatchingRules.push_back(Rule.get()); in getMatchingRule()
[all …]
/llvm-project-15.0.7/clang-tools-extra/unittests/clang-tidy/
H A DTransformerClangTidyCheckTest.cpp38 RewriteRuleWith<std::string> Rule = makeRule( in invertIf() local
45 return Rule; in invertIf()
222 RewriteRuleWith<std::string> Rule = in replaceCall() local
225 addInclude(Rule, "clang/OtherLib.h", Format); in replaceCall()
226 return Rule; in replaceCall()
272 RewriteRuleWith<std::string> Rule = transformer::makeRule( in rule() local
274 addInclude(Rule, "bar.h", IncludeFormat::Quoted); in rule()
275 return Rule; in rule()
/llvm-project-15.0.7/clang/unittests/Basic/
H A DSarifTest.cpp154 const SarifRule &Rule = in TEST_F() local
162 unsigned RuleIdx = Writer.createRule(Rule); in TEST_F()
208 const SarifRule &Rule = in TEST_F() local
216 unsigned ruleIdx = Writer.createRule(Rule); in TEST_F()
232 const SarifRule &Rule = in TEST_F() local
240 unsigned RuleIdx = Writer.createRule(Rule); in TEST_F()
277 const SarifRule &Rule = in TEST_F() local
311 unsigned RuleIdx = Writer.createRule(Rule); in TEST_F()
/llvm-project-15.0.7/clang/lib/Sema/
H A DSemaAttr.cpp878 switch (Rule) { in getParentAttrMatcherRule()
891 switch (Rule) { in isNegatedAttrMatcherSubRule()
948 for (const auto &Rule : Rules) { in ActOnPragmaAttributeAttribute() local
957 Diag(Rule.second.getBegin(), in ActOnPragmaAttributeAttribute()
969 std::make_pair(*ParentRule, Rule)); in ActOnPragmaAttributeAttribute()
972 for (const auto &Rule : Rules) { in ActOnPragmaAttributeAttribute() local
980 It->second != Rule) { in ActOnPragmaAttributeAttribute()
998 for (const auto &Rule : Rules) in ActOnPragmaAttributeAttribute() local
1001 for (const auto &Rule : Rules) { in ActOnPragmaAttributeAttribute() local
1024 for (const auto &Rule : RulesToCheck) { in ActOnPragmaAttributeAttribute() local
[all …]

1234