chromium/third_party/spirv-tools/src/source/opt/function.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_FUNCTION_H_
#define SOURCE_OPT_FUNCTION_H_

#include <algorithm>
#include <functional>
#include <memory>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>

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

namespace spvtools {
namespace opt {

class CFG;
class IRContext;
class Module;

// A SPIR-V function.
class Function {};

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

inline Function::Function(std::unique_ptr<Instruction> def_inst)
    :{}

inline void Function::AddParameter(std::unique_ptr<Instruction> p) {}

inline void Function::AddDebugInstructionInHeader(
    std::unique_ptr<Instruction> p) {}

inline void Function::AddBasicBlock(std::unique_ptr<BasicBlock> b) {}

inline void Function::AddBasicBlock(std::unique_ptr<BasicBlock> b,
                                    iterator ip) {}

template <typename T>
inline void Function::AddBasicBlocks(T src_begin, T src_end, iterator ip) {}

inline void Function::MoveBasicBlockToAfter(uint32_t id, BasicBlock* ip) {}

inline void Function::RemoveEmptyBlocks() {}

inline void Function::RemoveParameter(uint32_t id) {}

inline void Function::SetFunctionEnd(std::unique_ptr<Instruction> end_inst) {}

inline void Function::AddNonSemanticInstruction(
    std::unique_ptr<Instruction> non_semantic) {}

template <class It>
void Function::ReorderBasicBlocks(It begin, It end) {}

template <class It>
bool Function::ContainsAllBlocksInTheFunction(It begin, It end) {}

}  // namespace opt
}  // namespace spvtools

#endif  // SOURCE_OPT_FUNCTION_H_