diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-12-12 08:57:48 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-12 08:57:48 -0500 |
| commit | 49ed6b60d662906f290578f802f80b0ead1a2b9d (patch) | |
| tree | e47050f6508a4b3a4d38b756e9b3c53e0d159507 /source/slang/syntax.cpp | |
| parent | 62d3e387774255be4d507cca045ac97dabac9970 (diff) | |
Running tests in slang-test process (#740)
* First pass at having an interface to write text to that can be replaced.
Simplifed and made more rigerous the interface used to write formatted strings.
* Added AppContext to simplify setting up and parsing around of streams.
* Added more simplified way to get the std error/out from AppContext.
* Work in progress using dll for tools to speed up testing.
* First pass at ISlangWriter interface.
* Added support for writing VaArgs.
Added NullWriter.
* Use ISlangWriter for output.
* Use ISlangWriter for output - replacing OutputCallback.
Make IRDump go to ISlangWriter
* SlangWriterTargetType -> SlangWriterChannel
Improvements around AppContext
* Shared library working with slang-reflection-test.
* Dll testing working for render-test.
* Include va_list definintion from header.
* Fix errors from clang.
* Fix typo for linux.
* Added -usexes option
* Fix typo.
* Fix arguments problem on linux.
* Fix typo for linux.
* Add windows tool shared library projects.
* Fix warning from x86 win build.
Fix signed warning from slang-test/main.cpp
* First attempt at getting premake to work on travis, and run tests.
* Try moving build out into script.
* Invoke bash scripts so they don't have to be executable.
* Drive configuration/tests from env parameters set by travis
* Try using source to run travis tests.
* Remove the build.linux directory - but doing so will overwrite Makefile.
* Made -fno-delete-null-pointer-checks gcc only.
* Try to fix warning from -fno-delete-null-pointer-checks
* Turn of warnings for unknown switches.
* Try to make premake choose the correct tooling.
* Disabled missing braces warning.
* Disable -Wundefined-var-template on clang.
* -Wunused-function disabled for clang.
* Fix typo due to SlangBool.
* Remove this nullptr tests.
* "-Wno-unused-private-field" for clang.
* Added "-Wno-undefined-bool-conversion"
* Add DominatorList::end fix.
* Split scripts into travis_build.sh travis_test.sh
* Fix gcc/clang template pre-declaration issue around QualType.
* Fix premake to build such that pthread correctly links with slang-glslang
Diffstat (limited to 'source/slang/syntax.cpp')
| -rw-r--r-- | source/slang/syntax.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp index c1585a51a..d354057b2 100644 --- a/source/slang/syntax.cpp +++ b/source/slang/syntax.cpp @@ -153,7 +153,8 @@ void Type::accept(IValVisitor* visitor, void* extra) Type* Type::GetCanonicalType() { - if (!this) return nullptr; + SLANG_ASSERT(this); + Type* et = const_cast<Type*>(this); if (!et->canonicalType) { @@ -1314,7 +1315,7 @@ void Type::accept(IValVisitor* visitor, void* extra) RefPtr<Substitutions> GenericSubstitution::applySubstitutionsShallow(SubstitutionSet substSet, RefPtr<Substitutions> substOuter, int* ioDiff) { - if (!this) return nullptr; + SLANG_ASSERT(this); int diff = 0; @@ -1366,7 +1367,7 @@ void Type::accept(IValVisitor* visitor, void* extra) RefPtr<Substitutions> ThisTypeSubstitution::applySubstitutionsShallow(SubstitutionSet substSet, RefPtr<Substitutions> substOuter, int* ioDiff) { - if (!this) return nullptr; + SLANG_ASSERT(this); int diff = 0; @@ -1385,8 +1386,10 @@ void Type::accept(IValVisitor* visitor, void* extra) bool ThisTypeSubstitution::Equals(Substitutions* subst) { + SLANG_ASSERT(this); if (!subst) - return this == nullptr; + return false; + if (auto thisTypeSubst = dynamic_cast<ThisTypeSubstitution*>(subst)) { return witness->EqualsVal(thisTypeSubst->witness); @@ -1914,7 +1917,7 @@ void Type::accept(IValVisitor* visitor, void* extra) RefPtr<Val> Val::Substitute(SubstitutionSet subst) { - if (!this) return nullptr; + SLANG_ASSERT(this); if (!subst) return this; int diff = 0; return SubstituteImpl(subst, &diff); |
