summaryrefslogtreecommitdiffstats
path: root/source/slang/preprocessor.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-01-10 16:01:05 -0500
committerGitHub <noreply@github.com>2019-01-10 16:01:05 -0500
commitdbf5f413cd7a7b0448312a6f198b2a544087ac58 (patch)
treef9dce7776ed118f5b97e2446dccbb2631edec3d8 /source/slang/preprocessor.cpp
parenteb331446e3bee812d1df19cf59eb2d23d287ac74 (diff)
Improvements around review of debug serialization info (#769)
* * Make SourceView and SourceFile no longer derive from RefObject * Both have life time now managed by SourceManager * Tidied up a little around the serialization test code - just create the IRModule once * Simplified code around deleting SourceView/File. * Looked into generateIRForTranslationUnit - seems reasonable to just call it once, because it has side effects.
Diffstat (limited to 'source/slang/preprocessor.cpp')
-rw-r--r--source/slang/preprocessor.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/slang/preprocessor.cpp b/source/slang/preprocessor.cpp
index d91836c40..c038737b7 100644
--- a/source/slang/preprocessor.cpp
+++ b/source/slang/preprocessor.cpp
@@ -842,8 +842,7 @@ top:
// We create a dummy file to represent the token-paste operation
PathInfo pathInfo = PathInfo::makeTokenPaste();
- RefPtr<SourceFile> sourceFile = sourceManager->createSourceFileWithString(pathInfo, sb.ProduceString());
-
+ SourceFile* sourceFile = sourceManager->createSourceFileWithString(pathInfo, sb.ProduceString());
SourceView* sourceView = sourceManager->createSourceView(sourceFile);
Lexer lexer;
@@ -1634,7 +1633,7 @@ static void HandleIncludeDirective(PreprocessorDirectiveContext* context)
auto sourceManager = context->preprocessor->getCompileRequest()->getSourceManager();
// See if this an already loaded source file
- RefPtr<SourceFile> sourceFile = sourceManager->findSourceFileRecursively(filePathInfo.canonicalPath);
+ SourceFile* sourceFile = sourceManager->findSourceFileRecursively(filePathInfo.canonicalPath);
// If not create a new one, and add to the list of known source files
if (!sourceFile)
{
@@ -2268,8 +2267,8 @@ static void DefineMacro(
auto sourceManager = preprocessor->translationUnit->compileRequest->getSourceManager();
- RefPtr<SourceFile> keyFile = sourceManager->createSourceFileWithString(pathInfo, key);
- RefPtr<SourceFile> valueFile = sourceManager->createSourceFileWithString(pathInfo, value);
+ SourceFile* keyFile = sourceManager->createSourceFileWithString(pathInfo, key);
+ SourceFile* valueFile = sourceManager->createSourceFileWithString(pathInfo, value);
SourceView* keyView = sourceManager->createSourceView(keyFile);
SourceView* valueView = sourceManager->createSourceView(valueFile);