diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-29 15:13:41 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-29 15:13:41 +0100 |
| commit | 001baf4419da9c43d4ef68d7ec1eac638d6fb742 (patch) | |
| tree | 5d685a869cee84487a860e616034ed1e2428f50d /src/ir_print.cpp | |
| parent | d167290b280c2dfcb764ff1e8f48df975444962d (diff) | |
Add `Type` -- Runtime type for comparing types (similar to TypeInfo but simpler)
Diffstat (limited to 'src/ir_print.cpp')
| -rw-r--r-- | src/ir_print.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp index b9bccc91c..c5456edf4 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -246,6 +246,7 @@ void ir_print_type(irFileBuffer *f, irModule *m, Type *t) { case Basic_uint: ir_fprintf(f, "i%lld", word_bits); return; case Basic_int: ir_fprintf(f, "i%lld", word_bits); return; case Basic_any: ir_fprintf(f, "%%..any"); return; + case Basic_Type: ir_fprintf(f, "%%..Type"); return; } break; case Type_Pointer: @@ -1691,6 +1692,11 @@ void print_llvm_ir(irGen *ir) { ir_print_type(f, m, t_type_info_ptr); ir_fprintf(f, "} ; Basic_any\n"); + ir_print_encoded_local(f, str_lit("..Type")); + ir_fprintf(f, " = type "); + ir_print_type(f, m, t_int); + ir_fprintf(f, " ; Basic_Type\n"); + ir_fprintf(f, "declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone \n"); ir_fprintf(f, "\n"); |