https://github.com/shader-slang/slang
Raw File
Tip revision: e59516fa8c3a16eb7b99a928c5b85b97bf44fd72 authored by Yong He on 01 February 2022, 00:26:03 UTC
Revise entrypoint renaming interface. (#2113)
Tip revision: e59516f
slang-ir-link.h
// slang-ir-link.h
#pragma once

#include "slang-compiler.h"

namespace Slang
{
    struct IRVarLayout;

    struct LinkedIR
    {
        RefPtr<IRModule>    module;
        IRVarLayout*        globalScopeVarLayout;
        List<IRFunc*>       entryPoints;
    };


    // Clone the IR values reachable from the given entry point
    // into the IR module associated with the specialization state.
    // When multiple definitions of a symbol are found, the one
    // that is best specialized for the appropriate compilation
    // target will be used.
    //
    LinkedIR linkIR(
        BackEndCompileRequest*  compileRequest,
        const List<Int>&        entryPointIndices,
        CodeGenTarget           target,
        TargetProgram*          targetProgram);

    // Replace any global constants in the IR module with their
    // definitions, if possible.
    //
    // This pass should always be run shortly after linking the
    // IR, to ensure that constants with identical values are
    // treated as identical for the purposes of specialization.
    //
    void replaceGlobalConstants(IRModule* module);
}
back to top