From eb331446e3bee812d1df19cf59eb2d23d287ac74 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 7 Jan 2019 09:31:31 -0500 Subject: Feature/serialization debug info (#767) * Remove AppContext. Use StdChannels to hold writers, and TestToolUtil to hold test tool specific functionality. * StdChannels -> StdWriters * getStdOut -> getOut, getStdError -> getError * Renamed main.cpp files of tools to try and stop visual studio getting confused between files - such that clicking on an error takes editor to the right location. * Work in progress on being able to serialize debug information. * * Added MemoryStream * First pass converting to IRSerialData * Able to read and write IRSerialData with debug data * Start at reconstruting IR serialized data. * First pass of generation debug SourceLocs from debug data. Works for test set for line nos. * Bug fixes. Moved testing of serialization into IRSerialUtil * Work around problem with irModule = generateIRForTranslationUnit(translationUnit); two times in a row produces different output(!). Fix by just creating once. * Remove problem with use of ternary op in slang.cpp on gcc/clang. * Added -verify-debug-serial-ir option that makes IR modules go through full serialization with debug information and verification. * Add a test that does serial debug verification that is run by default on linux. --- source/slang/compiler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/slang/compiler.cpp') diff --git a/source/slang/compiler.cpp b/source/slang/compiler.cpp index 172bc33b9..a9711310b 100644 --- a/source/slang/compiler.cpp +++ b/source/slang/compiler.cpp @@ -260,7 +260,7 @@ namespace Slang { codeBuilder << "#line 1 \""; - const String& path = sourceFile->pathInfo.foundPath; + const String& path = sourceFile->getPathInfo().foundPath; for(auto c : path) { @@ -277,7 +277,7 @@ namespace Slang } codeBuilder << "\"\n"; - codeBuilder << sourceFile->content << "\n"; + codeBuilder << sourceFile->getContent() << "\n"; } return codeBuilder.ProduceString(); @@ -322,7 +322,7 @@ namespace Slang { codeBuilder << "#line 1 " << translationUnitIndex << "\n"; } - codeBuilder << sourceFile->content << "\n"; + codeBuilder << sourceFile->getContent() << "\n"; } return codeBuilder.ProduceString(); -- cgit v1.2.3