Merge pull request #554 from sapir/remove-void-func-debug-var
Remove dummy value locals for function ptr calls
This commit is contained in:
commit
2cc32badb4
@ -341,7 +341,7 @@ fn function_call(
|
|||||||
self.block
|
self.block
|
||||||
.add_eval(self.location, self.cx.context.new_call(self.location, func, &args));
|
.add_eval(self.location, self.cx.context.new_call(self.location, func, &args));
|
||||||
// Return dummy value when not having return value.
|
// Return dummy value when not having return value.
|
||||||
self.context.new_rvalue_from_long(self.isize_type, 0)
|
self.context.new_rvalue_zero(self.isize_type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,17 +421,7 @@ fn function_ptr_call(
|
|||||||
self.cx.context.new_call_through_ptr(self.location, func_ptr, &args),
|
self.cx.context.new_call_through_ptr(self.location, func_ptr, &args),
|
||||||
);
|
);
|
||||||
// Return dummy value when not having return value.
|
// Return dummy value when not having return value.
|
||||||
let result = current_func.new_local(
|
self.context.new_rvalue_zero(self.isize_type)
|
||||||
self.location,
|
|
||||||
self.isize_type,
|
|
||||||
"dummyValueThatShouldNeverBeUsed",
|
|
||||||
);
|
|
||||||
self.block.add_assignment(
|
|
||||||
self.location,
|
|
||||||
result,
|
|
||||||
self.context.new_rvalue_from_long(self.isize_type, 0),
|
|
||||||
);
|
|
||||||
result.to_rvalue()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user