summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-base.h
blob: 2188b0f8241eac8c09f710f439fe9f26dfbd616e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// slang-emit-base.h
#ifndef SLANG_EMIT_BASE_H
#define SLANG_EMIT_BASE_H

#include "../core/slang-basic.h"
#include "slang-ir-insts.h"
#include "slang-ir-restructure.h"
#include "slang-ir.h"

namespace Slang
{

class SourceEmitterBase : public RefObject
{
public:
    IRInst* getSpecializedValue(IRSpecialize* specInst);

    /// Inspect the capabilities required by `inst` (according to its decorations),
    /// and ensure that those capabilities have been detected and stored in the
    /// target-specific extension tracker.
    void handleRequiredCapabilities(IRInst* inst);
    virtual void handleRequiredCapabilitiesImpl(IRInst* inst) { SLANG_UNUSED(inst); }

    static IRVarLayout* getVarLayout(IRInst* var);

    static BaseType extractBaseType(IRType* inType);
};

} // namespace Slang
#endif