-
Notifications
You must be signed in to change notification settings - Fork 10
/
PassManager.cs
37 lines (30 loc) · 1.05 KB
/
PassManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// -----------------------------------------------------------------------
// <copyright file="PassManager.cs" company="Ubiquity.NET Contributors">
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
using System.Collections.Generic;
using Ubiquity.NET.Llvm.Interop;
namespace Ubiquity.NET.Llvm.Transforms
{
/// <summary>Common base class for pass managers</summary>
public class PassManager
: DisposableObject
{
internal PassManager( LLVMPassManagerRef handle )
{
Handle = handle;
}
internal LLVMPassManagerRef Handle { get; }
internal List<WrappedNativeCallback> NativeCallBacks { get; } = new List<WrappedNativeCallback>( );
/// <inheritdoc/>
protected override void Dispose( bool disposing )
{
foreach( var callback in NativeCallBacks )
{
callback.Dispose( );
}
Handle.Dispose( );
}
}
}