예제 #1
0
        protected override LLVMValueRef ValueAsTypeInternal(LLVMTypeRef type, LLVMBuilderRef builder, bool signExtend)
        {
            LLVMTypeRef  origLLVMType = ILImporter.GetLLVMTypeForTypeDesc(Type);
            LLVMValueRef value        = _importer.LoadTemp(LocalIndex, origLLVMType);

            return(ILImporter.CastIfNecessary(builder, value, type));
        }
예제 #2
0
        protected override LLVMValueRef ValueAsTypeInternal(LLVMTypeRef type, LLVMBuilderRef builder, bool signExtend)
        {
            if (RawLLVMValue.Pointer == IntPtr.Zero)
                throw new NullReferenceException();

            return ILImporter.CastIfNecessary(builder, RawLLVMValue, type, Name);
        }
예제 #3
0
 protected override LLVMValueRef ValueAsTypeInternal(LLVMTypeRef type, LLVMBuilderRef builder, bool signExtend)
 {
     if (type.IsPackedStruct && type.Handle != RawLLVMValue.TypeOf.Handle)
     {
         var destStruct = type.Undef;
         for (uint elemNo = 0; elemNo < RawLLVMValue.TypeOf.StructElementTypesCount; elemNo++)
         {
             var elemValRef = builder.BuildExtractValue(RawLLVMValue, 0, "ex" + elemNo);
             destStruct = builder.BuildInsertValue(destStruct, elemValRef, elemNo, "st" + elemNo);
         }
         return(destStruct);
     }
     return(ILImporter.CastIfNecessary(builder, RawLLVMValue, type, Name, !signExtend));
 }
예제 #4
0
 protected override LLVMValueRef ValueAsTypeInternal(LLVMTypeRef type, LLVMBuilderRef builder, bool signExtend)
 {
     return(ILImporter.CastIfNecessary(builder, RawLLVMValue, type));
 }
예제 #5
0
 protected override LLVMValueRef ValueAsTypeInternal(LLVMTypeRef type, LLVMBuilderRef builder, bool signExtend)
 {
     //TODO: deal with sign extension here
     return(ILImporter.CastIfNecessary(builder, RawLLVMValue, type, Name));
 }