RemoveBufferBlockVisitor.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //===--- RemoveBufferBlockVisitor.h - RemoveBufferBlock Visitor --*- C++ -*-==//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef LLVM_CLANG_LIB_SPIRV_REMOVEBUFFERBLOCKVISITOR_H
  10. #define LLVM_CLANG_LIB_SPIRV_REMOVEBUFFERBLOCKVISITOR_H
  11. #include "clang/SPIRV/SpirvVisitor.h"
  12. namespace clang {
  13. namespace spirv {
  14. class SpirvContext;
  15. class RemoveBufferBlockVisitor : public Visitor {
  16. public:
  17. RemoveBufferBlockVisitor(SpirvContext &spvCtx,
  18. const SpirvCodeGenOptions &opts)
  19. : Visitor(opts, spvCtx) {}
  20. bool visit(SpirvModule *, Phase) override;
  21. using Visitor::visit;
  22. /// The "sink" visit function for all instructions.
  23. ///
  24. /// By default, all other visit instructions redirect to this visit function.
  25. /// So that you want override this visit function to handle all instructions,
  26. /// regardless of their polymorphism.
  27. bool visitInstruction(SpirvInstruction *instr) override;
  28. };
  29. } // end namespace spirv
  30. } // end namespace clang
  31. #endif // LLVM_CLANG_LIB_SPIRV_REMOVEBUFFERBLOCKVISITOR_H