aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-05-03 20:48:53 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-05-03 20:48:53 -0700
commit66ed7a5eb51580fb8f02e16f16ccad31abe0bcc1 (patch)
tree1cd1dbe583a884695fa168cfeab79d30eefdd1bd /src/codegen.cpp
parent7f589c0cab105a79ff6d71233538dca8a39f8152 (diff)
downloadzig-66ed7a5eb51580fb8f02e16f16ccad31abe0bcc1.tar.gz
zig-66ed7a5eb51580fb8f02e16f16ccad31abe0bcc1.zip
beginnings of network standard library code
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 1112c7947f..6b691f1dd8 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -594,10 +594,14 @@ static LLVMValueRef gen_enum_value_expr(CodeGen *g, AstNode *node, TypeTableEntr
}
}
-static LLVMValueRef gen_widen_or_shorten(CodeGen *g, AstNode *source_node, TypeTableEntry *actual_type,
- TypeTableEntry *wanted_type, LLVMValueRef expr_val)
+static LLVMValueRef gen_widen_or_shorten(CodeGen *g, AstNode *source_node, TypeTableEntry *actual_type_non_canon,
+ TypeTableEntry *wanted_type_non_canon, LLVMValueRef expr_val)
{
+ TypeTableEntry *actual_type = get_underlying_type(actual_type_non_canon);
+ TypeTableEntry *wanted_type = get_underlying_type(wanted_type_non_canon);
+
assert(actual_type->id == wanted_type->id);
+
uint64_t actual_bits;
uint64_t wanted_bits;
if (actual_type->id == TypeTableEntryIdFloat) {