|
10 | 10 |
|
11 | 11 | namespace Slang
|
12 | 12 | {
|
13 |
| -static void dumpIRIfEnabled( |
14 |
| - CodeGenContext* codeGenContext, |
15 |
| - IRModule* irModule, |
16 |
| - char const* label = nullptr) |
17 |
| -{ |
18 |
| - if (codeGenContext->shouldDumpIR()) |
19 |
| - { |
20 |
| - DiagnosticSinkWriter writer(codeGenContext->getSink()); |
21 |
| - dumpIR( |
22 |
| - irModule, |
23 |
| - codeGenContext->getIRDumpOptions(), |
24 |
| - label, |
25 |
| - codeGenContext->getSourceManager(), |
26 |
| - &writer); |
27 |
| - } |
28 |
| -} |
29 |
| - |
30 | 13 | // Only attempt to precompile functions:
|
31 | 14 | // 1) With function bodies (not just empty decls)
|
32 | 15 | // 2) Not marked with unsafeForceInlineDecoration
|
@@ -120,10 +103,6 @@ Module::precompileForTarget(SlangCompileTarget target, slang::IBlob** outDiagnos
|
120 | 103 | applySettingsToDiagnosticSink(&sink, &sink, linkage->m_optionSet);
|
121 | 104 | applySettingsToDiagnosticSink(&sink, &sink, m_optionSet);
|
122 | 105 |
|
123 |
| - // Configure diagnostic writer to write directly to stderr |
124 |
| - static FileWriter stdError(stderr, WriterFlag::IsStatic | WriterFlag::IsUnowned); |
125 |
| - sink.writer = &stdError; |
126 |
| - |
127 | 106 | RefPtr<TargetRequest> targetReq = new TargetRequest(linkage, targetEnum);
|
128 | 107 |
|
129 | 108 | List<RefPtr<ComponentType>> allComponentTypes;
|
@@ -164,9 +143,6 @@ Module::precompileForTarget(SlangCompileTarget target, slang::IBlob** outDiagnos
|
164 | 143 | CodeGenContext::Shared sharedCodeGenContext(&tp, entryPointIndices, &sink, nullptr);
|
165 | 144 | CodeGenContext codeGenContext(&sharedCodeGenContext);
|
166 | 145 |
|
167 |
| - // Dump initial IR before precompilation |
168 |
| - dumpIRIfEnabled(&codeGenContext, module, "PRECOMPILE_FOR_TARGET"); |
169 |
| - |
170 | 146 | // Mark all public functions as exported, ensure there's at least one. Store a mapping
|
171 | 147 | // of function name to IRInst* for later reference. After linking is done, we'll scan
|
172 | 148 | // the linked result to see which functions survived the pruning and are included in the
|
@@ -205,9 +181,6 @@ Module::precompileForTarget(SlangCompileTarget target, slang::IBlob** outDiagnos
|
205 | 181 | return SLANG_E_NOT_AVAILABLE;
|
206 | 182 | }
|
207 | 183 |
|
208 |
| - // Dump IR after precompilation but before applying decorations |
209 |
| - dumpIRIfEnabled(&codeGenContext, module, "PRECOMPILE_FOR_TARGET_BEFORE_DECORATIONS"); |
210 |
| - |
211 | 184 | for (const auto& mangledName : metadata->getExportedFunctionMangledNames())
|
212 | 185 | {
|
213 | 186 | auto moduleInst = nameToFunction[mangledName];
|
@@ -239,9 +212,6 @@ Module::precompileForTarget(SlangCompileTarget target, slang::IBlob** outDiagnos
|
239 | 212 | builder.setInsertInto(module);
|
240 | 213 |
|
241 | 214 | builder.emitEmbeddedDownstreamIR(targetReq->getTarget(), blob);
|
242 |
| - |
243 |
| - // Dump final IR after all transformations |
244 |
| - dumpIRIfEnabled(&codeGenContext, module, "PRECOMPILE_FOR_TARGET_COMPLETE_ALL"); |
245 | 215 | return SLANG_OK;
|
246 | 216 | }
|
247 | 217 |
|
|
0 commit comments