Use ImmutableString for HLSL texture references
This also adds ImmutableStringBuilder class, which can be used to
build ImmutableStrings in place without extra allocations if the
maximum length is known in advance.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I4dfb78adeb0cffcfad0d25753fb8063466012c92
Reviewed-on: https://chromium-review.googlesource.com/886362
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/ImmutableString.cpp b/src/compiler/translator/ImmutableString.cpp
new file mode 100644
index 0000000..93dad1b
--- /dev/null
+++ b/src/compiler/translator/ImmutableString.cpp
@@ -0,0 +1,15 @@
+//
+// Copyright (c) 2018 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// ImmutableString.cpp: Wrapper for static or pool allocated char arrays, that are guaranteed to be
+// valid and unchanged for the duration of the compilation.
+//
+
+#include "compiler/translator/ImmutableString.h"
+
+std::ostream &operator<<(std::ostream &os, const sh::ImmutableString &str)
+{
+ return os.write(str.data(), str.length());
+}