浏览代码

Early short circuit `lb_construct_const_union`

gingerBill 2 周之前
父节点
当前提交
a6d5ec2de8
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/llvm_backend_const.cpp

+ 3 - 4
src/llvm_backend_const.cpp

@@ -676,6 +676,9 @@ gb_internal LLVMValueRef lb_construct_const_union(lbModule *m, LLVMValueRef vari
 		}
 		}
 
 
 		return LLVMConstNamedStruct(llvm_type, values, i);
 		return LLVMConstNamedStruct(llvm_type, values, i);
+	} else if (true) {
+		// TODO(bill): ignore this for the time being
+		return nullptr;
 	}
 	}
 
 
 	LLVMTypeRef block_type = LLVMStructGetTypeAtIndex(llvm_type, 0);
 	LLVMTypeRef block_type = LLVMStructGetTypeAtIndex(llvm_type, 0);
@@ -701,10 +704,6 @@ gb_internal LLVMValueRef lb_construct_const_union(lbModule *m, LLVMValueRef vari
 	} else if (lb_sizeof(llvm_variant_type) == 0) {
 	} else if (lb_sizeof(llvm_variant_type) == 0) {
 		block_value = LLVMConstNull(block_type);
 		block_value = LLVMConstNull(block_type);
 	} else if (block_type != llvm_variant_type) {
 	} else if (block_type != llvm_variant_type) {
-		if (true) {
-			// TODO(bill): ignore this for the time being
-			return nullptr;
-		}
 
 
 		LLVMTypeKind block_kind   = LLVMGetTypeKind(block_type);
 		LLVMTypeKind block_kind   = LLVMGetTypeKind(block_type);
 		LLVMTypeKind variant_kind = LLVMGetTypeKind(llvm_variant_type);
 		LLVMTypeKind variant_kind = LLVMGetTypeKind(llvm_variant_type);