bool ICodeGenElementVisitor <bool> .VisitBuildVariant(BuildVariant buildVariant) { LLVMValueRef variantAddress = _codeGenValues[buildVariant.VariantAddressIndex], variantTagFieldPtr = Builder.CreateStructGEP(variantAddress, 0u, "variantTagFieldPtr"), variantDataFieldPtr = Builder.CreateStructGEP(variantAddress, 1u, "variantDataFieldPtr"), inputValue = _codeGenValues[buildVariant.FieldValueIndex], bitCastAllocaFieldPtr = Builder.CreateBitCast(variantDataFieldPtr, LLVMTypeRef.PointerType(inputValue.TypeOf(), 0u), "bitCastAllocaFieldPtr"); Builder.CreateStore(Context.AsLLVMValue((byte)buildVariant.FieldIndex), variantTagFieldPtr); Builder.CreateStore(inputValue, bitCastAllocaFieldPtr); return(true); }
public void CreateVariant(IBuildVariant parentBuildVariant = null) { var variant = new BuildVariant { VariantName = "New variant", Guid = System.Guid.NewGuid().ToString() }; SetVariantParent(variant, parentBuildVariant == null ? "" : parentBuildVariant.Guid); _buildInfoController.ActivateBuildVariant(variant); _buildInfoController.SelectBuildVariant(variant); _buildVariants.Add(variant); SaveVariant(variant); }