blob: 383389c39b86c5490fe1f1cf771a1db232951402 (
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
|
// slang-ast-modifier.cpp
#include "slang-ast-modifier.h"
#include "slang-ast-expr.h"
namespace Slang
{
const OrderedDictionary<Type*, SubtypeWitness*>& DifferentiableAttribute::
getMapTypeToIDifferentiableWitness()
{
for (Index i = m_mapToIDifferentiableWitness.getCount();
i < m_typeToIDifferentiableWitnessMappings.getCount();
i++)
m_mapToIDifferentiableWitness.add(
m_typeToIDifferentiableWitnessMappings[i].key,
m_typeToIDifferentiableWitnessMappings[i].value);
return m_mapToIDifferentiableWitness;
}
void printDiagnosticArg(StringBuilder& sb, Modifier* modifier)
{
if (!modifier)
return;
if (modifier->keywordName && modifier->keywordName->text.getLength())
sb << modifier->keywordName->text;
if (auto hlslSemantic = as<HLSLSemantic>(modifier))
sb << hlslSemantic->name.getContent();
return;
}
} // namespace Slang
|