chromium/third_party/spirv-tools/src/source/opt/module.h

// Copyright (c) 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SOURCE_OPT_MODULE_H_
#define SOURCE_OPT_MODULE_H_

#include <functional>
#include <memory>
#include <string_view>
#include <unordered_map>
#include <utility>
#include <vector>

#include "source/opt/function.h"
#include "source/opt/instruction.h"
#include "source/opt/iterator.h"

namespace spvtools {
namespace opt {

class IRContext;

// A struct for containing the module header information.
struct ModuleHeader {};

// A SPIR-V module. It contains all the information for a SPIR-V module and
// serves as the backbone of optimization transformations.
class Module {};

// Pretty-prints |module| to |str|. Returns |str|.
std::ostream& operator<<(std::ostream& str, const Module& module);

inline void Module::AddCapability(std::unique_ptr<Instruction> c) {}

inline void Module::AddExtension(std::unique_ptr<Instruction> e) {}

inline void Module::AddExtInstImport(std::unique_ptr<Instruction> e) {}

inline void Module::SetMemoryModel(std::unique_ptr<Instruction> m) {}

inline void Module::SetSampledImageAddressMode(std::unique_ptr<Instruction> m) {}

inline void Module::AddEntryPoint(std::unique_ptr<Instruction> e) {}

inline void Module::AddExecutionMode(std::unique_ptr<Instruction> e) {}

inline void Module::AddDebug1Inst(std::unique_ptr<Instruction> d) {}

inline void Module::AddDebug2Inst(std::unique_ptr<Instruction> d) {}

inline void Module::AddDebug3Inst(std::unique_ptr<Instruction> d) {}

inline void Module::AddExtInstDebugInfo(std::unique_ptr<Instruction> d) {}

inline void Module::AddAnnotationInst(std::unique_ptr<Instruction> a) {}

inline void Module::AddType(std::unique_ptr<Instruction> t) {}

inline void Module::AddGlobalValue(std::unique_ptr<Instruction> v) {}

inline void Module::AddFunctionDeclaration(std::unique_ptr<Function> f) {}

inline void Module::AddFunction(std::unique_ptr<Function> f) {}

inline void Module::SetContainsDebugInfo() {}

inline Module::inst_iterator Module::capability_begin() {}
inline Module::inst_iterator Module::capability_end() {}

inline IteratorRange<Module::inst_iterator> Module::capabilities() {}

inline IteratorRange<Module::const_inst_iterator> Module::capabilities() const {}

inline Module::inst_iterator Module::ext_inst_import_begin() {}
inline Module::inst_iterator Module::ext_inst_import_end() {}

inline IteratorRange<Module::inst_iterator> Module::ext_inst_imports() {}

inline IteratorRange<Module::const_inst_iterator> Module::ext_inst_imports()
    const {}

inline Module::inst_iterator Module::debug1_begin() {}
inline Module::inst_iterator Module::debug1_end() {}

inline IteratorRange<Module::inst_iterator> Module::debugs1() {}

inline IteratorRange<Module::const_inst_iterator> Module::debugs1() const {}

inline Module::inst_iterator Module::debug2_begin() {}
inline Module::inst_iterator Module::debug2_end() {}

inline IteratorRange<Module::inst_iterator> Module::debugs2() {}

inline IteratorRange<Module::const_inst_iterator> Module::debugs2() const {}

inline Module::inst_iterator Module::debug3_begin() {}
inline Module::inst_iterator Module::debug3_end() {}

inline IteratorRange<Module::inst_iterator> Module::debugs3() {}

inline IteratorRange<Module::const_inst_iterator> Module::debugs3() const {}

inline Module::inst_iterator Module::ext_inst_debuginfo_begin() {}
inline Module::inst_iterator Module::ext_inst_debuginfo_end() {}

inline IteratorRange<Module::inst_iterator> Module::ext_inst_debuginfo() {}

inline IteratorRange<Module::const_inst_iterator> Module::ext_inst_debuginfo()
    const {}

inline IteratorRange<Module::inst_iterator> Module::entry_points() {}

inline IteratorRange<Module::const_inst_iterator> Module::entry_points() const {}

inline Module::inst_iterator Module::execution_mode_begin() {}
inline Module::inst_iterator Module::execution_mode_end() {}

inline IteratorRange<Module::inst_iterator> Module::execution_modes() {}

inline IteratorRange<Module::const_inst_iterator> Module::execution_modes()
    const {}

inline Module::inst_iterator Module::annotation_begin() {}
inline Module::inst_iterator Module::annotation_end() {}

inline IteratorRange<Module::inst_iterator> Module::annotations() {}

inline IteratorRange<Module::const_inst_iterator> Module::annotations() const {}

inline Module::inst_iterator Module::extension_begin() {}
inline Module::inst_iterator Module::extension_end() {}

inline IteratorRange<Module::inst_iterator> Module::extensions() {}

inline IteratorRange<Module::const_inst_iterator> Module::extensions() const {}

inline Module::inst_iterator Module::types_values_begin() {}

inline Module::inst_iterator Module::types_values_end() {}

inline IteratorRange<Module::inst_iterator> Module::types_values() {}

inline IteratorRange<Module::const_inst_iterator> Module::types_values() const {}

inline Module::const_iterator Module::cbegin() const {}

inline Module::const_iterator Module::cend() const {}

}  // namespace opt
}  // namespace spvtools

#endif  // SOURCE_OPT_MODULE_H_