@@ -146,14 +146,9 @@ private void DoAnalyseReferenceAssembly(PortableExecutableReference r)
146
146
* still be correct.
147
147
*/
148
148
149
- // compilation.Clone() reduces memory footprint by allowing the symbols
150
- // in c to be garbage collected.
151
- Compilation c = compilation . Clone ( ) ;
152
-
153
-
154
- if ( c . GetAssemblyOrModuleSymbol ( r ) is IAssemblySymbol assembly )
149
+ if ( compilation . GetAssemblyOrModuleSymbol ( r ) is IAssemblySymbol assembly )
155
150
{
156
- var cx = new Context ( extractor , c , trapWriter , new AssemblyScope ( assembly , assemblyPath ) , addAssemblyTrapPrefix ) ;
151
+ var cx = new Context ( extractor , compilation , trapWriter , new AssemblyScope ( assembly , assemblyPath ) , addAssemblyTrapPrefix ) ;
157
152
158
153
foreach ( var module in assembly . Modules )
159
154
{
@@ -196,7 +191,7 @@ private void DoExtractTree(SyntaxTree tree)
196
191
197
192
if ( ! upToDate )
198
193
{
199
- var cx = new Context ( extractor , compilation . Clone ( ) , trapWriter , new SourceScope ( tree ) , addAssemblyTrapPrefix ) ;
194
+ var cx = new Context ( extractor , compilation , trapWriter , new SourceScope ( tree ) , addAssemblyTrapPrefix ) ;
200
195
// Ensure that the file itself is populated in case the source file is totally empty
201
196
var root = tree . GetRoot ( ) ;
202
197
Entities . File . Create ( cx , root . SyntaxTree . FilePath ) ;
@@ -236,7 +231,7 @@ private void DoAnalyseCompilation()
236
231
var assembly = compilation . Assembly ;
237
232
var trapWriter = transformedAssemblyPath . CreateTrapWriter ( Logger , options . TrapCompression , discardDuplicates : false ) ;
238
233
compilationTrapFile = trapWriter ; // Dispose later
239
- var cx = new Context ( extractor , compilation . Clone ( ) , trapWriter , new AssemblyScope ( assembly , assemblyPath ) , addAssemblyTrapPrefix ) ;
234
+ var cx = new Context ( extractor , compilation , trapWriter , new AssemblyScope ( assembly , assemblyPath ) , addAssemblyTrapPrefix ) ;
240
235
241
236
compilationEntity = Entities . Compilation . Create ( cx ) ;
242
237
0 commit comments