diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-10-13 22:39:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-13 22:39:15 -0700 |
| commit | 3e3e2473bf85365593629bd1f6f070d11f0b8ab2 (patch) | |
| tree | 429dd72c135a43826a2aa29efe81b4de0915202b /source/slang/syntax.cpp | |
| parent | 64ddefb90cf440df7879d1f2f9cc61de71e0f181 (diff) | |
Get rid of the `-slang-ir-asm` target (#212)
* Get rid of the `-slang-ir-asm` target
This is really only useful for debugging, so I've replaced the functionality with a `-dump-ir` command line option (which dump's the IR for an entry point before doing codegen).
* fixup: use HLSL target, not DXBC, so test can run on Linux
Diffstat (limited to 'source/slang/syntax.cpp')
| -rw-r--r-- | source/slang/syntax.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp index 4dbb6c05b..b863cb707 100644 --- a/source/slang/syntax.cpp +++ b/source/slang/syntax.cpp @@ -294,6 +294,15 @@ void Type::accept(IValVisitor* visitor, void* extra) declRef)->As<PtrType>(); } + RefPtr<GroupSharedType> Session::getGroupSharedType(RefPtr<Type> valueType) + { + RefPtr<GroupSharedType> groupSharedType = new GroupSharedType(); + groupSharedType->setSession(this); + groupSharedType->valueType = valueType; + return groupSharedType; + } + + SyntaxClass<RefObject> Session::findSyntaxClass(Name* name) { SyntaxClass<RefObject> syntaxClass; @@ -337,6 +346,36 @@ void Type::accept(IValVisitor* visitor, void* extra) return baseType->ToString() + "[]"; } + // GroupSharedType + + Slang::String GroupSharedType::ToString() + { + return "@ThreadGroup " + valueType->ToString(); + } + + bool GroupSharedType::EqualsImpl(Type * type) + { + auto t = type->As<GroupSharedType>(); + if (!t) + return false; + return valueType->Equals(t->valueType); + } + + Type* GroupSharedType::CreateCanonicalType() + { + auto canonicalValueType = valueType->GetCanonicalType(); + auto canonicalGroupSharedType = getSession()->getGroupSharedType(canonicalValueType); + session->canonicalTypes.Add(canonicalGroupSharedType); + return canonicalGroupSharedType; + } + + int GroupSharedType::GetHashCode() + { + return combineHash( + valueType->GetHashCode(), + (int)(typeid(this).hash_code())); + } + // DeclRefType String DeclRefType::ToString() |
