summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/compiler-core/slang-command-line-args.cpp2
-rw-r--r--source/compiler-core/slang-diagnostic-sink.cpp8
-rw-r--r--source/compiler-core/slang-lexer.cpp28
-rw-r--r--source/core/slang-command-line.cpp8
-rw-r--r--source/core/slang-hex-dump-util.cpp4
-rw-r--r--source/core/slang-implicit-directory-collector.cpp2
-rw-r--r--source/core/slang-io.cpp23
-rw-r--r--source/core/slang-platform.cpp26
-rw-r--r--source/core/slang-process-util.cpp2
-rw-r--r--source/core/slang-signal.cpp2
-rw-r--r--source/core/slang-string.cpp33
-rw-r--r--source/core/slang-string.h259
-rw-r--r--source/core/slang-text-io.cpp6
-rw-r--r--source/core/slang-token-reader.cpp54
-rw-r--r--source/core/slang-token-reader.h16
-rw-r--r--source/core/slang-writer.cpp2
-rw-r--r--source/slang-rt/slang-rt.cpp2
-rw-r--r--source/slang/slang-ast-dump.cpp2
-rw-r--r--source/slang/slang-ast-print.h2
-rw-r--r--source/slang/slang-check-modifier.cpp2
-rw-r--r--source/slang/slang-check-overload.cpp2
-rw-r--r--source/slang/slang-compiler.cpp4
-rw-r--r--source/slang/slang-doc-markdown-writer.cpp4
-rw-r--r--source/slang/slang-emit-c-like.cpp6
-rw-r--r--source/slang/slang-emit-cpp.cpp2
-rw-r--r--source/slang/slang-emit-source-writer.cpp2
-rw-r--r--source/slang/slang-emit-source-writer.h2
-rw-r--r--source/slang/slang-ir-autodiff.cpp2
-rw-r--r--source/slang/slang-ir-spirv-snippet.cpp2
-rw-r--r--source/slang/slang-ir-util.cpp2
-rw-r--r--source/slang/slang-ir.cpp6
-rw-r--r--source/slang/slang-language-server-auto-format.cpp2
-rw-r--r--source/slang/slang-language-server-completion.cpp12
-rw-r--r--source/slang/slang-language-server-inlay-hints.cpp4
-rw-r--r--source/slang/slang-language-server.cpp22
-rw-r--r--source/slang/slang-lower-to-ir.cpp2
-rw-r--r--source/slang/slang-mangle.cpp12
-rw-r--r--source/slang/slang-mangled-lexer.cpp2
-rw-r--r--source/slang/slang-options.cpp2
-rw-r--r--source/slang/slang-parser.cpp30
-rw-r--r--source/slang/slang-preprocessor.cpp8
-rw-r--r--source/slang/slang-repro.cpp2
-rw-r--r--source/slang/slang-serialize-container.cpp2
-rw-r--r--source/slang/slang-stdlib.cpp6
-rw-r--r--source/slang/slang-workspace-version.cpp2
-rw-r--r--source/slang/slang.cpp10
-rw-r--r--tools/gfx/debug-layer/debug-helper-functions.cpp2
-rw-r--r--tools/render-test/options.cpp2
-rw-r--r--tools/render-test/shader-input-layout.cpp2
-rw-r--r--tools/slang-cpp-extractor/cpp-extractor-main.cpp4
-rw-r--r--tools/slang-cpp-extractor/node.h2
-rw-r--r--tools/slang-embed/slang-embed.cpp2
-rw-r--r--tools/slang-test/options.cpp2
-rw-r--r--tools/slang-test/slang-test-main.cpp80
-rw-r--r--tools/slang-test/test-reporter.cpp14
-rw-r--r--tools/test-process/test-process-main.cpp4
56 files changed, 325 insertions, 424 deletions
diff --git a/source/compiler-core/slang-command-line-args.cpp b/source/compiler-core/slang-command-line-args.cpp
index e34dfdead..813d2dd26 100644
--- a/source/compiler-core/slang-command-line-args.cpp
+++ b/source/compiler-core/slang-command-line-args.cpp
@@ -38,7 +38,7 @@ void CommandLineArgs::setArgs(const char*const* args, size_t argCount)
buf << " ";
}
- SourceFile* sourceFile = sourceManager->createSourceFileWithString(PathInfo::makeUnknown(), buf.ProduceString());
+ SourceFile* sourceFile = sourceManager->createSourceFileWithString(PathInfo::makeUnknown(), buf.produceString());
SourceView* sourceView = sourceManager->createSourceView(sourceFile, nullptr, SourceLoc::fromRaw(0));
SLANG_UNUSED(sourceView);
diff --git a/source/compiler-core/slang-diagnostic-sink.cpp b/source/compiler-core/slang-diagnostic-sink.cpp
index 49aed3000..f360d3cc6 100644
--- a/source/compiler-core/slang-diagnostic-sink.cpp
+++ b/source/compiler-core/slang-diagnostic-sink.cpp
@@ -88,7 +88,7 @@ static void formatDiagnosticMessage(StringBuilder& sb, char const* format, int a
spanEnd++;
}
- sb.Append(spanBegin, int(spanEnd - spanBegin));
+ sb.append(spanBegin, int(spanEnd - spanBegin));
if (!*spanEnd)
return;
@@ -99,7 +99,7 @@ static void formatDiagnosticMessage(StringBuilder& sb, char const* format, int a
{
// A double dollar sign `$$` is used to emit a single `$`
case '$':
- sb.Append('$');
+ sb.append('$');
break;
// A single digit means to emit the corresponding argument.
@@ -436,7 +436,7 @@ static void formatDiagnostic(
// Set up the diagnostic.
Diagnostic initiationDiagnostic;
initiationDiagnostic.ErrorID = diagnosticInfo.id;
- initiationDiagnostic.Message = msg.ProduceString();
+ initiationDiagnostic.Message = msg.produceString();
initiationDiagnostic.loc = sourceView->getInitiatingSourceLoc();
initiationDiagnostic.severity = diagnosticInfo.severity;
@@ -615,7 +615,7 @@ void DiagnosticSink::diagnoseImpl(SourceLoc const& pos, DiagnosticInfo info, int
Diagnostic diagnostic;
diagnostic.ErrorID = info.id;
- diagnostic.Message = sb.ProduceString();
+ diagnostic.Message = sb.produceString();
diagnostic.loc = pos;
diagnostic.severity = info.severity;
diff --git a/source/compiler-core/slang-lexer.cpp b/source/compiler-core/slang-lexer.cpp
index a9d20471a..7bb9aa84d 100644
--- a/source/compiler-core/slang-lexer.cpp
+++ b/source/compiler-core/slang-lexer.cpp
@@ -878,14 +878,14 @@ namespace Slang
if(c == quote)
{
SLANG_ASSERT(cursor == end);
- return valueBuilder.ProduceString();
+ return valueBuilder.produceString();
}
// Characters that don't being escape sequences are easy;
// just append them to the buffer and move on.
if(c != '\\')
{
- valueBuilder.Append(c);
+ valueBuilder.append(c);
continue;
}
@@ -901,19 +901,19 @@ namespace Slang
case '\"':
case '\\':
case '?':
- valueBuilder.Append(d);
+ valueBuilder.append(d);
continue;
// Traditional escape sequences for special characters
- case 'a': valueBuilder.Append('\a'); continue;
- case 'b': valueBuilder.Append('\b'); continue;
- case 'f': valueBuilder.Append('\f'); continue;
- case 'n': valueBuilder.Append('\n'); continue;
- case 'r': valueBuilder.Append('\r'); continue;
- case 't': valueBuilder.Append('\t'); continue;
- case 'v': valueBuilder.Append('\v'); continue;
-
- // Octal escape: up to 3 characterws
+ case 'a': valueBuilder.append('\a'); continue;
+ case 'b': valueBuilder.append('\b'); continue;
+ case 'f': valueBuilder.append('\f'); continue;
+ case 'n': valueBuilder.append('\n'); continue;
+ case 'r': valueBuilder.append('\r'); continue;
+ case 't': valueBuilder.append('\t'); continue;
+ case 'v': valueBuilder.append('\v'); continue;
+
+ // Octal escape: up to 3 characters
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7':
{
@@ -936,7 +936,7 @@ namespace Slang
}
// TODO: add support for appending an arbitrary code point?
- valueBuilder.Append((char) value);
+ valueBuilder.append((char) value);
}
continue;
@@ -970,7 +970,7 @@ namespace Slang
}
// TODO: add support for appending an arbitrary code point?
- valueBuilder.Append((char) value);
+ valueBuilder.append((char) value);
}
continue;
diff --git a/source/core/slang-command-line.cpp b/source/core/slang-command-line.cpp
index 59e6a6265..475270d69 100644
--- a/source/core/slang-command-line.cpp
+++ b/source/core/slang-command-line.cpp
@@ -43,7 +43,7 @@ void ExecutableLocation::set(const String& nameOrPath)
StringBuilder builder;
builder << nameOrPath;
builder << suffix;
- setPath(builder.ProduceString());
+ setPath(builder.produceString());
}
}
else
@@ -86,7 +86,7 @@ void CommandLine::addPrefixPathArg(const char* prefix, const String& path, const
// Work out the path with the postfix
builder << pathPostfix;
}
- addArg(builder.ProduceString());
+ addArg(builder.produceString());
}
void CommandLine::append(StringBuilder& out) const
@@ -128,14 +128,14 @@ String CommandLine::toString() const
{
StringBuilder buf;
append(buf);
- return buf.ProduceString();
+ return buf.produceString();
}
String CommandLine::toStringArgs() const
{
StringBuilder buf;
appendArgs(buf);
- return buf.ProduceString();
+ return buf.produceString();
}
} // namespace Slang
diff --git a/source/core/slang-hex-dump-util.cpp b/source/core/slang-hex-dump-util.cpp
index 1279dc237..bbee0a199 100644
--- a/source/core/slang-hex-dump-util.cpp
+++ b/source/core/slang-hex-dump-util.cpp
@@ -227,8 +227,8 @@ static SlangResult _findLine(const UnownedStringSlice& find, UnownedStringSlice&
return SLANG_FAIL;
}
// Extract the size
- size = StringToInt(String(slices[1]));
- hash = HashCode32(StringToInt(String(slices[2])));
+ size = stringToInt(String(slices[1]));
+ hash = HashCode32(stringToInt(String(slices[2])));
}
SLANG_RETURN_ON_FAIL(parse(UnownedStringSlice(startLine.end(), endLine.begin()), outBytes));
diff --git a/source/core/slang-implicit-directory-collector.cpp b/source/core/slang-implicit-directory-collector.cpp
index 169deeb30..d116ed8f9 100644
--- a/source/core/slang-implicit-directory-collector.cpp
+++ b/source/core/slang-implicit-directory-collector.cpp
@@ -15,7 +15,7 @@ ImplicitDirectoryCollector::ImplicitDirectoryCollector(const String& canonicalPa
StringBuilder buffer;
buffer << canonicalPath;
buffer.append('/');
- m_prefix = buffer.ProduceString();
+ m_prefix = buffer.produceString();
}
}
diff --git a/source/core/slang-io.cpp b/source/core/slang-io.cpp
index 50e98c60c..52187bd47 100644
--- a/source/core/slang-io.cpp
+++ b/source/core/slang-io.cpp
@@ -189,10 +189,10 @@ namespace Slang
if (dotPos < 0)
dotPos = path.getLength();
- sb.Append(path.getBuffer(), dotPos);
- sb.Append('.');
- sb.Append(newExt);
- return sb.ProduceString();
+ sb.append(path.getBuffer(), dotPos);
+ sb.append('.');
+ sb.append(newExt);
+ return sb.produceString();
}
/* static */ Index Path::findLastSeparatorIndex(UnownedStringSlice const& path)
@@ -325,7 +325,7 @@ namespace Slang
/* static */void Path::combineIntoBuilder(const UnownedStringSlice& path1, const UnownedStringSlice& path2, StringBuilder& outBuilder)
{
outBuilder.clear();
- outBuilder.Append(path1);
+ outBuilder.append(path1);
append(outBuilder, path2);
}
@@ -338,7 +338,7 @@ namespace Slang
StringBuilder sb;
combineIntoBuilder(path1.getUnownedSlice(), path2.getUnownedSlice(), sb);
- return sb.ProduceString();
+ return sb.produceString();
}
String Path::combine(const String& path1, const String& path2, const String& path3)
{
@@ -346,7 +346,7 @@ namespace Slang
sb.append(path1);
append(sb, path2.getUnownedSlice());
append(sb, path3.getUnownedSlice());
- return sb.ProduceString();
+ return sb.produceString();
}
/* static */ bool Path::isDriveSpecification(const UnownedStringSlice& element)
@@ -546,7 +546,7 @@ namespace Slang
// Reconstruct the string
StringBuilder builder;
join(splitPath.getBuffer(), splitPath.getCount(), builder);
- return builder.ToString();
+ return builder.toString();
}
bool Path::createDirectory(const String& path)
@@ -1059,7 +1059,7 @@ namespace Slang
i++;
}
}
- return sb.ProduceString();
+ return sb.produceString();
}
StringSlice URI::getProtocol() const
@@ -1099,9 +1099,8 @@ namespace Slang
else
{
char buffer[32];
- int length = IntToAscii(buffer, (int)ch, 16);
- ReverseInternalAscii(buffer, length);
- sb << "%" << buffer;
+ int length = intToAscii(buffer, (int)ch, 16);
+ sb << "%" << UnownedStringSlice(buffer, length);
}
}
return URI::fromString(sb.getUnownedSlice());
diff --git a/source/core/slang-platform.cpp b/source/core/slang-platform.cpp
index f28a25f7f..e5af0ba7e 100644
--- a/source/core/slang-platform.cpp
+++ b/source/core/slang-platform.cpp
@@ -49,7 +49,7 @@ namespace Slang
{
StringBuilder builder;
calcPlatformPath(path, builder);
- return builder.ToString();
+ return builder.toString();
}
#ifdef _WIN32
@@ -92,7 +92,7 @@ SLANG_COMPILE_TIME_ASSERT(E_OUTOFMEMORY == SLANG_E_OUT_OF_MEMORY);
{
builderOut << " ";
// Convert to string
- builderOut.Append(String::fromWString(buffer));
+ builderOut.append(String::fromWString(buffer));
LocalFree(buffer);
return SLANG_OK;
}
@@ -152,8 +152,8 @@ SLANG_COMPILE_TIME_ASSERT(E_OUTOFMEMORY == SLANG_E_OUT_OF_MEMORY);
/* static */void SharedLibrary::appendPlatformFileName(const UnownedStringSlice& name, StringBuilder& dst)
{
- dst.Append(name);
- dst.Append(".dll");
+ dst.append(name);
+ dst.append(".dll");
}
#else // _WIN32
@@ -221,21 +221,21 @@ SLANG_COMPILE_TIME_ASSERT(E_OUTOFMEMORY == SLANG_E_OUT_OF_MEMORY);
/* static */void SharedLibrary::appendPlatformFileName(const UnownedStringSlice& name, StringBuilder& dst)
{
#if __CYGWIN__
- dst.Append(name);
- dst.Append(".dll");
+ dst.append(name);
+ dst.append(".dll");
#elif SLANG_APPLE_FAMILY
- dst.Append("lib");
- dst.Append(name);
- dst.Append(".dylib");
+ dst.append("lib");
+ dst.append(name);
+ dst.append(".dylib");
#elif SLANG_LINUX_FAMILY
if (!name.startsWith("lib"))
- dst.Append("lib");
- dst.Append(name);
+ dst.append("lib");
+ dst.append(name);
if (name.indexOf(UnownedStringSlice(".so.")) == -1)
- dst.Append(".so");
+ dst.append(".so");
#else
// Just guess we can do with the name on it's own
- dst.Append(name);
+ dst.append(name);
#endif
}
diff --git a/source/core/slang-process-util.cpp b/source/core/slang-process-util.cpp
index 1a160b00b..ef22c0392 100644
--- a/source/core/slang-process-util.cpp
+++ b/source/core/slang-process-util.cpp
@@ -28,7 +28,7 @@ static String _getText(const ConstArrayView<Byte>& bytes)
{
StringBuilder buf;
StringUtil::appendStandardLines(UnownedStringSlice((const char*)bytes.begin(), (const char*)bytes.end()), buf);
- return buf.ProduceString();
+ return buf.produceString();
}
/* static */SlangResult ProcessUtil::readUntilTermination(Process* process, ExecuteResult& outExecuteResult)
diff --git a/source/core/slang-signal.cpp b/source/core/slang-signal.cpp
index 9641fe5f7..cdf2a1179 100644
--- a/source/core/slang-signal.cpp
+++ b/source/core/slang-signal.cpp
@@ -31,7 +31,7 @@ String _getMessage(SignalType type, char const* message)
buf << ": " << message;
}
- return buf.ProduceString();
+ return buf.produceString();
}
// One point of having as a single function is a choke point both for handling (allowing different
diff --git a/source/core/slang-string.cpp b/source/core/slang-string.cpp
index dc3c3ed46..0cb034604 100644
--- a/source/core/slang-string.cpp
+++ b/source/core/slang-string.cpp
@@ -261,25 +261,25 @@ namespace Slang
return result;
}
- int StringToInt(const String & str, int radix)
+ int stringToInt(const String& str, int radix)
{
if (str.startsWith("0x"))
return (int)strtoll(str.getBuffer(), NULL, 16);
else
return (int)strtoll(str.getBuffer(), NULL, radix);
}
- unsigned int StringToUInt(const String & str, int radix)
+ unsigned int stringToUInt(const String& str, int radix)
{
if (str.startsWith("0x"))
return (unsigned int)strtoull(str.getBuffer(), NULL, 16);
else
return (unsigned int)strtoull(str.getBuffer(), NULL, radix);
}
- double StringToDouble(const String & str)
+ double stringToDouble(const String& str)
{
return (double)strtod(str.getBuffer(), NULL);
}
- float StringToFloat(const String & str)
+ float stringToFloat(const String& str)
{
return strtof(str.getBuffer(), NULL);
}
@@ -300,7 +300,7 @@ namespace Slang
}
#endif
- String String::fromWString(const wchar_t * wstr)
+ String String::fromWString(const wchar_t* wstr)
{
List<char> buf;
#ifdef _WIN32
@@ -311,7 +311,7 @@ namespace Slang
return String(buf.begin(), buf.end());
}
- String String::fromWString(const wchar_t * wstr, const wchar_t * wend)
+ String String::fromWString(const wchar_t* wstr, const wchar_t* wend)
{
List<char> buf;
#ifdef _WIN32
@@ -481,6 +481,11 @@ namespace Slang
}
}
+ void String::append(char const* str, size_t len)
+ {
+ append(str, str + len);
+ }
+
void String::append(const char* textBegin, char const* textEnd)
{
auto oldLength = getLength();
@@ -563,8 +568,7 @@ namespace Slang
{
enum { kCount = 33 };
char* data = prepareForAppend(kCount);
- auto count = IntToAscii(data, value, radix);
- ReverseInternalAscii(data, count);
+ const auto count = intToAscii(data, value, radix);
m_buffer->length += count;
}
@@ -572,8 +576,7 @@ namespace Slang
{
enum { kCount = 33 };
char* data = prepareForAppend(kCount);
- auto count = IntToAscii(data, value, radix);
- ReverseInternalAscii(data, count);
+ const auto count = intToAscii(data, value, radix);
m_buffer->length += count;
}
@@ -581,8 +584,7 @@ namespace Slang
{
enum { kCount = 65 };
char* data = prepareForAppend(kCount);
- auto count = IntToAscii(data, value, radix);
- ReverseInternalAscii(data, count);
+ auto count = intToAscii(data, value, radix);
m_buffer->length += count;
}
@@ -590,12 +592,11 @@ namespace Slang
{
enum { kCount = 65 };
char* data = prepareForAppend(kCount);
- auto count = IntToAscii(data, value, radix);
- ReverseInternalAscii(data, count);
+ auto count = intToAscii(data, value, radix);
m_buffer->length += count;
}
- void String::append(float val, const char * format)
+ void String::append(float val, const char* format)
{
enum { kCount = 128 };
char* data = prepareForAppend(kCount);
@@ -603,7 +604,7 @@ namespace Slang
m_buffer->length += strnlen_s(data, kCount);
}
- void String::append(double val, const char * format)
+ void String::append(double val, const char* format)
{
enum { kCount = 128 };
char* data = prepareForAppend(kCount);
diff --git a/source/core/slang-string.h b/source/core/slang-string.h
index 533d30827..4c78cc32e 100644
--- a/source/core/slang-string.h
+++ b/source/core/slang-string.h
@@ -20,7 +20,7 @@ namespace Slang
extern _EndLine EndLine;
// in-place reversion, works only for ascii string
- inline void ReverseInternalAscii(char * buffer, int length)
+ inline void reverseInplaceAscii(char* buffer, int length)
{
int i, j;
char c;
@@ -32,13 +32,17 @@ namespace Slang
}
}
template<typename IntType>
- inline int IntToAscii(char * buffer, IntType val, int radix)
+ inline int intToAscii(char* buffer, IntType val, int radix)
{
int i = 0;
IntType sign;
+
sign = val;
if (sign < 0)
+ {
val = (IntType)(0 - val);
+ }
+
do
{
int digit = (val % radix);
@@ -47,18 +51,23 @@ namespace Slang
else
buffer[i++] = (char)(digit - 10 + 'A');
} while ((val /= radix) > 0);
+
if (sign < 0)
buffer[i++] = '-';
+
+ // Put in normal character order
+ reverseInplaceAscii(buffer, i);
+
buffer[i] = '\0';
return i;
}
- inline bool IsUtf8LeadingByte(char ch)
+ SLANG_FORCE_INLINE bool isUtf8LeadingByte(char ch)
{
return (((unsigned char)ch) & 0xC0) == 0xC0;
}
- inline bool IsUtf8ContinuationByte(char ch)
+ SLANG_FORCE_INLINE bool isUtf8ContinuationByte(char ch)
{
return (((unsigned char)ch) & 0xC0) == 0x80;
}
@@ -451,10 +460,11 @@ namespace Slang
: m_buffer(buffer)
{}
- static String fromWString(const wchar_t * wstr);
- static String fromWString(const wchar_t * wstr, const wchar_t * wend);
+ static String fromWString(const wchar_t* wstr);
+ static String fromWString(const wchar_t* wstr, const wchar_t* wend);
static String fromWChar(const wchar_t ch);
static String fromUnicodePoint(Char32 codePoint);
+
String()
{
}
@@ -466,11 +476,11 @@ namespace Slang
SLANG_FORCE_INLINE StringRepresentation* getStringRepresentation() const { return m_buffer; }
- const char * begin() const
+ const char* begin() const
{
return getData();
}
- const char * end() const
+ const char* end() const
{
return getData() + getLength();
}
@@ -479,10 +489,11 @@ namespace Slang
void append(uint32_t value, int radix = 10);
void append(int64_t value, int radix = 10);
void append(uint64_t value, int radix = 10);
- void append(float val, const char * format = "%g");
- void append(double val, const char * format = "%g");
+ void append(float val, const char* format = "%g");
+ void append(double val, const char* format = "%g");
void append(char const* str);
+ void append(char const* str, size_t len);
void append(const char* textBegin, char const* textEnd);
void append(char chr);
void append(String const& str);
@@ -498,25 +509,11 @@ namespace Slang
String(const char* str)
{
append(str);
-#if 0
- if (str)
- {
- buffer = StringRepresentation::createWithLength(strlen(str));
- memcpy(buffer.Ptr(), str, getLength() + 1);
- }
-#endif
+
}
String(const char* textBegin, char const* textEnd)
{
append(textBegin, textEnd);
-#if 0
- if (textBegin != textEnd)
- {
- buffer = StringRepresentation::createWithLength(textEnd - textBegin);
- memcpy(buffer.Ptr(), textBegin, getLength());
- buffer->getData()[getLength()] = 0;
- }
-#endif
}
// Make all String ctors from a numeric explicit, to avoid unexpected/unnecessary conversions
@@ -536,33 +533,22 @@ namespace Slang
{
append(val, radix);
}
- explicit String(float val, const char * format = "%g")
+ explicit String(float val, const char* format = "%g")
{
append(val, format);
}
- explicit String(double val, const char * format = "%g")
+ explicit String(double val, const char* format = "%g")
{
append(val, format);
}
explicit String(char chr)
{
- append(chr);
-#if 0
- if (chr)
- {
- buffer = StringRepresentation::createWithLength(1);
- buffer->getData()[0] = chr;
- buffer->getData()[1] = 0;
- }
-#endif
+ appendChar(chr);
}
String(String const& str)
{
m_buffer = str.m_buffer;
-#if 0
- this->operator=(str);
-#endif
}
String(String&& other)
{
@@ -584,12 +570,12 @@ namespace Slang
m_buffer.setNull();
}
- String & operator=(const String & str)
+ String& operator=(const String& str)
{
m_buffer = str.m_buffer;
return *this;
}
- String & operator=(String&& other)
+ String& operator=(String&& other)
{
m_buffer = _Move(other.m_buffer);
return *this;
@@ -678,7 +664,7 @@ namespace Slang
OSString toWString(Index* len = 0) const;
- bool equals(const String & str, bool caseSensitive = true)
+ bool equals(const String& str, bool caseSensitive = true)
{
if (caseSensitive)
return (strcmp(begin(), str.begin()) == 0);
@@ -691,36 +677,36 @@ namespace Slang
#endif
}
}
- bool operator==(const char * strbuffer) const
+ bool operator==(const char* strbuffer) const
{
return (strcmp(begin(), strbuffer) == 0);
}
- bool operator==(const String & str) const
+ bool operator==(const String& str) const
{
return (strcmp(begin(), str.begin()) == 0);
}
- bool operator!=(const char * strbuffer) const
+ bool operator!=(const char* strbuffer) const
{
return (strcmp(begin(), strbuffer) != 0);
}
- bool operator!=(const String & str) const
+ bool operator!=(const String& str) const
{
return (strcmp(begin(), str.begin()) != 0);
}
- bool operator>(const String & str) const
+ bool operator>(const String& str) const
{
return (strcmp(begin(), str.begin()) > 0);
}
- bool operator<(const String & str) const
+ bool operator<(const String& str) const
{
return (strcmp(begin(), str.begin()) < 0);
}
- bool operator>=(const String & str) const
+ bool operator>=(const String& str) const
{
return (strcmp(begin(), str.begin()) >= 0);
}
- bool operator<=(const String & str) const
+ bool operator<=(const String& str) const
{
return (strcmp(begin(), str.begin()) <= 0);
}
@@ -750,7 +736,7 @@ namespace Slang
return result;
}
- Index indexOf(const char * str, Index id) const // String str
+ Index indexOf(const char* str, Index id) const // String str
{
if (id >= getLength())
return Index(-1);
@@ -759,17 +745,17 @@ namespace Slang
return res;
}
- Index indexOf(const String & str, Index id) const
+ Index indexOf(const String& str, Index id) const
{
return indexOf(str.begin(), id);
}
- Index indexOf(const char * str) const
+ Index indexOf(const char* str) const
{
return indexOf(str, 0);
}
- Index indexOf(const String & str) const
+ Index indexOf(const String& str) const
{
return indexOf(str.begin(), 0);
}
@@ -804,15 +790,13 @@ namespace Slang
const Index length = getLength();
const char* data = getData();
- // TODO(JS): If we know Index is signed we can do this a bit more simply
-
- for (Index i = length; i > 0; i--)
- if (data[i - 1] == ch)
- return i - 1;
+ for (Index i = length - 1; i >= 0; --i)
+ if (data[i] == ch)
+ return i;
return Index(-1);
}
- bool startsWith(const char * str) const // String str
+ bool startsWith(const char* str) const
{
if (!m_buffer)
return false;
@@ -833,7 +817,7 @@ namespace Slang
return startsWith(str.begin());
}
- bool endsWith(char const * str) const // String str
+ bool endsWith(char const* str) const // String str
{
if (!m_buffer)
return false;
@@ -850,17 +834,17 @@ namespace Slang
return true;
}
- bool endsWith(const String & str) const
+ bool endsWith(const String& str) const
{
return endsWith(str.begin());
}
- bool contains(const char * str) const // String str
+ bool contains(const char* str) const // String str
{
return m_buffer && indexOf(str) != Index(-1);
}
- bool contains(const String & str) const
+ bool contains(const String& str) const
{
return contains(str.begin());
}
@@ -881,168 +865,85 @@ namespace Slang
private:
enum { InitialSize = 1024 };
public:
+ typedef String Super;
+ using Super::append;
+
explicit StringBuilder(UInt bufferSize = InitialSize)
{
ensureUniqueStorageWithCapacity(bufferSize);
}
- void EnsureCapacity(UInt size)
+
+ void ensureCapacity(UInt size)
{
ensureUniqueStorageWithCapacity(size);
}
- StringBuilder & operator << (char ch)
+ StringBuilder& operator << (char ch)
{
- Append(&ch, 1);
+ appendChar(ch);
return *this;
}
- StringBuilder & operator << (Int32 val)
+ StringBuilder& operator << (Int32 val)
{
- Append(val);
+ append(val);
return *this;
}
- StringBuilder & operator << (UInt32 val)
+ StringBuilder& operator << (UInt32 val)
{
- Append(val);
+ append(val);
return *this;
}
- StringBuilder & operator << (Int64 val)
+ StringBuilder& operator << (Int64 val)
{
- Append(val);
+ append(val);
return *this;
}
- StringBuilder & operator << (UInt64 val)
+ StringBuilder& operator << (UInt64 val)
{
- Append(val);
+ append(val);
return *this;
}
- StringBuilder & operator << (float val)
+ StringBuilder& operator << (float val)
{
- Append(val);
+ append(val);
return *this;
}
- StringBuilder & operator << (double val)
+ StringBuilder& operator << (double val)
{
- Append(val);
+ append(val);
return *this;
}
- StringBuilder & operator << (const char * str)
+ StringBuilder& operator << (const char* str)
{
- Append(str, strlen(str));
+ append(str, strlen(str));
return *this;
}
- StringBuilder & operator << (const String & str)
+ StringBuilder& operator << (const String& str)
{
- Append(str);
+ append(str);
return *this;
}
- StringBuilder & operator << (UnownedStringSlice const& str)
+ StringBuilder& operator << (UnownedStringSlice const& str)
{
append(str);
return *this;
}
- StringBuilder & operator << (const _EndLine)
+ StringBuilder& operator << (const _EndLine)
{
- Append('\n');
+ appendChar('\n');
return *this;
}
- void Append(char ch)
- {
- Append(&ch, 1);
- }
- void Append(float val)
- {
- char buf[128];
- sprintf_s(buf, 128, "%g", val);
- int len = (int)strnlen_s(buf, 128);
- Append(buf, len);
- }
- void Append(double val)
- {
- char buf[128];
- sprintf_s(buf, 128, "%g", val);
- int len = (int)strnlen_s(buf, 128);
- Append(buf, len);
- }
- void Append(Int32 value, int radix = 10)
- {
- char vBuffer[33];
- int len = IntToAscii(vBuffer, value, radix);
- ReverseInternalAscii(vBuffer, len);
- Append(vBuffer);
- }
- void Append(UInt32 value, int radix = 10)
- {
- char vBuffer[33];
- int len = IntToAscii(vBuffer, value, radix);
- ReverseInternalAscii(vBuffer, len);
- Append(vBuffer);
- }
- void Append(Int64 value, int radix = 10)
- {
- char vBuffer[65];
- int len = IntToAscii(vBuffer, value, radix);
- ReverseInternalAscii(vBuffer, len);
- Append(vBuffer);
- }
- void Append(UInt64 value, int radix = 10)
- {
- char vBuffer[65];
- int len = IntToAscii(vBuffer, value, radix);
- ReverseInternalAscii(vBuffer, len);
- Append(vBuffer);
- }
- void Append(const String & str)
- {
- Append(str.getBuffer(), str.getLength());
- }
- void Append(const char * str)
- {
- Append(str, strlen(str));
- }
- void Append(const char * str, UInt strLen)
- {
- append(str, str + strLen);
- }
-#if 0
- int Capacity()
- {
- return bufferSize;
- }
-
- char * Buffer()
- {
- return buffer;
- }
-
- int Length()
- {
- return length;
- }
-#endif
-
- String ToString()
+ String toString()
{
return *this;
}
- String ProduceString()
+ String produceString()
{
return *this;
}
#if 0
- String GetSubString(int start, int count)
- {
- String rs;
- rs.buffer = new char[count + 1];
- rs.length = count;
- strncpy_s(rs.buffer.Ptr(), count + 1, buffer + start, count);
- rs.buffer[count] = 0;
- return rs;
- }
-#endif
-
-#if 0
void Remove(int id, int len)
{
#if _DEBUG
@@ -1065,10 +966,10 @@ namespace Slang
}
};
- int StringToInt(const String & str, int radix = 10);
- unsigned int StringToUInt(const String & str, int radix = 10);
- double StringToDouble(const String & str);
- float StringToFloat(const String & str);
+ int stringToInt(const String& str, int radix = 10);
+ unsigned int stringToUInt(const String& str, int radix = 10);
+ double stringToDouble(const String& str);
+ float stringToFloat(const String& str);
}
std::ostream& operator<< (std::ostream& stream, const Slang::String& s);
diff --git a/source/core/slang-text-io.cpp b/source/core/slang-text-io.cpp
index 3f5d739d9..327ef55de 100644
--- a/source/core/slang-text-io.cpp
+++ b/source/core/slang-text-io.cpp
@@ -148,15 +148,15 @@ SlangResult StreamReader::readToEnd(String& outString)
break;
if (ch == '\r')
{
- sb.Append('\n');
+ sb.append('\n');
if (peek() == '\n')
read();
}
else
- sb.Append(ch);
+ sb.append(ch);
}
- outString = sb.ProduceString();
+ outString = sb.produceString();
return SLANG_OK;
}
diff --git a/source/core/slang-token-reader.cpp b/source/core/slang-token-reader.cpp
index be2461796..f6f29def3 100644
--- a/source/core/slang-token-reader.cpp
+++ b/source/core/slang-token-reader.cpp
@@ -336,7 +336,7 @@ namespace Misc {
auto InsertToken = [&](TokenType type)
{
derivative = LexDerivative::None;
- tokenList.add(Token(type, tokenBuilder.ToString(), tokenLine, tokenCol, int(pos), file, tokenFlags));
+ tokenList.add(Token(type, tokenBuilder.toString(), tokenLine, tokenCol, int(pos), file, tokenFlags));
tokenFlags = 0;
tokenBuilder.clear();
};
@@ -347,22 +347,22 @@ namespace Misc {
case '\\':
case '\"':
case '\'':
- tokenBuilder.Append(nextChar);
+ tokenBuilder.append(nextChar);
break;
case 't':
- tokenBuilder.Append('\t');
+ tokenBuilder.append('\t');
break;
case 's':
- tokenBuilder.Append(' ');
+ tokenBuilder.append(' ');
break;
case 'n':
- tokenBuilder.Append('\n');
+ tokenBuilder.append('\n');
break;
case 'r':
- tokenBuilder.Append('\r');
+ tokenBuilder.append('\r');
break;
case 'b':
- tokenBuilder.Append('\b');
+ tokenBuilder.append('\b');
break;
}
};
@@ -433,7 +433,7 @@ namespace Misc {
}
else if (curChar == '.' && IsDigit(nextChar))
{
- tokenBuilder.Append("0.");
+ tokenBuilder.append("0.");
state = State::Fixed;
pos++;
}
@@ -451,12 +451,12 @@ namespace Misc {
case State::Identifier:
if (IsLetter(curChar) || IsDigit(curChar))
{
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
pos++;
}
else
{
- auto tokenStr = tokenBuilder.ToString();
+ auto tokenStr = tokenBuilder.toString();
#if 0
if (tokenStr == "#line_reset#")
{
@@ -485,13 +485,13 @@ namespace Misc {
case State::Operator:
if (IsPunctuation(curChar) && !((curChar == '/' && nextChar == '/') || (curChar == '/' && nextChar == '*')))
{
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
pos++;
}
else
{
//do token analyze
- ParseOperators(tokenBuilder.ToString(), tokenList, tokenFlags, tokenLine, tokenCol, (int)(pos - tokenBuilder.getLength()), file);
+ ParseOperators(tokenBuilder.toString(), tokenList, tokenFlags, tokenLine, tokenCol, (int)(pos - tokenBuilder.getLength()), file);
tokenBuilder.clear();
state = State::Start;
}
@@ -499,22 +499,22 @@ namespace Misc {
case State::Int:
if (IsDigit(curChar))
{
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
pos++;
}
else if (curChar == '.')
{
state = State::Fixed;
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
pos++;
}
else if (curChar == 'e' || curChar == 'E')
{
state = State::Double;
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
if (nextChar == '-' || nextChar == '+')
{
- tokenBuilder.Append(nextChar);
+ tokenBuilder.append(nextChar);
pos++;
}
pos++;
@@ -522,13 +522,13 @@ namespace Misc {
else if (curChar == 'x')
{
state = State::Hex;
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
pos++;
}
else if (curChar == 'u')
{
pos++;
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
InsertToken(TokenType::IntLiteral);
state = State::Start;
}
@@ -537,7 +537,7 @@ namespace Misc {
if (derivative == LexDerivative::Line)
{
derivative = LexDerivative::None;
- line = StringToInt(tokenBuilder.ToString()) - 1;
+ line = stringToInt(tokenBuilder.toString()) - 1;
col = 0;
tokenBuilder.clear();
}
@@ -551,7 +551,7 @@ namespace Misc {
case State::Hex:
if (IsDigit(curChar) || (curChar >= 'a' && curChar <= 'f') || (curChar >= 'A' && curChar <= 'F'))
{
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
pos++;
}
else
@@ -563,16 +563,16 @@ namespace Misc {
case State::Fixed:
if (IsDigit(curChar))
{
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
pos++;
}
else if (curChar == 'e' || curChar == 'E')
{
state = State::Double;
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
if (nextChar == '-' || nextChar == '+')
{
- tokenBuilder.Append(nextChar);
+ tokenBuilder.append(nextChar);
pos++;
}
pos++;
@@ -588,7 +588,7 @@ namespace Misc {
case State::Double:
if (IsDigit(curChar))
{
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
pos++;
}
else
@@ -608,14 +608,14 @@ namespace Misc {
pos++;
}
else
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
}
else
{
if (derivative == LexDerivative::File)
{
derivative = LexDerivative::None;
- file = tokenBuilder.ToString();
+ file = tokenBuilder.toString();
tokenBuilder.clear();
}
else
@@ -635,7 +635,7 @@ namespace Misc {
pos++;
}
else
- tokenBuilder.Append(curChar);
+ tokenBuilder.append(curChar);
}
else
{
diff --git a/source/core/slang-token-reader.h b/source/core/slang-token-reader.h
index 4f0f9791a..264693c81 100644
--- a/source/core/slang-token-reader.h
+++ b/source/core/slang-token-reader.h
@@ -39,7 +39,7 @@ namespace Misc {
sb << FileName;
if (Line != -1)
sb << "(" << Line << ")";
- return sb.ProduceString();
+ return sb.produceString();
}
CodePosition() = default;
CodePosition(int line, int col, int pos, String fileName)
@@ -112,9 +112,9 @@ namespace Misc {
if (token.Type == TokenType::IntLiteral)
{
if (neg)
- return -StringToInt(token.Content);
+ return -stringToInt(token.Content);
else
- return StringToInt(token.Content);
+ return stringToInt(token.Content);
}
throw TextFormatException("Text parsing error: int expected.");
}
@@ -123,7 +123,7 @@ namespace Misc {
auto token = ReadToken();
if (token.Type == TokenType::IntLiteral)
{
- return StringToUInt(token.Content);
+ return stringToUInt(token.Content);
}
throw TextFormatException("Text parsing error: int expected.");
}
@@ -139,9 +139,9 @@ namespace Misc {
if (token.Type == TokenType::DoubleLiteral || token.Type == TokenType::IntLiteral)
{
if (neg)
- return -StringToDouble(token.Content);
+ return -stringToDouble(token.Content);
else
- return StringToDouble(token.Content);
+ return stringToDouble(token.Content);
}
throw TextFormatException("Text parsing error: floating point value expected.");
}
@@ -281,7 +281,7 @@ namespace Misc {
{
if (text[i] == c)
{
- auto str = sb.ToString();
+ auto str = sb.toString();
if (str.getLength() != 0)
result.add(str);
sb.clear();
@@ -289,7 +289,7 @@ namespace Misc {
else
sb << text[i];
}
- auto lastStr = sb.ToString();
+ auto lastStr = sb.toString();
if (lastStr.getLength())
result.add(lastStr);
return result;
diff --git a/source/core/slang-writer.cpp b/source/core/slang-writer.cpp
index 2b00b5853..74a39f871 100644
--- a/source/core/slang-writer.cpp
+++ b/source/core/slang-writer.cpp
@@ -210,7 +210,7 @@ SlangResult StringWriter::write(const char* chars, size_t numChars)
{
if (numChars > 0)
{
- m_builder->Append(chars, numChars);
+ m_builder->append(chars, numChars);
}
return SLANG_OK;
}
diff --git a/source/slang-rt/slang-rt.cpp b/source/slang-rt/slang-rt.cpp
index 9a2041b86..11b4ea773 100644
--- a/source/slang-rt/slang-rt.cpp
+++ b/source/slang-rt/slang-rt.cpp
@@ -49,7 +49,7 @@ extern "C"
// If failed, try stdcall mangled name.
StringBuilder sb;
sb << "_" << funcName << "@" << argSize;
- funcPtr = lib->findFuncByName(sb.ToString().getBuffer());
+ funcPtr = lib->findFuncByName(sb.toString().getBuffer());
}
if (!funcPtr)
{
diff --git a/source/slang/slang-ast-dump.cpp b/source/slang/slang-ast-dump.cpp
index 242d67017..2c98af65c 100644
--- a/source/slang/slang-ast-dump.cpp
+++ b/source/slang/slang-ast-dump.cpp
@@ -434,7 +434,7 @@ struct ASTDumpContext
{
StringBuilder sb;
sb << declRef;
- m_writer->emit(sb.ToString());
+ m_writer->emit(sb.toString());
}
void dump(const DeclCheckStateExt& extState)
diff --git a/source/slang/slang-ast-print.h b/source/slang/slang-ast-print.h
index b7c9df3ba..1b61a8904 100644
--- a/source/slang/slang-ast-print.h
+++ b/source/slang/slang-ast-print.h
@@ -103,7 +103,7 @@ public:
void reset() { m_builder.clear(); }
/// Get the current string
- String getString() { return m_builder.ProduceString(); }
+ String getString() { return m_builder.produceString(); }
/// Get contents as a slice
UnownedStringSlice getSlice() const { return m_builder.getUnownedSlice(); }
diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp
index e5627850b..e9c78e155 100644
--- a/source/slang/slang-check-modifier.cpp
+++ b/source/slang/slang-check-modifier.cpp
@@ -697,7 +697,7 @@ namespace Slang
return false;
}
}
- comInterfaceAttr->guid = resultGUID.ToString();
+ comInterfaceAttr->guid = resultGUID.toString();
if (comInterfaceAttr->guid.getLength() != 32)
{
getSink()->diagnose(attr, Diagnostics::invalidGUID, guid);
diff --git a/source/slang/slang-check-overload.cpp b/source/slang/slang-check-overload.cpp
index 1914e84c2..eaa89c008 100644
--- a/source/slang/slang-check-overload.cpp
+++ b/source/slang/slang-check-overload.cpp
@@ -1644,7 +1644,7 @@ namespace Slang
context.getArgType(aa)->toText(argsListBuilder);
}
argsListBuilder << ")";
- return argsListBuilder.ProduceString();
+ return argsListBuilder.produceString();
}
Expr* SemanticsVisitor::ResolveInvoke(InvokeExpr * expr)
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp
index 28ffee152..ff7228854 100644
--- a/source/slang/slang-compiler.cpp
+++ b/source/slang/slang-compiler.cpp
@@ -792,10 +792,10 @@ namespace Slang
if (diagnostic.getLength() > 0)
{
- builder.Append(diagnostic);
+ builder.append(diagnostic);
if (!diagnostic.endsWith("\n"))
{
- builder.Append("\n");
+ builder.append("\n");
}
}
diff --git a/source/slang/slang-doc-markdown-writer.cpp b/source/slang/slang-doc-markdown-writer.cpp
index fb3087d50..9993dc53e 100644
--- a/source/slang/slang-doc-markdown-writer.cpp
+++ b/source/slang/slang-doc-markdown-writer.cpp
@@ -117,7 +117,7 @@ String DocMarkdownWriter::_getName(Decl* decl)
{
StringBuilder buf;
ASTPrinter::appendDeclName(decl, buf);
- return buf.ProduceString();
+ return buf.produceString();
}
String DocMarkdownWriter::_getName(InheritanceDecl* decl)
@@ -125,7 +125,7 @@ String DocMarkdownWriter::_getName(InheritanceDecl* decl)
StringBuilder buf;
buf.clear();
buf << decl->base;
- return buf.ProduceString();
+ return buf.produceString();
}
DocMarkdownWriter::NameAndText DocMarkdownWriter::_getNameAndText(ASTMarkup::Entry* entry, Decl* decl)
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp
index 9dacaa4d4..c122c13f2 100644
--- a/source/slang/slang-emit-c-like.cpp
+++ b/source/slang/slang-emit-c-like.cpp
@@ -853,14 +853,14 @@ String CLikeSourceEmitter::_generateUniqueName(const UnownedStringSlice& name)
sb.append("_");
}
- String key = sb.ProduceString();
+ String key = sb.produceString();
UInt& countRef = m_uniqueNameCounters.getOrAddValue(key, 0);
const UInt count = countRef;
countRef = count + 1;
sb.append(Int32(count));
- return sb.ProduceString();
+ return sb.produceString();
}
String CLikeSourceEmitter::generateName(IRInst* inst)
@@ -931,7 +931,7 @@ String CLikeSourceEmitter::generateName(IRInst* inst)
sb << "_S";
sb << Int32(getID(inst));
- return sb.ProduceString();
+ return sb.produceString();
}
String CLikeSourceEmitter::getName(IRInst* inst)
diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp
index 38855ae44..83f487cb9 100644
--- a/source/slang/slang-emit-cpp.cpp
+++ b/source/slang/slang-emit-cpp.cpp
@@ -1024,7 +1024,7 @@ void CPPSourceEmitter::_emitType(IRType* type, DeclaratorInfo* declarator)
{
StringBuilder sb;
calcTypeName(type, m_target, sb);
- m_writer->emit(sb.ProduceString());
+ m_writer->emit(sb.produceString());
m_writer->emit(" ");
emitDeclarator(declarator);
break;
diff --git a/source/slang/slang-emit-source-writer.cpp b/source/slang/slang-emit-source-writer.cpp
index fc1b48f8c..72696c94a 100644
--- a/source/slang/slang-emit-source-writer.cpp
+++ b/source/slang/slang-emit-source-writer.cpp
@@ -36,7 +36,7 @@ void SourceWriter::emitRawTextSpan(char const* textBegin, char const* textEnd)
{
// TODO(tfoley): Need to make "corelib" not use `int` for pointer-sized things...
auto len = textEnd - textBegin;
- m_builder.Append(textBegin, len);
+ m_builder.append(textBegin, len);
}
void SourceWriter::emitRawText(char const* text)
diff --git a/source/slang/slang-emit-source-writer.h b/source/slang/slang-emit-source-writer.h
index 955d3359c..9a931bb98 100644
--- a/source/slang/slang-emit-source-writer.h
+++ b/source/slang/slang-emit-source-writer.h
@@ -63,7 +63,7 @@ public:
void advanceToSourceLocationIfValid(const SourceLoc& sourceLocation);
/// Get the content as a string
- String getContent() { return m_builder.ProduceString(); }
+ String getContent() { return m_builder.produceString(); }
/// Clear the content
void clearContent() { m_builder.clear(); }
/// Get the content as a string and clear the internal representation
diff --git a/source/slang/slang-ir-autodiff.cpp b/source/slang/slang-ir-autodiff.cpp
index 4dac6b347..4188d2ec8 100644
--- a/source/slang/slang-ir-autodiff.cpp
+++ b/source/slang/slang-ir-autodiff.cpp
@@ -271,7 +271,7 @@ IRInst* DifferentialPairTypeBuilder::_createDiffPairType(IRType* origBaseType, I
StringBuilder nameBuilder;
nameBuilder << "DiffPair_";
getTypeNameHint(nameBuilder, origBaseType);
- builder.addNameHintDecoration(pairStructType, nameBuilder.ToString().getUnownedSlice());
+ builder.addNameHintDecoration(pairStructType, nameBuilder.toString().getUnownedSlice());
builder.createStructField(pairStructType, _getOrCreatePrimalStructKey(), origBaseType);
builder.createStructField(pairStructType, _getOrCreateDiffStructKey(), (IRType*)diffType);
diff --git a/source/slang/slang-ir-spirv-snippet.cpp b/source/slang/slang-ir-spirv-snippet.cpp
index ee40456a7..3d416a7e3 100644
--- a/source/slang/slang-ir-spirv-snippet.cpp
+++ b/source/slang/slang-ir-spirv-snippet.cpp
@@ -202,7 +202,7 @@ RefPtr<SpvSnippet> SpvSnippet::parse(UnownedStringSlice definition)
else if (identifier.startsWith("_"))
{
operand.type = SpvSnippet::ASMOperandType::ObjectReference;
- operand.content = (SpvWord)StringToInt(
+ operand.content = (SpvWord)stringToInt(
identifier.subString(1, identifier.getLength() - 1));
inst.operands.add(operand);
}
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index 07da03744..05d3157a7 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -266,7 +266,7 @@ String dumpIRToString(IRInst* root)
options.flags = IRDumpOptions::Flag::DumpDebugIds;
#endif
dumpIR(root, options, nullptr, &writer);
- return sb.ToString();
+ return sb.toString();
}
void copyNameHintDecoration(IRInst* dest, IRInst* src)
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index ae830ca4f..9225faf6b 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -5881,7 +5881,7 @@ namespace Slang
StringBuilder sb;
scrubName(nameHint, sb);
- String key = sb.ProduceString();
+ String key = sb.produceString();
UInt count = 0;
context->uniqueNameCounters.tryGetValue(key, count);
@@ -5891,14 +5891,14 @@ namespace Slang
{
sb.append(count);
}
- return sb.ProduceString();
+ return sb.produceString();
}
else
{
StringBuilder sb;
auto id = context->uniqueIDCounter++;
sb.append(id);
- return sb.ProduceString();
+ return sb.produceString();
}
}
diff --git a/source/slang/slang-language-server-auto-format.cpp b/source/slang/slang-language-server-auto-format.cpp
index 9e41401b2..5b94712a0 100644
--- a/source/slang/slang-language-server-auto-format.cpp
+++ b/source/slang/slang-language-server-auto-format.cpp
@@ -113,7 +113,7 @@ String parseXmlText(UnownedStringSlice text)
pos++;
}
}
- return sb.ProduceString();
+ return sb.produceString();
}
bool shouldUseFallbackStyle(const FormatOptions& options)
diff --git a/source/slang/slang-language-server-completion.cpp b/source/slang/slang-language-server-completion.cpp
index 9736bd889..337c77cc2 100644
--- a/source/slang/slang-language-server-completion.cpp
+++ b/source/slang/slang-language-server-completion.cpp
@@ -196,7 +196,7 @@ List<LanguageServerProtocol::TextEditCompletionItem> CompletionContext::gatherFi
nameSB.appendChar(ch);
}
}
- item.label = nameSB.ProduceString();
+ item.label = nameSB.produceString();
item.kind = LanguageServerProtocol::kCompletionItemKindFile;
}
if (item.label.getLength())
@@ -335,7 +335,7 @@ SlangResult CompletionContext::tryCompleteImport()
else
prefixSB.appendChar(ch);
}
- auto prefix = prefixSB.ProduceString();
+ auto prefix = prefixSB.produceString();
auto items = gatherFileAndModuleCompletionItems(
prefix, true, false, line - 1, fileNameEnd, lastPos + 1, sectionEnd, 0);
server->m_connection->sendResult(&items, responseId);
@@ -382,7 +382,7 @@ SlangResult CompletionContext::tryCompleteRawFileName(UnownedStringSlice lineCon
else
prefixSB.appendChar(ch);
}
- auto prefix = prefixSB.ProduceString();
+ auto prefix = prefixSB.produceString();
auto items = gatherFileAndModuleCompletionItems(
prefix,
false,
@@ -631,11 +631,11 @@ List<LanguageServerProtocol::CompletionItem> CompletionContext::createSwizzleCan
item.kind = LanguageServerProtocol::kCompletionItemKindVariable;
nameSB.clear();
nameSB << "_m" << i << j;
- item.label = nameSB.ToString();
+ item.label = nameSB.toString();
result.add(item);
nameSB.clear();
nameSB << "_" << i + 1 << j + 1;
- item.label = nameSB.ToString();
+ item.label = nameSB.toString();
result.add(item);
}
}
@@ -675,7 +675,7 @@ LanguageServerProtocol::CompletionItem CompletionContext::generateGUIDCompletion
sb << "\")";
LanguageServerProtocol::CompletionItem resultItem;
resultItem.kind = LanguageServerProtocol::kCompletionItemKindKeyword;
- resultItem.label = sb.ProduceString();
+ resultItem.label = sb.produceString();
return resultItem;
}
diff --git a/source/slang/slang-language-server-inlay-hints.cpp b/source/slang/slang-language-server-inlay-hints.cpp
index 22c9ce21e..801e28445 100644
--- a/source/slang/slang-language-server-inlay-hints.cpp
+++ b/source/slang/slang-language-server-inlay-hints.cpp
@@ -65,7 +65,7 @@ List<LanguageServerProtocol::InlayHint> getInlayHints(
else if (param->hasModifier<RefModifier>()) lblSb << "ref ";
lblSb << name->text;
lblSb << ":";
- hint.label = lblSb.ProduceString();
+ hint.label = lblSb.produceString();
result.add(hint);
}
i++;
@@ -104,7 +104,7 @@ List<LanguageServerProtocol::InlayHint> getInlayHints(
hint.kind = LanguageServerProtocol::kInlayHintKindType;
StringBuilder lblSb;
lblSb << ": " << varDecl->type.type->toString();
- hint.label = lblSb.ProduceString();
+ hint.label = lblSb.produceString();
LanguageServerProtocol::TextEdit edit;
edit.range.start = hint.position;
diff --git a/source/slang/slang-language-server.cpp b/source/slang/slang-language-server.cpp
index 715ecfc5d..8b71d5bd3 100644
--- a/source/slang/slang-language-server.cpp
+++ b/source/slang/slang-language-server.cpp
@@ -347,12 +347,12 @@ static String _formatDocumentation(String doc)
if (parameterDocSB.getLength())
{
result << "**Parameters** \n";
- result << parameterDocSB.ProduceString() << "\n\n";
+ result << parameterDocSB.produceString() << "\n\n";
}
if (returnDocSB.getLength())
{
result << "**Returns** \n";
- result << returnDocSB.ProduceString();
+ result << returnDocSB.produceString();
}
if (!hasDoxygen)
@@ -364,7 +364,7 @@ static String _formatDocumentation(String doc)
result << lines[i] << " \n";
}
}
- return result.ProduceString();
+ return result.produceString();
}
static void _tryGetDocumentation(StringBuilder& sb, WorkspaceVersion* workspace, Decl* decl)
@@ -597,7 +597,7 @@ SlangResult LanguageServer::hover(
else
{
hover.contents.kind = "markdown";
- hover.contents.value = sb.ProduceString();
+ hover.contents.value = sb.produceString();
m_connection->sendResult(&hover, responseId);
return SLANG_OK;
}
@@ -819,7 +819,7 @@ SlangResult LanguageServer::completion(
StringBuilder newText;
newText << originalText.getUnownedSlice().head(cursorOffset + 1) << "#?"
<< originalText.getUnownedSlice().tail(cursorOffset + 1);
- doc->setText(newText.ProduceString());
+ doc->setText(newText.produceString());
auto restoreDocText = makeDeferred([&]() { doc->setText(originalText); });
Module* parsedModule = version->getOrLoadModule(canonicalPath);
@@ -871,7 +871,7 @@ SlangResult LanguageServer::completionResolve(
}
LanguageServerProtocol::CompletionItem resolvedItem = args;
- int itemId = StringToInt(args.data);
+ int itemId = stringToInt(args.data);
auto version = m_workspace->getCurrentCompletionVersion();
if (!version || !version->linkage)
{
@@ -885,7 +885,7 @@ SlangResult LanguageServer::completionResolve(
resolvedItem.detail = getDeclSignatureString(declRef, version);
StringBuilder docSB;
_tryGetDocumentation(docSB, version, declRef.getDecl());
- resolvedItem.documentation.value = docSB.ProduceString();
+ resolvedItem.documentation.value = docSB.produceString();
resolvedItem.documentation.kind = "markdown";
}
m_connection->sendResult(&resolvedItem, responseId);
@@ -1001,7 +1001,7 @@ String LanguageServer::getExprDeclSignature(Expr* expr, String* outDocumentation
auto humaneLoc = version->linkage->getSourceManager()->getHumaneLoc(declRefExpr->declRef.getLoc(), SourceLocType::Actual);
_tryGetDocumentation(docSB, version, declRefExpr->declRef.getDecl());
appendDefinitionLocation(docSB, m_workspace, humaneLoc);
- *outDocumentation = docSB.ProduceString();
+ *outDocumentation = docSB.produceString();
}
return printer.getString();
@@ -1026,7 +1026,7 @@ String LanguageServer::getDeclRefSignature(DeclRef<Decl> declRef, String* outDoc
auto humaneLoc = version->linkage->getSourceManager()->getHumaneLoc(declRef.getLoc(), SourceLocType::Actual);
_tryGetDocumentation(docSB, version, declRef.getDecl());
appendDefinitionLocation(docSB, m_workspace, humaneLoc);
- *outDocumentation = docSB.ProduceString();
+ *outDocumentation = docSB.produceString();
}
return printer.getString();
}
@@ -1658,7 +1658,7 @@ SlangResult LanguageServer::tryGetMacroHoverInfo(
version->linkage->getSourceManager()->getHumaneLoc(def->loc, SourceLocType::Actual);
appendDefinitionLocation(sb, m_workspace, humaneLoc);
hover.contents.kind = "markdown";
- hover.contents.value = sb.ProduceString();
+ hover.contents.value = sb.produceString();
m_connection->sendResult(&hover, responseId);
return SLANG_OK;
}
@@ -1985,7 +1985,7 @@ SlangResult LanguageServer::execute()
StringBuilder msgBuilder;
msgBuilder << "Server processed " << commands.getCount() << " commands, executed in "
<< String(int(workTime * 1000)) << "ms";
- logMessage(3, msgBuilder.ProduceString());
+ logMessage(3, msgBuilder.produceString());
}
m_connection->getUnderlyingConnection()->waitForResult(1000);
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index f156bafa1..1ec508bfa 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -2436,7 +2436,7 @@ static String getNameForNameHint(
sb.append(".");
sb.append(leafName->text);
- return sb.ProduceString();
+ return sb.produceString();
}
/// Try to add an appropriate name hint to the instruction,
diff --git a/source/slang/slang-mangle.cpp b/source/slang/slang-mangle.cpp
index dea808a8e..77e6586ff 100644
--- a/source/slang/slang-mangle.cpp
+++ b/source/slang/slang-mangle.cpp
@@ -552,7 +552,7 @@ namespace Slang
{
ManglingContext context(astBuilder);
mangleName(&context, declRef);
- return context.sb.ProduceString();
+ return context.sb.produceString();
}
String getMangledName(ASTBuilder* astBuilder, DeclRefBase const & declRef)
@@ -575,7 +575,7 @@ namespace Slang
emitRaw(&context, "_SW");
emitQualifiedName(&context, sub);
emitQualifiedName(&context, sup);
- return context.sb.ProduceString();
+ return context.sb.produceString();
}
String getMangledNameForConformanceWitness(
@@ -592,7 +592,7 @@ namespace Slang
emitRaw(&context, "_SW");
emitQualifiedName(&context, sub);
emitType(&context, sup);
- return context.sb.ProduceString();
+ return context.sb.produceString();
}
String getMangledNameForConformanceWitness(
@@ -609,21 +609,21 @@ namespace Slang
emitRaw(&context, "_SW");
emitType(&context, sub);
emitType(&context, sup);
- return context.sb.ProduceString();
+ return context.sb.produceString();
}
String getMangledTypeName(ASTBuilder* astBuilder, Type* type)
{
ManglingContext context(astBuilder);
emitType(&context, type);
- return context.sb.ProduceString();
+ return context.sb.produceString();
}
String getMangledNameFromNameString(const UnownedStringSlice& name)
{
ManglingContext context(nullptr);
emitNameImpl(&context, name);
- return context.sb.ProduceString();
+ return context.sb.produceString();
}
String getHashedName(const UnownedStringSlice& mangledName)
diff --git a/source/slang/slang-mangled-lexer.cpp b/source/slang/slang-mangled-lexer.cpp
index 4920cfce3..ee019e482 100644
--- a/source/slang/slang-mangled-lexer.cpp
+++ b/source/slang/slang-mangled-lexer.cpp
@@ -219,7 +219,7 @@ String MangledLexer::unescapeString(UnownedStringSlice str)
cursor++;
}
}
- return sb.ProduceString();
+ return sb.produceString();
}
UInt MangledLexer::readParamCount()
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 34ef0763f..0860ef4f2 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -2390,7 +2390,7 @@ SlangResult parseOptions(
if (sink->getErrorCount() > 0)
{
// Put the errors in the diagnostic
- compileRequest->m_diagnosticOutput = sink->outputBuffer.ProduceString();
+ compileRequest->m_diagnosticOutput = sink->outputBuffer.produceString();
}
return res;
diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp
index b3c9f9942..256d7aae1 100644
--- a/source/slang/slang-parser.cpp
+++ b/source/slang/slang-parser.cpp
@@ -891,17 +891,17 @@ namespace Slang
StringBuilder scopedIdentifierBuilder;
if (initialTokenType == TokenType::Scope)
{
- scopedIdentifierBuilder.Append('_');
+ scopedIdentifierBuilder.append('_');
}
- scopedIdentifierBuilder.Append(firstIdentifier.getContent());
+ scopedIdentifierBuilder.append(firstIdentifier.getContent());
while (parser->tokenReader.peekTokenType() == TokenType::Scope)
{
parser->ReadToken(TokenType::Scope);
- scopedIdentifierBuilder.Append('_');
+ scopedIdentifierBuilder.append('_');
const Token nextIdentifier(parser->ReadToken(TokenType::Identifier));
- scopedIdentifierBuilder.Append(nextIdentifier.getContent());
+ scopedIdentifierBuilder.append(nextIdentifier.getContent());
}
// Make a 'token'
@@ -1195,7 +1195,7 @@ namespace Slang
sb << parser->ReadToken(TokenType::Identifier).getContent();
}
- moduleNameAndLoc.name = getName(parser, sb.ProduceString());
+ moduleNameAndLoc.name = getName(parser, sb.produceString());
}
decl->moduleNameAndLoc = moduleNameAndLoc;
@@ -5819,7 +5819,7 @@ namespace Slang
token = parser->tokenReader.advanceToken();
sb << getStringLiteralTokenValue(token);
}
- constExpr->value = sb.ProduceString();
+ constExpr->value = sb.produceString();
}
return constExpr;
@@ -6244,11 +6244,11 @@ namespace Slang
{
if (AdvanceIf(parser, TokenType::OpSub))
{
- modifier->op = IROp(-StringToInt(parser->ReadToken().getContent()));
+ modifier->op = IROp(-stringToInt(parser->ReadToken().getContent()));
}
else if (parser->LookAheadToken(TokenType::IntegerLiteral))
{
- modifier->op = IROp(StringToInt(parser->ReadToken().getContent()));
+ modifier->op = IROp(stringToInt(parser->ReadToken().getContent()));
}
else
{
@@ -6513,7 +6513,7 @@ namespace Slang
{
BuiltinTypeModifier* modifier = parser->astBuilder->create<BuiltinTypeModifier>();
parser->ReadToken(TokenType::LParent);
- modifier->tag = BaseType(StringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
+ modifier->tag = BaseType(stringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
parser->ReadToken(TokenType::RParent);
return modifier;
@@ -6523,7 +6523,7 @@ namespace Slang
{
BuiltinRequirementModifier* modifier = parser->astBuilder->create<BuiltinRequirementModifier>();
parser->ReadToken(TokenType::LParent);
- modifier->kind = BuiltinRequirementKind(StringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
+ modifier->kind = BuiltinRequirementKind(stringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
parser->ReadToken(TokenType::RParent);
return modifier;
@@ -6536,7 +6536,7 @@ namespace Slang
modifier->magicName = parser->ReadToken(TokenType::Identifier).getContent();
if (AdvanceIf(parser, TokenType::Comma))
{
- modifier->tag = uint32_t(StringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
+ modifier->tag = uint32_t(stringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
}
parser->ReadToken(TokenType::RParent);
@@ -6547,10 +6547,10 @@ namespace Slang
{
IntrinsicTypeModifier* modifier = parser->astBuilder->create<IntrinsicTypeModifier>();
parser->ReadToken(TokenType::LParent);
- modifier->irOp = uint32_t(StringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
+ modifier->irOp = uint32_t(stringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
while( AdvanceIf(parser, TokenType::Comma) )
{
- auto operand = uint32_t(StringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
+ auto operand = uint32_t(stringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
modifier->irOperands.add(operand);
}
parser->ReadToken(TokenType::RParent);
@@ -6564,10 +6564,10 @@ namespace Slang
ConversionCost cost = kConversionCost_Default;
if( AdvanceIf(parser, TokenType::LParent) )
{
- cost = ConversionCost(StringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
+ cost = ConversionCost(stringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
if (AdvanceIf(parser, TokenType::Comma))
{
- builtinKind = BuiltinConversionKind(StringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
+ builtinKind = BuiltinConversionKind(stringToInt(parser->ReadToken(TokenType::IntegerLiteral).getContent()));
}
parser->ReadToken(TokenType::RParent);
}
diff --git a/source/slang/slang-preprocessor.cpp b/source/slang/slang-preprocessor.cpp
index ba96ac887..28abaaf76 100644
--- a/source/slang/slang-preprocessor.cpp
+++ b/source/slang/slang-preprocessor.cpp
@@ -1833,7 +1833,7 @@ Token MacroInvocation::_readTokenImpl()
//
PathInfo pathInfo = PathInfo::makeTokenPaste();
SourceManager* sourceManager = m_preprocessor->getSourceManager();
- SourceFile* sourceFile = sourceManager->createSourceFileWithString(pathInfo, pastedContent.ProduceString());
+ SourceFile* sourceFile = sourceManager->createSourceFileWithString(pathInfo, pastedContent.produceString());
SourceView* sourceView = sourceManager->createSourceView(sourceFile, nullptr, tokenPasteLoc);
Lexer lexer;
@@ -2532,7 +2532,7 @@ static PreprocessorExpressionValue ParseAndEvaluateUnaryExpression(PreprocessorD
}
case TokenType::IntegerLiteral:
- return StringToInt(token.getContent());
+ return stringToInt(token.getContent());
case TokenType::Identifier:
{
@@ -3484,7 +3484,7 @@ static void HandleLineDirective(PreprocessorDirectiveContext* context)
switch(PeekTokenType(context))
{
case TokenType::IntegerLiteral:
- line = StringToInt(AdvanceToken(context).getContent());
+ line = stringToInt(AdvanceToken(context).getContent());
break;
case TokenType::EndOfFile:
@@ -4098,7 +4098,7 @@ TokenList preprocessSource(
sb << t.Content;
}
- String s = sb.ProduceString();
+ String s = sb.produceString();
#endif
return tokens;
diff --git a/source/slang/slang-repro.cpp b/source/slang/slang-repro.cpp
index c978ab47c..7ddf2f304 100644
--- a/source/slang/slang-repro.cpp
+++ b/source/slang/slang-repro.cpp
@@ -351,7 +351,7 @@ static String _scrubName(const String& in)
builder.appendChar(c);
}
- return builder.ProduceString();
+ return builder.produceString();
}
/* static */SlangResult ReproUtil::store(EndToEndCompileRequest* request, OffsetContainer& inOutContainer, Offset32Ptr<RequestState>& outRequest)
diff --git a/source/slang/slang-serialize-container.cpp b/source/slang/slang-serialize-container.cpp
index 3eea5caf7..8d10235f0 100644
--- a/source/slang/slang-serialize-container.cpp
+++ b/source/slang/slang-serialize-container.cpp
@@ -387,7 +387,7 @@ static List<ExtensionDecl*>& _getCandidateExtensionList(
buf << "tu" << out.modules.getCount();
if (!astBuilder)
{
- astBuilder = new ASTBuilder(options.sharedASTBuilder, buf.ProduceString());
+ astBuilder = new ASTBuilder(options.sharedASTBuilder, buf.produceString());
}
DefaultSerialObjectFactory objectFactory(astBuilder);
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp
index 9d4a079c8..f80254ba6 100644
--- a/source/slang/slang-stdlib.cpp
+++ b/source/slang/slang-stdlib.cpp
@@ -266,7 +266,7 @@ namespace Slang
#include "core.meta.slang.h"
- coreLibraryCode = sb.ProduceString();
+ coreLibraryCode = sb.produceString();
#endif
return coreLibraryCode;
@@ -284,7 +284,7 @@ namespace Slang
#include "hlsl.meta.slang.h"
- hlslLibraryCode = sb.ProduceString();
+ hlslLibraryCode = sb.produceString();
#endif
return hlslLibraryCode;
}
@@ -301,7 +301,7 @@ namespace Slang
#include "diff.meta.slang.h"
- autodiffLibraryCode = sb.ProduceString();
+ autodiffLibraryCode = sb.produceString();
#endif
return autodiffLibraryCode;
}
diff --git a/source/slang/slang-workspace-version.cpp b/source/slang/slang-workspace-version.cpp
index 4d33b34c0..dde5b9325 100644
--- a/source/slang/slang-workspace-version.cpp
+++ b/source/slang/slang-workspace-version.cpp
@@ -56,7 +56,7 @@ void Workspace::changeDoc(const String& path, LanguageServerProtocol::Range rang
newText << text;
if (endOffset != -1)
newText << originalText.tail(endOffset);
- changeDoc(doc.Ptr(), newText.ProduceString());
+ changeDoc(doc.Ptr(), newText.produceString());
}
}
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index b5a8585ff..ac8e0269d 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -2726,7 +2726,7 @@ SlangResult EndToEndCompileRequest::executeActions()
{
SlangResult res = executeActionsInner();
- m_diagnosticOutput = getSink()->outputBuffer.ProduceString();
+ m_diagnosticOutput = getSink()->outputBuffer.produceString();
return res;
}
@@ -3117,10 +3117,10 @@ RefPtr<Module> Linkage::findOrImportModule(
if (c == '_')
c = '-';
- sb.Append(c);
+ sb.append(c);
}
- sb.Append(".slang");
- fileName = sb.ProduceString();
+ sb.append(".slang");
+ fileName = sb.produceString();
}
else
{
@@ -5108,7 +5108,7 @@ SlangResult EndToEndCompileRequest::EndToEndCompileRequest::compile()
// and not some other component in their system.
getSink()->diagnose(SourceLoc(), Diagnostics::compilationAborted);
}
- m_diagnosticOutput = getSink()->outputBuffer.ProduceString();
+ m_diagnosticOutput = getSink()->outputBuffer.produceString();
#else
// When debugging, we probably don't want to filter out any errors, since
diff --git a/tools/gfx/debug-layer/debug-helper-functions.cpp b/tools/gfx/debug-layer/debug-helper-functions.cpp
index 10dcedf2a..e7c4e0246 100644
--- a/tools/gfx/debug-layer/debug-helper-functions.cpp
+++ b/tools/gfx/debug-layer/debug-helper-functions.cpp
@@ -42,7 +42,7 @@ String _gfxGetFuncName(const char* input)
StringBuilder sb;
sb.appendChar('I');
sb.append(str.subString(startIndex, endIndex - startIndex));
- return sb.ProduceString();
+ return sb.produceString();
}
void validateAccelerationStructureBuildInputs(
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp
index ef15346c6..3b2c07ce6 100644
--- a/tools/render-test/options.cpp
+++ b/tools/render-test/options.cpp
@@ -174,7 +174,7 @@ static gfx::DeviceType _toRenderType(Slang::RenderApiType apiType)
for (Index i = 0; i < 3; ++i)
{
string = slices[i];
- int v = StringToInt(string);
+ int v = stringToInt(string);
if (v < 1)
{
sink.diagnose(dispatchSize.loc, RenderTestDiagnostics::expectingPositiveComputeDispatch);
diff --git a/tools/render-test/shader-input-layout.cpp b/tools/render-test/shader-input-layout.cpp
index 7aef0025f..2883dd465 100644
--- a/tools/render-test/shader-input-layout.cpp
+++ b/tools/render-test/shader-input-layout.cpp
@@ -434,7 +434,7 @@ namespace renderer_test
sb << parseTypeName(parser);
sb << ">";
parser.Read(">");
- return sb.ProduceString();
+ return sb.produceString();
}
return typeName;
}
diff --git a/tools/slang-cpp-extractor/cpp-extractor-main.cpp b/tools/slang-cpp-extractor/cpp-extractor-main.cpp
index c8a4d80f5..2bc0596e1 100644
--- a/tools/slang-cpp-extractor/cpp-extractor-main.cpp
+++ b/tools/slang-cpp-extractor/cpp-extractor-main.cpp
@@ -247,7 +247,7 @@ SlangResult App::execute(const Options& options)
StringBuilder buf;
// Let's guess a 'fileMark' (it becomes part of the filename) based on the macro name. Use lower kabab.
NameConventionUtil::join(slices.getBuffer(), slices.getCount(), NameConvention::LowerKabab, buf);
- typeSet->m_fileMark = buf.ProduceString();
+ typeSet->m_fileMark = buf.produceString();
}
if (typeSet->m_typeName.getLength() == 0)
@@ -255,7 +255,7 @@ SlangResult App::execute(const Options& options)
// Let's guess a typename if not set -> go with upper camel
StringBuilder buf;
NameConventionUtil::join(slices.getBuffer(), slices.getCount(), NameConvention::UpperCamel, buf);
- typeSet->m_typeName = buf.ProduceString();
+ typeSet->m_typeName = buf.produceString();
}
}
}
diff --git a/tools/slang-cpp-extractor/node.h b/tools/slang-cpp-extractor/node.h
index db9a10e36..8455588ad 100644
--- a/tools/slang-cpp-extractor/node.h
+++ b/tools/slang-cpp-extractor/node.h
@@ -118,7 +118,7 @@ public:
void calcAbsoluteName(StringBuilder& outName) const;
/// Get the absolute name
- String getAbsoluteName() const { StringBuilder buf; calcAbsoluteName(buf); return buf.ProduceString(); }
+ String getAbsoluteName() const { StringBuilder buf; calcAbsoluteName(buf); return buf.produceString(); }
/// Calculate the scope path to this node, from the root
void calcScopePath(List<Node*>& outPath) { calcScopePath(this, outPath); }
diff --git a/tools/slang-embed/slang-embed.cpp b/tools/slang-embed/slang-embed.cpp
index d3936af71..80ee6c237 100644
--- a/tools/slang-embed/slang-embed.cpp
+++ b/tools/slang-embed/slang-embed.cpp
@@ -283,7 +283,7 @@ struct App
processInputFile(outputFile, Slang::UnownedStringSlice(inputPath));
fprintf(outputFile, ";\n");
- fprintf(outputFile, "return sb.ProduceString();\n}\n");
+ fprintf(outputFile, "return sb.produceString();\n}\n");
}
};
diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp
index 9989d8164..8ab9e9ae2 100644
--- a/tools/slang-test/options.cpp
+++ b/tools/slang-test/options.cpp
@@ -201,7 +201,7 @@ static bool _isSubCommand(const char* arg)
stdError.print("error: expected operand for '%s'\n", arg);
return SLANG_FAIL;
}
- optionsOut->serverCount = StringToInt(* argCursor++);
+ optionsOut->serverCount = stringToInt(* argCursor++);
if (optionsOut->serverCount <= 0)
{
optionsOut->serverCount = 1;
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 94329831b..884a20a0e 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -233,8 +233,8 @@ void skipToEndOfLine(char const** ioCursor)
String getString(char const* textBegin, char const* textEnd)
{
StringBuilder sb;
- sb.Append(textBegin, textEnd - textBegin);
- return sb.ProduceString();
+ sb.append(textBegin, textEnd - textBegin);
+ return sb.produceString();
}
String collectRestOfLine(char const** ioCursor)
@@ -1314,15 +1314,15 @@ String getOutput(const ExecuteResult& exeRes)
// We construct a single output string that captures the results
StringBuilder actualOutputBuilder;
- actualOutputBuilder.Append("result code = ");
- actualOutputBuilder.Append(resultCode);
- actualOutputBuilder.Append("\nstandard error = {\n");
- actualOutputBuilder.Append(standardError);
- actualOutputBuilder.Append("}\nstandard output = {\n");
- actualOutputBuilder.Append(standardOuptut);
- actualOutputBuilder.Append("}\n");
-
- return actualOutputBuilder.ProduceString();
+ actualOutputBuilder.append("result code = ");
+ actualOutputBuilder.append(resultCode);
+ actualOutputBuilder.append("\nstandard error = {\n");
+ actualOutputBuilder.append(standardError);
+ actualOutputBuilder.append("}\nstandard output = {\n");
+ actualOutputBuilder.append(standardOuptut);
+ actualOutputBuilder.append("}\n");
+
+ return actualOutputBuilder.produceString();
}
// Finds the specialized or default path for expected data for a test.
@@ -1631,7 +1631,7 @@ TestResult runExecutableTest(TestContext* context, TestInput& input)
{
StringBuilder buf;
StringEscapeUtil::unescapeShellLike(escapeHandler, arg.getUnownedSlice(), buf);
- cmdLine.addArg(buf.ProduceString());
+ cmdLine.addArg(buf.produceString());
}
else
{
@@ -1935,7 +1935,7 @@ TestResult runLanguageServerTest(TestContext* context, TestInput& input)
TestResult result = TestResult::Pass;
- auto actualOutput = actualOutputSB.ProduceString();
+ auto actualOutput = actualOutputSB.produceString();
// Redact absolute file names from actualOutput
List<UnownedStringSlice> outputLines;
@@ -1952,7 +1952,7 @@ TestResult runLanguageServerTest(TestContext* context, TestInput& input)
redactedSB << "{REDACTED}" << line.tail(extIdx) << "\n";
}
- actualOutput = redactedSB.ProduceString().trim();
+ actualOutput = redactedSB.produceString().trim();
if (!_areResultsEqual(input.testOptions->type, expectedOutput, actualOutput))
{
@@ -2120,7 +2120,7 @@ TestResult runCompile(TestContext* context, TestInput& input)
{
StringBuilder buf;
StringEscapeUtil::unescapeShellLike(escapeHandler, arg.getUnownedSlice(), buf);
- cmdLine.addArg(buf.ProduceString());
+ cmdLine.addArg(buf.produceString());
}
else
{
@@ -2797,15 +2797,15 @@ static TestResult _runHLSLComparisonTest(
// We construct a single output string that captures the results
StringBuilder actualOutputBuilder;
- actualOutputBuilder.Append("result code = ");
- actualOutputBuilder.Append(resultCode);
- actualOutputBuilder.Append("\nstandard error = {\n");
- actualOutputBuilder.Append(standardError);
- actualOutputBuilder.Append("}\nstandard output = {\n");
- actualOutputBuilder.Append(standardOutput);
- actualOutputBuilder.Append("}\n");
+ actualOutputBuilder.append("result code = ");
+ actualOutputBuilder.append(resultCode);
+ actualOutputBuilder.append("\nstandard error = {\n");
+ actualOutputBuilder.append(standardError);
+ actualOutputBuilder.append("}\nstandard output = {\n");
+ actualOutputBuilder.append(standardOutput);
+ actualOutputBuilder.append("}\n");
- String actualOutput = actualOutputBuilder.ProduceString();
+ String actualOutput = actualOutputBuilder.produceString();
// Always fail if the compilation produced a failure, just
// to catch situations where, e.g., command-line options parsing
@@ -2877,16 +2877,16 @@ TestResult doGLSLComparisonTestRun(TestContext* context,
// We construct a single output string that captures the results
StringBuilder outputBuilder;
- outputBuilder.Append("result code = ");
- outputBuilder.Append(resultCode);
- outputBuilder.Append("\nstandard error = {\n");
- outputBuilder.Append(standardError);
- outputBuilder.Append("}\nstandard output = {\n");
- outputBuilder.Append(standardOuptut);
- outputBuilder.Append("}\n");
+ outputBuilder.append("result code = ");
+ outputBuilder.append(resultCode);
+ outputBuilder.append("\nstandard error = {\n");
+ outputBuilder.append(standardError);
+ outputBuilder.append("}\nstandard output = {\n");
+ outputBuilder.append(standardOuptut);
+ outputBuilder.append("}\n");
String outputPath = outputStem + outputKind;
- String output = outputBuilder.ProduceString();
+ String output = outputBuilder.produceString();
*outOutput = output;
@@ -2954,7 +2954,7 @@ static SlangResult _extractProfileTime(const UnownedStringSlice& text, double& t
UnownedStringSlice remaining(line.begin() + lineStart.getLength(), line.end());
remaining.trim();
- timeOut = StringToDouble(String(remaining));
+ timeOut = stringToDouble(String(remaining));
return SLANG_OK;
}
}
@@ -3249,16 +3249,16 @@ TestResult doRenderComparisonTestRun(TestContext* context, TestInput& input, cha
// We construct a single output string that captures the results
StringBuilder outputBuilder;
- outputBuilder.Append("result code = ");
- outputBuilder.Append(resultCode);
- outputBuilder.Append("\nstandard error = {\n");
- outputBuilder.Append(standardError);
- outputBuilder.Append("}\nstandard output = {\n");
- outputBuilder.Append(standardOutput);
- outputBuilder.Append("}\n");
+ outputBuilder.append("result code = ");
+ outputBuilder.append(resultCode);
+ outputBuilder.append("\nstandard error = {\n");
+ outputBuilder.append(standardError);
+ outputBuilder.append("}\nstandard output = {\n");
+ outputBuilder.append(standardOutput);
+ outputBuilder.append("}\n");
String outputPath = outputStem + outputKind;
- String output = outputBuilder.ProduceString();
+ String output = outputBuilder.produceString();
*outOutput = output;
diff --git a/tools/slang-test/test-reporter.cpp b/tools/slang-test/test-reporter.cpp
index 2d252ebed..e0696eab2 100644
--- a/tools/slang-test/test-reporter.cpp
+++ b/tools/slang-test/test-reporter.cpp
@@ -22,7 +22,7 @@ static void appendXmlEncode(char c, StringBuilder& out)
case '>': out << "&gt;"; break;
case '\'': out << "&apos;"; break;
case '"': out << "&quot;"; break;
- default: out.Append(c);
+ default: out.append(c);
}
}
@@ -56,7 +56,7 @@ static void appendXmlEncode(const String& in, StringBuilder& out)
// Write it
if (cur > start)
{
- out.Append(start, UInt(end - start));
+ out.append(start, UInt(end - start));
}
// if not at the end, we must be on an xml encoded character, so just output it xml encoded.
@@ -261,11 +261,11 @@ static void _appendEncodedTeamCityString(const UnownedStringSlice& in, StringBui
// Flush
if (cur > start)
{
- builder.Append(start, UInt(cur - start));
+ builder.append(start, UInt(cur - start));
}
- builder.Append('|');
- builder.Append(escapeChar);
+ builder.append('|');
+ builder.append(escapeChar);
start = cur + 1;
}
}
@@ -273,7 +273,7 @@ static void _appendEncodedTeamCityString(const UnownedStringSlice& in, StringBui
// Flush the end
if (end > start)
{
- builder.Append(start, UInt(end - start));
+ builder.append(start, UInt(end - start));
}
}
@@ -544,7 +544,7 @@ void TestReporter::message(TestMessageType type, const String& message)
{
m_currentMessage << "\n";
}
- m_currentMessage.Append(message);
+ m_currentMessage.append(message);
}
void TestReporter::messageFormat(TestMessageType type, char const* format, ...)
diff --git a/tools/test-process/test-process-main.cpp b/tools/test-process/test-process-main.cpp
index 852b58cef..e1ff3c8a7 100644
--- a/tools/test-process/test-process-main.cpp
+++ b/tools/test-process/test-process-main.cpp
@@ -33,7 +33,7 @@ static SlangResult _outputCount(int argc, const char* const* argv)
return SLANG_FAIL;
}
// Get the count
- const Index count = StringToInt(argv[2]);
+ const Index count = stringToInt(argv[2]);
// If we want to crash
Index crashIndex = -1;
@@ -41,7 +41,7 @@ static SlangResult _outputCount(int argc, const char* const* argv)
{
// When we crash, we want to make sure everything is flushed...
_makeStdStreamsUnbuffered();
- crashIndex = StringToInt(argv[3]);
+ crashIndex = stringToInt(argv[3]);
}
FILE* fileOut = stdout;