summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/compiler-core/slang-visual-studio-compiler-util.cpp5
-rw-r--r--source/core/slang-writer.cpp2
-rw-r--r--source/core/slang-writer.h3
3 files changed, 8 insertions, 2 deletions
diff --git a/source/compiler-core/slang-visual-studio-compiler-util.cpp b/source/compiler-core/slang-visual-studio-compiler-util.cpp
index e2c488ee9..9bdfd406a 100644
--- a/source/compiler-core/slang-visual-studio-compiler-util.cpp
+++ b/source/compiler-core/slang-visual-studio-compiler-util.cpp
@@ -87,8 +87,7 @@ namespace Slang
// https://docs.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-alphabetically?view=vs-2019
cmdLine.addArg("/nologo");
- // Generate complete debugging information
- cmdLine.addArg("/Zi");
+
// Display full path of source files in diagnostics
cmdLine.addArg("/FC");
@@ -139,6 +138,8 @@ namespace Slang
// /Fd - followed by name of the pdb file
if (options.debugInfoType != DebugInfoType::None)
{
+ // Generate complete debugging information
+ cmdLine.addArg("/Zi");
cmdLine.addPrefixPathArg("/Fd", options.modulePath, ".pdb");
}
diff --git a/source/core/slang-writer.cpp b/source/core/slang-writer.cpp
index 3b1a5756a..849cb2da0 100644
--- a/source/core/slang-writer.cpp
+++ b/source/core/slang-writer.cpp
@@ -71,6 +71,7 @@ ISlangUnknown* BaseWriter::getInterface(const Guid& guid)
SLANG_NO_THROW char* SLANG_MCALL AppendBufferWriter::beginAppendBuffer(size_t maxNumChars)
{
+ mutex.lock();
m_appendBuffer.setCount(maxNumChars);
return m_appendBuffer.getBuffer();
}
@@ -82,6 +83,7 @@ SLANG_NO_THROW SlangResult SLANG_MCALL AppendBufferWriter::endAppendBuffer(char*
SlangResult res = write(buffer, numChars);
// Clear so that buffer can't be written from again without assert
m_appendBuffer.clear();
+ mutex.unlock();
return res;
}
diff --git a/source/core/slang-writer.h b/source/core/slang-writer.h
index 7c768a22f..ccdcb3747 100644
--- a/source/core/slang-writer.h
+++ b/source/core/slang-writer.h
@@ -8,6 +8,8 @@
#include "slang-list.h"
+#include <mutex>
+
namespace Slang
{
@@ -81,6 +83,7 @@ public:
protected:
List<char> m_appendBuffer;
+ std::mutex mutex;
};
class CallbackWriter : public AppendBufferWriter