#include "source/opt/type_manager.h"
#include <algorithm>
#include <cassert>
#include <cstring>
#include <utility>
#include "source/opt/ir_context.h"
#include "source/opt/log.h"
#include "source/opt/reflect.h"
#include "source/util/make_unique.h"
#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
namespace analysis {
namespace {
constexpr int kSpvTypePointerStorageClass = …;
constexpr int kSpvTypePointerTypeIdInIdx = …;
}
TypeManager::TypeManager(const MessageConsumer& consumer, IRContext* c)
: … { … }
Type* TypeManager::GetType(uint32_t id) const { … }
std::pair<Type*, std::unique_ptr<Pointer>> TypeManager::GetTypeAndPointerType(
uint32_t id, spv::StorageClass sc) const { … }
uint32_t TypeManager::GetId(const Type* type) const { … }
void TypeManager::AnalyzeTypes(const Module& module) { … }
void TypeManager::RemoveId(uint32_t id) { … }
uint32_t TypeManager::GetTypeInstruction(const Type* type) { … }
uint32_t TypeManager::FindPointerToType(uint32_t type_id,
spv::StorageClass storage_class) { … }
void TypeManager::AttachDecorations(uint32_t id, const Type* type) { … }
void TypeManager::CreateDecoration(uint32_t target,
const std::vector<uint32_t>& decoration,
bool is_member, uint32_t element) { … }
Type* TypeManager::RebuildType(uint32_t type_id, const Type& type) { … }
void TypeManager::RegisterType(uint32_t id, const Type& type) { … }
Type* TypeManager::GetRegisteredType(const Type* type) { … }
Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { … }
void TypeManager::AttachDecoration(const Instruction& inst, Type* type) { … }
const Type* TypeManager::GetMemberType(
const Type* parent_type, const std::vector<uint32_t>& access_chain) { … }
void TypeManager::ReplaceForwardPointers(Type* type) { … }
void TypeManager::ReplaceType(Type* new_type, Type* original_type) { … }
}
}
}