Clearer error messages for BitcodeEmitter.
This commit is contained in:
parent
287d543b34
commit
6df0801d35
|
@ -368,9 +368,11 @@ bool BitcodeEmitter::emit(FunctionCall const& node) {
|
||||||
|
|
||||||
if (callee->arg_size() != node.getArgs().size()) {
|
if (callee->arg_size() != node.getArgs().size()) {
|
||||||
return reportError({
|
return reportError({
|
||||||
"Argument number mismatch, expected",
|
"Argument number mismatch in call of",
|
||||||
std::to_string(callee->arg_size()),
|
node.getName().getValue() + "()",
|
||||||
"given", std::to_string(node.getArgs().size())
|
"expected",
|
||||||
|
std::to_string(callee->arg_size()), "required",
|
||||||
|
std::to_string(node.getArgs().size()), "given"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +479,8 @@ bool BitcodeEmitter::emitFunctionPrototype(Function const& node, llvm::Function
|
||||||
|
|
||||||
if (func->arg_size() != node.getArgs().size()) {
|
if (func->arg_size() != node.getArgs().size()) {
|
||||||
return reportError({
|
return reportError({
|
||||||
"Argument number mismatch in definition vs declaration,",
|
"Argument number mismatch in definition vs declaration of",
|
||||||
|
node.getName().getValue() + "()",
|
||||||
"expected", std::to_string(func->arg_size()),
|
"expected", std::to_string(func->arg_size()),
|
||||||
"given", std::to_string(node.getArgs().size())
|
"given", std::to_string(node.getArgs().size())
|
||||||
});
|
});
|
||||||
|
|
Reference in New Issue
Block a user