summaryrefslogtreecommitdiff
path: root/source/slang/slang-mangle.h
blob: e579ebfda1f21c5908eac448932e79453b70e573 (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
31
32
33
34
35
36
#ifndef SLANG_MANGLE_H_INCLUDED
#define SLANG_MANGLE_H_INCLUDED

// This file implements the name mangling scheme for the Slang language.

#include "../core/slang-basic.h"
#include "slang-syntax.h"

namespace Slang
{
    struct IRSpecialize;

    String getMangledName(ASTBuilder* astBuilder, Decl* decl);
    String getMangledName(ASTBuilder* astBuilder, DeclRef<Decl> const & declRef);
    String getMangledName(ASTBuilder* astBuilder, DeclRefBase const & declRef);

    String getHashedName(const UnownedStringSlice& mangledName);

    String getMangledNameForConformanceWitness(
        ASTBuilder* astBuilder,
        Type* sub,
        Type* sup);
    String getMangledNameForConformanceWitness(
        ASTBuilder* astBuilder,
        DeclRef<Decl> sub,
        DeclRef<Decl> sup);
    String getMangledNameForConformanceWitness(
        ASTBuilder* astBuilder,
        DeclRef<Decl> sub,
        Type* sup);
    String getMangledTypeName(
        ASTBuilder* astBuilder,
        Type* type);
}

#endif