Пример #1
0
        public static void AddIncoming(LLVMValueRef PhiNode, LLVMValueRef[] IncomingValues, LLVMBasicBlockRef[] IncomingBlocks, uint Count)
        {
            if (Count == 0)
            {
                return;
            }

            AddIncoming(PhiNode, out IncomingValues[0], out IncomingBlocks[0], Count);
        }
Пример #2
0
 public FnCompiler(DetailLogger log, SymbolTableWalker walker,
     LLVMContextRef context, LLVMModuleRef module, LLVMBuilderRef builder, LLVMValueRef self)
 {
     this.log = log;
     this.walker = walker;
     this.context = context;
     this.module = module;
     this.builder = builder;
     this.self = self;
 }
Пример #3
0
        public static LLVMValueRef BuildInBoundsGEP(LLVMBuilderRef B, LLVMValueRef Pointer, LLVMValueRef[] Indices, string Name)
        {
            if (Indices.Length == 0)
            {
                LLVMValueRef dummy;
                return BuildInBoundsGEP(B, Pointer, out dummy, 0, Name);
            }

            return BuildInBoundsGEP(B, Pointer, out Indices[0], (uint)Indices.Length, Name);
        }
Пример #4
0
        public static LLVMValueRef ConstArray(LLVMTypeRef ElementTy, LLVMValueRef[] ConstantVals)
        {
            if (ConstantVals.Length == 0)
            {
                LLVMValueRef dummy;
                return ConstArray(ElementTy, out dummy, 0);
            }

            return ConstArray(ElementTy, out ConstantVals[0], (uint)ConstantVals.Length);
        }
Пример #5
0
        public static LLVMValueRef BuildInvoke(LLVMBuilderRef param0, LLVMValueRef Fn, LLVMValueRef[] Args, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, string Name)
        {
            if (Args.Length == 0)
            {
                LLVMValueRef dummy;
                return BuildInvoke(param0, Fn, out dummy, 0, Then, Catch, Name);
            }

            return BuildInvoke(param0, Fn, out Args[0], (uint)Args.Length, Then, Catch, Name);
        }
Пример #6
0
        public static LLVMValueRef ConstExtractValue(LLVMValueRef AggConstant, uint[] IdxList)
        {
            if (IdxList.Length == 0)
            {
                uint dummy;
                return ConstExtractValue(AggConstant, out dummy, 0);
            }

            return ConstExtractValue(AggConstant, out IdxList[0], (uint)IdxList.Length);
        }
Пример #7
0
        public void SetLLVMRegister(string variableName, ClepsType variableType, LLVMValueRef llvmValueRef)
        {
            var localVariablesBlockWithVar = LocalVariableBlocks.Where(b => b.ContainsKey(variableName)).LastOrDefault();
            Debug.Assert(localVariablesBlockWithVar != null);
            
            LLVMRegister ret = localVariablesBlockWithVar[variableName];
            Debug.Assert(ret.VariableType == variableType);

            localVariablesBlockWithVar[variableName] = new LLVMRegister(variableType, llvmValueRef);
        }
Пример #8
0
        public static LLVMValueRef BuildCall(LLVMBuilderRef param0, LLVMValueRef Fn, LLVMValueRef[] Args, string Name)
        {
            if (Args.Length == 0)
            {
                LLVMValueRef dummy;
                return BuildCall(param0, Fn, out dummy, 0, Name);
            }

            return BuildCall(param0, Fn, out Args[0], (uint)Args.Length, Name);
        }
Пример #9
0
        public static LLVMValueRef MDNode(LLVMValueRef[] Vals)
        {
            if (Vals.Length == 0)
            {
                LLVMValueRef dummy;
                return MDNode(out dummy, 0);
            }

            return MDNode(out Vals[0], (uint)Vals.Length);
        }
Пример #10
0
        public static LLVMValueRef[] GetMDNodeOperands(LLVMValueRef V)
        {
            uint count = GetMDNodeNumOperands(V);
            var buffer = new LLVMValueRef[count];

            if (count > 0)
            {
                GetMDNodeOperands(V, out buffer[0]);
            }

            return buffer;
        }
Пример #11
0
        public static LLVMValueRef[] GetParams(LLVMValueRef Fn)
        {
            uint count = CountParams(Fn);
            var buffer = new LLVMValueRef[count];

            if (count > 0)
            {
                GetParams(Fn, out buffer[0]);
            }

            return buffer;
        }
Пример #12
0
 internal ReturnInst(LLVMValueRef handle) : base(handle.IsAReturnInst)
 {
 }
Пример #13
0
 public LLVMGenericValueRef RunFunction(LLVMValueRef @F, LLVMGenericValueRef[] @Args)
 {
     return(LLVM.RunFunction(this.instance, @F, @Args));
 }
Пример #14
0
 public LLVMBasicBlockRef AppendBasicBlockInContext(LLVMValueRef @Fn, string @Name)
 {
     return LLVM.AppendBasicBlockInContext(this, @Fn, @Name);
 }
Пример #15
0
 public int RunFunctionAsMain(LLVMValueRef @F, uint @ArgC, string[] @ArgV, string[] @EnvP)
 {
     return LLVM.RunFunctionAsMain(this.instance, @F, @ArgC, @ArgV, @EnvP);
 }
Пример #16
0
 public static extern LLVMValueRef DIBuilderInsertDeclareAtEnd(LLVMDIBuilderRef @D, LLVMValueRef @Storage, LLVMMetadataRef @VarInfo, LLVMMetadataRef @Expr, LLVMBasicBlockRef @Block);
Пример #17
0
 public static extern LLVMValueRef DIBuilderInsertValueAtEnd(LLVMDIBuilderRef @D, LLVMValueRef @Val, ulong @Offset, LLVMMetadataRef @VarInfo, LLVMMetadataRef @Expr, LLVMBasicBlockRef @Block);
Пример #18
0
 private protected UnaryInstruction(LLVMValueRef handle) : base(handle.IsAUnaryInstruction)
 {
 }
Пример #19
0
 internal BitCastInst(LLVMValueRef handle) : base(handle.IsABitCastInst)
 {
 }
Пример #20
0
 internal static new UnaryInstruction Create(LLVMValueRef handle) => handle switch
 {
Пример #21
0
 public bool FindFunction(string @Name, out LLVMValueRef @OutFn)
 {
     return(LLVM.FindFunction(this.instance, @Name, out @OutFn));
 }
Пример #22
0
 public void FreeMachineCodeForFunction(LLVMValueRef @F)
 {
     LLVM.FreeMachineCodeForFunction(this.instance, @F);
 }
Пример #23
0
 public IntPtr GetPointerToGlobal(LLVMValueRef @Global)
 {
     return(LLVM.GetPointerToGlobal(this.instance, @Global));
 }
Пример #24
0
 public static extern ulong GetFunctionAttr2(LLVMValueRef @Fn);
Пример #25
0
 internal FenceInst(LLVMValueRef handle) : base(handle.IsAFenceInst)
 {
 }
Пример #26
0
 public static extern void RemoveFunctionAttr2(LLVMValueRef @Fn, ulong @PA);
Пример #27
0
 public IntPtr RecompileAndRelinkFunction(LLVMValueRef @Fn)
 {
     return LLVM.RecompileAndRelinkFunction(this.instance, @Fn);
 }
Пример #28
0
        public static LLVMValueRef ConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef[] ConstantVals)
        {
            if (ConstantVals.Length == 0)
            {
                LLVMValueRef dummy;
                return ConstNamedStruct(StructTy, out dummy, 0);
            }

            return ConstNamedStruct(StructTy, out ConstantVals[0], (uint)ConstantVals.Length);
        }
Пример #29
0
 public bool FindFunction(string @Name, out LLVMValueRef @OutFn)
 {
     return LLVM.FindFunction(this.instance, @Name, out @OutFn);
 }
Пример #30
0
        public static LLVMValueRef ConstVector(LLVMValueRef[] ScalarConstantVars)
        {
            if (ScalarConstantVars.Length == 0)
            {
                LLVMValueRef dummy;
                return ConstVector(out dummy, 0);
            }

            return ConstVector(out ScalarConstantVars[0], (uint)ScalarConstantVars.Length);
        }
Пример #31
0
 public static extern LLVMMetadataRef ConstantAsMetadata(LLVMValueRef @Val);
Пример #32
0
 public int RunFunctionAsMain(LLVMValueRef @F, uint @ArgC, string[] @ArgV, string[] @EnvP)
 {
     return(LLVM.RunFunctionAsMain(this.instance, @F, @ArgC, @ArgV, @EnvP));
 }
Пример #33
0
        public static LLVMValueRef ConstStructInContext(LLVMContextRef C, LLVMValueRef[] ConstantVals, bool Packed)
        {
            if (ConstantVals.Length == 0)
            {
                LLVMValueRef dummy;
                return ConstStructInContext(C, out dummy, 0, Packed);
            }

            return ConstStructInContext(C, out ConstantVals[0], (uint)ConstantVals.Length, Packed);
        }
Пример #34
0
 public static extern void SetMetadata2(LLVMValueRef @Inst, uint @KindID, LLVMMetadataRef @MD);
Пример #35
0
 public static LLVMValueRef BuildAggregateRet(LLVMBuilderRef param0, LLVMValueRef[] RetVals)
 {
     return BuildAggregateRet(param0, out RetVals[0], (uint)RetVals.Length);
 }
Пример #36
0
 public static extern LLVMMetadataRef DIBuilderCreateFunction(LLVMDIBuilderRef @D, LLVMMetadataRef @Scope, [MarshalAs(UnmanagedType.LPStr)] string @Name, [MarshalAs(UnmanagedType.LPStr)] string @LinkageName, LLVMMetadataRef @File, uint @Line, LLVMMetadataRef @CompositeType, int @IsLocalToUnit, int @IsDefinition, uint @ScopeLine, uint @Flags, int @IsOptimized, LLVMValueRef @Function);
Пример #37
0
        public static LLVMValueRef[] GetNamedMetadataOperands(LLVMModuleRef M, string name)
        {
            uint count = GetNamedMetadataNumOperands(M, name);
            var buffer = new LLVMValueRef[count];

            if (count > 0)
            {
                GetNamedMetadataOperands(M, name, out buffer[0]);
            }

            return buffer;
        }
Пример #38
0
 internal static new CmpInst Create(LLVMValueRef handle) => handle switch
 {
Пример #39
0
        public static LLVMGenericValueRef RunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F, LLVMGenericValueRef[] Args)
        {
            if (Args.Length == 0)
            {
                LLVMGenericValueRef dummy;
                return RunFunction(EE, F, 0, out dummy);
            }

            return RunFunction(EE, F, (uint)Args.Length, out Args[0]);
        }
Пример #40
0
 public IntPtr RecompileAndRelinkFunction(LLVMValueRef @Fn)
 {
     return(LLVM.RecompileAndRelinkFunction(this.instance, @Fn));
 }
Пример #41
0
        public static LLVMValueRef MDNodeInContext(LLVMContextRef C, LLVMValueRef[] Vals)
        {
            if (Vals.Length == 0)
            {
                LLVMValueRef dummy;
                return MDNodeInContext(C, out dummy, 0);
            }

            return MDNodeInContext(C, out Vals[0], (uint)Vals.Length);
        }
Пример #42
0
 public void AddGlobalMapping(LLVMValueRef @Global, IntPtr @Addr)
 {
     LLVM.AddGlobalMapping(this.instance, @Global, @Addr);
 }
Пример #43
0
 private protected CmpInst(LLVMValueRef handle) : base(handle.IsACmpInst)
 {
 }
Пример #44
0
 internal ConstantInt(LLVMValueRef handle) : base(handle.IsAConstantInt, LLVMValueKind.LLVMConstantIntValueKind)
 {
 }
Пример #45
0
        public static LLVMValueRef ConstGEP(LLVMValueRef ConstantVal, LLVMValueRef[] ConstantIndices)
        {
            if (ConstantIndices.Length == 0)
            {
                LLVMValueRef dummy;
                return ConstGEP(ConstantVal, out dummy, 0);
            }

            return ConstGEP(ConstantVal, out ConstantIndices[0], (uint)ConstantIndices.Length);
        }
Пример #46
0
 public LLVMValueRef MDNodeInContext(LLVMValueRef[] @Vals)
 {
     return LLVM.MDNodeInContext(this, @Vals);
 }
Пример #47
0
 internal LoadInst(LLVMValueRef handle) : base(handle.IsALoadInst)
 {
 }
Пример #48
0
 internal GlobalIFunc(LLVMValueRef handle) : base(handle.IsAGlobalIFunc, LLVMValueKind.LLVMGlobalIFuncValueKind)
 {
 }
Пример #49
0
 public ScoreVal(Span span, TyRef ty, LLVMValueRef value)
 {
     this.ty = ty;
     this.value = value;
 }
Пример #50
0
 internal Function(LLVMValueRef handle) : base(handle.IsAFunction, LLVMValueKind.LLVMFunctionValueKind)
 {
 }
Пример #51
0
 public LLVMValueRef ConstStructInContext(LLVMValueRef[] @ConstantVals, bool @Packed)
 {
     return LLVM.ConstStructInContext(this, @ConstantVals, @Packed);
 }
Пример #52
0
 internal BlockAddress(LLVMValueRef handle) : base(handle.IsABlockAddress, LLVMValueKind.LLVMBlockAddressValueKind)
 {
 }
Пример #53
0
 public IntPtr GetPointerToGlobal(LLVMValueRef @Global)
 {
     return LLVM.GetPointerToGlobal(this.instance, @Global);
 }
Пример #54
0
 internal InsertElementInst(LLVMValueRef handle) : base(handle.IsAInsertElementInst)
 {
 }
Пример #55
0
 public LLVMGenericValueRef RunFunction(LLVMValueRef @F, LLVMGenericValueRef[] @Args)
 {
     return LLVM.RunFunction(this.instance, @F, @Args);
 }
Пример #56
0
 internal ConstantDataArray(LLVMValueRef handle) : base(handle.IsAConstantDataArray, LLVMValueKind.LLVMConstantDataArrayValueKind)
 {
 }
Пример #57
0
 public void AddGlobalMapping(LLVMValueRef @Global, IntPtr @Addr)
 {
     LLVM.AddGlobalMapping(this.instance, @Global, @Addr);
 }
Пример #58
0
 public Int32CompilerResult(LLVMValueRef reference)
 {
     this.reference = reference;
 }
Пример #59
0
 public void FreeMachineCodeForFunction(LLVMValueRef @F)
 {
     LLVM.FreeMachineCodeForFunction(this.instance, @F);
 }
Пример #60
0
 internal AtomicCmpXchgInst(LLVMValueRef handle) : base(handle.IsAAtomicCmpXchgInst)
 {
 }