summaryrefslogtreecommitdiff
path: root/source/slang
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-16 00:38:39 +0800
committerGitHub <noreply@github.com>2024-10-15 09:38:39 -0700
commit66b103180e168c597f3c246c68a9886b69707493 (patch)
tree1cf67b897d9e9fe897108a92fa8bb312a5de9f4e /source/slang
parent9e3b0367cfd63f21a0519b61b6fd13e94dac1c51 (diff)
Move C interface from slang.h to slang-deprecated.h (#5301)
* Squash redundant move warnings * Move C interface from slang.h to slang-deprecated.h spGetBuildTagString remains, because it's useful to have before the global session exists. This C API is used quite pervasively in the C++ helpers (for example slang::UserAttribute. It's not trivial to move these to slang-deprecated.h as they're entangled with some enums which are themselves used elsewhere in the compiler. The fact that these helpers use the C API can be viewed as an implementation detail for now, and this usage moved to slang-deprecated in due course. Closes https://github.com/shader-slang/slang/issues/4758 * Squash warnings for our usage of our deprecated API --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-api.cpp2
-rw-r--r--source/slang/slang-ast-val.cpp2
-rw-r--r--source/slang/slang-compiler.cpp2
-rw-r--r--source/slang/slang-ir.cpp2
-rw-r--r--source/slang/slang-mangle.cpp2
-rw-r--r--source/slang/slang-options.cpp2
-rw-r--r--source/slang/slang-preprocessor.cpp2
7 files changed, 9 insertions, 5 deletions
diff --git a/source/slang/slang-api.cpp b/source/slang/slang-api.cpp
index 412cec0d4..ccecc74e1 100644
--- a/source/slang/slang-api.cpp
+++ b/source/slang/slang-api.cpp
@@ -225,7 +225,9 @@ SLANG_API SlangCompileRequest* spCreateCompileRequest(
{
slang::ICompileRequest* request = nullptr;
// Will return with suitable ref count
+ SLANG_ALLOW_DEPRECATED_BEGIN
session->createCompileRequest(&request);
+ SLANG_ALLOW_DEPRECATED_END
return request;
}
diff --git a/source/slang/slang-ast-val.cpp b/source/slang/slang-ast-val.cpp
index 68a55e567..f30041175 100644
--- a/source/slang/slang-ast-val.cpp
+++ b/source/slang/slang-ast-val.cpp
@@ -120,7 +120,7 @@ String Val::toString()
{
StringBuilder builder;
toText(builder);
- return std::move(builder);
+ return builder;
}
HashCode Val::getHashCode()
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp
index 5bbc92e97..af4468383 100644
--- a/source/slang/slang-compiler.cpp
+++ b/source/slang/slang-compiler.cpp
@@ -940,7 +940,7 @@ namespace Slang
{
builder << ";" << _getDisplayPath(sink, sourceFiles[i]);
}
- return std::move(builder);
+ return builder;
}
}
}
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index f190b3a11..d0dcfd4fb 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -7684,7 +7684,7 @@ namespace Slang
{
StringBuilder sb;
printSlangIRAssembly(sb, module, options, sourceManager);
- return std::move(sb);
+ return sb;
}
void dumpIR(IRModule* module, const IRDumpOptions& options, SourceManager* sourceManager, ISlangWriter* writer)
diff --git a/source/slang/slang-mangle.cpp b/source/slang/slang-mangle.cpp
index 5a0d41f09..93b29ccbe 100644
--- a/source/slang/slang-mangle.cpp
+++ b/source/slang/slang-mangle.cpp
@@ -823,7 +823,7 @@ namespace Slang
builder << "_Sh";
builder.append(uint64_t(hash), 16);
- return std::move(builder);
+ return builder;
}
}
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 48c593889..43f98872d 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -1148,7 +1148,9 @@ SlangResult OptionsParser::_compileReproDirectory(SlangSession* session, EndToEn
{
// Create a fresh request
ComPtr<slang::ICompileRequest> request;
+ SLANG_ALLOW_DEPRECATED_BEGIN
SLANG_RETURN_ON_FAIL(session->createCompileRequest(request.writeRef()));
+ SLANG_ALLOW_DEPRECATED_END
auto requestImpl = asInternal(request);
diff --git a/source/slang/slang-preprocessor.cpp b/source/slang/slang-preprocessor.cpp
index c4a2bd95e..600e28bc5 100644
--- a/source/slang/slang-preprocessor.cpp
+++ b/source/slang/slang-preprocessor.cpp
@@ -3487,7 +3487,7 @@ static String _readDirectiveMessage(PreprocessorDirectiveContext* context)
result.append(token.getContent());
}
- return std::move(result);
+ return result;
}
// Handle a `#warning` directive