diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-01-24 01:58:20 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-01-24 02:02:48 -0500 |
| commit | 4b3f18de3c5746b2ecfd6183351913de0909a83b (patch) | |
| tree | e3d0d56fcd8c00d994a13c4d69d60f0ab28fe389 /src/codegen.cpp | |
| parent | 32d8686da80d282e8cd6d84a0e5c331d269a1f69 (diff) | |
| download | zig-4b3f18de3c5746b2ecfd6183351913de0909a83b.tar.gz zig-4b3f18de3c5746b2ecfd6183351913de0909a83b.zip | |
printf var args proof of concept
See #167
Need to troubleshoot when we send 2 slices to printf. It goes
into an infinite loop.
This commit introduces 4 builtin functions:
* `@isInteger`
* `@isFloat`
* `@canImplictCast`
* `@typeName`
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 29508a326e..9595fdefe9 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2279,6 +2279,9 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, case IrInstructionIdTestComptime: case IrInstructionIdGeneratedCode: case IrInstructionIdCheckSwitchProngs: + case IrInstructionIdTestType: + case IrInstructionIdTypeName: + case IrInstructionIdCanImplicitCast: zig_unreachable(); case IrInstructionIdReturn: return ir_render_return(g, executable, (IrInstructionReturn *)instruction); @@ -3652,6 +3655,10 @@ static void define_builtin_fns(CodeGen *g) { create_builtin_fn(g, BuiltinFnIdImport, "import", 1); create_builtin_fn(g, BuiltinFnIdCImport, "cImport", 1); create_builtin_fn(g, BuiltinFnIdErrName, "errorName", 1); + create_builtin_fn(g, BuiltinFnIdTypeName, "typeName", 1); + create_builtin_fn(g, BuiltinFnIdIsInteger, "isInteger", 1); + create_builtin_fn(g, BuiltinFnIdIsFloat, "isFloat", 1); + create_builtin_fn(g, BuiltinFnIdCanImplicitCast, "canImplicitCast", 2); create_builtin_fn(g, BuiltinFnIdEmbedFile, "embedFile", 1); create_builtin_fn(g, BuiltinFnIdCmpExchange, "cmpxchg", 5); create_builtin_fn(g, BuiltinFnIdFence, "fence", 1); |
