inline_exhaustive_pass.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #ifndef SOURCE_OPT_INLINE_EXHAUSTIVE_PASS_H_
  17. #define SOURCE_OPT_INLINE_EXHAUSTIVE_PASS_H_
  18. #include <algorithm>
  19. #include <list>
  20. #include <memory>
  21. #include <unordered_map>
  22. #include <vector>
  23. #include "source/opt/def_use_manager.h"
  24. #include "source/opt/inline_pass.h"
  25. #include "source/opt/module.h"
  26. namespace spvtools {
  27. namespace opt {
  28. // See optimizer.hpp for documentation.
  29. class InlineExhaustivePass : public InlinePass {
  30. public:
  31. InlineExhaustivePass();
  32. Status Process() override;
  33. const char* name() const override { return "inline-entry-points-exhaustive"; }
  34. private:
  35. // Exhaustively inline all function calls in func as well as in
  36. // all code that is inlined into func. Returns the status.
  37. Status InlineExhaustive(Function* func);
  38. void Initialize();
  39. Pass::Status ProcessImpl();
  40. };
  41. } // namespace opt
  42. } // namespace spvtools
  43. #endif // SOURCE_OPT_INLINE_EXHAUSTIVE_PASS_H_