-
Notifications
You must be signed in to change notification settings - Fork 10
/
MetadataAsValue.cs
39 lines (34 loc) · 1.25 KB
/
MetadataAsValue.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
38
39
// -----------------------------------------------------------------------
// <copyright file="MetadataAsValue.cs" company="Ubiquity.NET Contributors">
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
using Ubiquity.NET.Llvm.Interop;
using Ubiquity.NET.Llvm.Values;
using static Ubiquity.NET.Llvm.Interop.NativeMethods;
namespace Ubiquity.NET.Llvm
{
/// <summary>Wraps metadata as a <see cref="Value"/></summary>
public class MetadataAsValue
: Value
{
internal MetadataAsValue( LLVMValueRef valueRef )
: base( valueRef )
{
}
internal static LLVMValueRef IsAMetadataAsValue( LLVMValueRef value )
{
return value == default
? value
: LibLLVMGetValueKind( value ) == LibLLVMValueKind.MetadataAsValueKind ? value : default;
}
/*
//public static implicit operator Metadata( MetadataAsValue self )
//{
// // TODO: Add support to get the metadata ref from the value...
// // e.g. call C++ MetadataAsValue.getMetadata()
// throw new NotImplementedException();
//}
*/
}
}