コード例 #1
0
        internal static BitcodeModule FromHandle(LLVMModuleRef nativeHandle)
        {
            var     contextRef = nativeHandle.Context;
            Context context    = ContextCache.GetContextFor(contextRef);

            return(context.GetModuleFor(nativeHandle));
        }
コード例 #2
0
ファイル: Context.cs プロジェクト: stjordanis/Llvm.NET-1
 /// <summary>Initializes a new instance of the <see cref="Context"/> class.Creates a new context</summary>
 public Context( )
     : this(LLVMContextCreate( ))
 {
     ContextCache.Add(this);
 }
コード例 #3
0
 private BitcodeModule(LLVMModuleRef handle)
 {
     ModuleHandle = handle;
     Context      = ContextCache.GetContextFor(handle.Context);
 }
コード例 #4
0
        private static Context GetMeatadataContext(LLVMMetadataRef metadataHandle)
        {
            var hContext = LibLLVMGetNodeContext(metadataHandle).ThrowIfInvalid() !;

            return(ContextCache.GetContextFor(hContext));
        }