File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 1313 <Description >.NET Bindings for LLVM</Description >
1414 <PackageTags >LLVM,Compiler,JIT</PackageTags >
1515 <NoPackageAnalysis >true</NoPackageAnalysis >
16- <LangVersion >7.1 </LangVersion >
16+ <LangVersion >7.2 </LangVersion >
1717 </PropertyGroup >
1818 <ItemGroup >
1919 <Compile Remove =" obj\**" />
Original file line number Diff line number Diff line change @@ -46,29 +46,25 @@ public override string ToString( )
4646
4747 internal LLVMMetadataRef MetadataHandle { get ; /*protected*/ set ; }
4848
49- // ideally this would be protected AND internal but C#
50- // doesn't have any syntax to allow such a thing on a constructor
51- // so it is internal and internal code should ensure it is
52- // only ever used by derived type constructors
53- /*protected*/ internal LlvmMetadata ( LLVMMetadataRef handle )
49+ internal static T FromHandle < T > ( Context context , LLVMMetadataRef handle )
50+ where T : LlvmMetadata
5451 {
5552 if ( handle == default )
5653 {
57- throw new ArgumentNullException ( nameof ( handle ) ) ;
54+ return null ;
5855 }
5956
60- MetadataHandle = handle ;
57+ return ( T ) context . GetNodeFor ( handle , StaticFactory ) ;
6158 }
6259
63- internal static T FromHandle < T > ( Context context , LLVMMetadataRef handle )
64- where T : LlvmMetadata
60+ private protected LlvmMetadata ( LLVMMetadataRef handle )
6561 {
6662 if ( handle == default )
6763 {
68- return null ;
64+ throw new ArgumentNullException ( nameof ( handle ) ) ;
6965 }
7066
71- return ( T ) context . GetNodeFor ( handle , StaticFactory ) ;
67+ MetadataHandle = handle ;
7268 }
7369
7470 /// <summary>Enumeration to define debug information metadata nodes</summary>
You can’t perform that action at this time.
0 commit comments