Lines Matching defs:val
326 static LLVMValueRef constant_value(unsigned long long val, LLVMTypeRef dtype)
332 if (val != 0) { // for example: ... = (void*) 0x123;
334 result = LLVMConstInt(itype, val, 1);
341 result = LLVMConstInt(dtype, val, 1);
345 if (val != 0)
355 static LLVMValueRef val_to_value(unsigned long long val, struct symbol *ctype)
362 result = constant_value(val, dtype);
405 LLVMValueRef val = pseudo_to_value(fn, ctype, pseudo);
410 return LLVMBuildBitCast(fn->builder, val, dtype, name);
413 static LLVMValueRef value_to_ivalue(struct function *fn, struct symbol *ctype, LLVMValueRef val)
415 const char *name = LLVMGetValueName(val);
418 if (LLVMGetTypeKind(LLVMTypeOf(val)) == LLVMPointerTypeKind) {
420 val = LLVMBuildPtrToInt(fn->builder, val, dtype, name);
423 val = LLVMBuildIntCast(fn->builder, val, dtype, name);
425 return val;
428 static LLVMValueRef value_to_pvalue(struct function *fn, struct symbol *ctype, LLVMValueRef val)
430 const char *name = LLVMGetValueName(val);
434 switch (LLVMGetTypeKind(LLVMTypeOf(val))) {
436 val = LLVMBuildIntToPtr(fn->builder, val, dtype, name);
439 val = LLVMBuildBitCast(fn->builder, val, dtype, name);
444 return val;
447 static LLVMValueRef adjust_type(struct function *fn, struct symbol *ctype, LLVMValueRef val)
450 return value_to_ivalue(fn, ctype, val);
452 return value_to_pvalue(fn, ctype, val);
453 return val;
788 long long val;
790 for (val = jmp->begin; val <= jmp->end; val++) {
791 LLVMValueRef Val = val_to_value(val, insn->type);
945 struct expression *val = insn->val;
948 switch (val->type) {
950 target = LLVMBlockAddress(fn->fn, val->symbol->bb_target->priv);