https://github.com/shader-slang/slang
Raw File
Tip revision: 911a4401b08f6199e18b32349c236c186a2dd128 authored by Yong He on 02 November 2023, 21:54:22 UTC
Fix crash when writing to `no_diff` out parameter. (#3308)
Tip revision: 911a440
slang-ir-string-hash.h
// slang-ir-string-hash.h
#pragma once

#include "slang-ir.h"

#include "../core/slang-string-slice-pool.h"

namespace Slang
{

struct IRModule;
class DiagnosticSink;

// Finds the global GlobalHashedStringLiterals instruction for the module if there is one, and then
// adds all of it's strings to ioPool.
void findGlobalHashedStringLiterals(IRModule* module, StringSlicePool& ioPool);

// Given a pool, with > 0 strings adds a GlobalHashedStringLiterals to the module. 
void addGlobalHashedStringLiterals(const StringSlicePool& pool, IRModule* module);

// Find all of the IRGetStringHash instructions within the module
void findGetStringHashInsts(IRModule* module, List<IRGetStringHash*>& outInsts);

// Looks at all getStringHash instructions to make sure they access something valid (like a string literal)
// sink is optional and can be passed as nullptr
Result checkGetStringHashInsts(IRModule* module, DiagnosticSink* sink);

} // namespace Slang
back to top