1 // Copyright (c) 2017 The Khronos Group Inc.
2 // Copyright (c) 2017 Valve Corporation
3 // Copyright (c) 2017 LunarG Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef SOURCE_OPT_INLINE_EXHAUSTIVE_PASS_H_
18 #define SOURCE_OPT_INLINE_EXHAUSTIVE_PASS_H_
19 
20 #include <algorithm>
21 #include <list>
22 #include <memory>
23 #include <unordered_map>
24 #include <vector>
25 
26 #include "source/opt/def_use_manager.h"
27 #include "source/opt/inline_pass.h"
28 #include "source/opt/module.h"
29 
30 namespace spvtools {
31 namespace opt {
32 
33 // See optimizer.hpp for documentation.
34 class InlineExhaustivePass : public InlinePass {
35  public:
36   InlineExhaustivePass();
37   Status Process() override;
38 
name()39   const char* name() const override { return "inline-entry-points-exhaustive"; }
40 
41  private:
42   // Exhaustively inline all function calls in func as well as in
43   // all code that is inlined into func. Returns the status.
44   Status InlineExhaustive(Function* func);
45 
46   void Initialize();
47   Pass::Status ProcessImpl();
48 };
49 
50 }  // namespace opt
51 }  // namespace spvtools
52 
53 #endif  // SOURCE_OPT_INLINE_EXHAUSTIVE_PASS_H_
54