• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2020 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SOURCE_FUZZ_REPEATED_PASS_RECOMMENDER_H_
16 #define SOURCE_FUZZ_REPEATED_PASS_RECOMMENDER_H_
17 
18 #include <vector>
19 
20 #include "source/fuzz/fuzzer_pass.h"
21 
22 namespace spvtools {
23 namespace fuzz {
24 
25 // Interface for influencing interactions between repeated fuzzer passes, by
26 // allowing hints as to which passes are recommended to be run after one
27 // another.
28 class RepeatedPassRecommender {
29  public:
30   virtual ~RepeatedPassRecommender();
31 
32   // Given a reference to a repeated pass, |pass|, returns a sequence of
33   // repeated pass instances that might be worth running soon after having
34   // run |pass|.
35   virtual std::vector<FuzzerPass*> GetFuturePassRecommendations(
36       const FuzzerPass& pass) = 0;
37 };
38 
39 }  // namespace fuzz
40 }  // namespace spvtools
41 
42 #endif  // SOURCE_FUZZ_REPEATED_PASS_RECOMMENDER_H_
43