ponyc
ponyc copied to clipboard
Make the `verify` pass on by default
As we slowly move towards Pony 1.0.0, fixing issues in LLVM IR generation is an important consideration. We've turned on LLVM IR generation verification as a default in the compiler.
Hopefully this will generate reports for failures that are currently hidden in the wild.
Two of our runner tests currently fail verification. We'll need to fix those (and other errors that might be hidden by those failures) before this is merged.
Suggested change to make verification failure more friendly and make people aware that they can turn it off if they run into an error:
diff --git a/src/libponyc/codegen/genopt.cc b/src/libponyc/codegen/genopt.cc
index 970e43fc..0761075d 100644
--- a/src/libponyc/codegen/genopt.cc
+++ b/src/libponyc/codegen/genopt.cc
@@ -1446,6 +1446,8 @@ bool genopt(compile_t* c, bool pony_specific)
if(LLVMVerifyModule(c->module, LLVMPrintMessageAction, &msg) != 0)
{
errorf(errors, NULL, "Module verification failed: %s", msg);
+ errorf_continue(errors, NULL,
+ "Please file an issue ticket. Use --noverify to bypass this error.");
LLVMDisposeMessage(msg);
return false;
}
@jemc added.
This shouldnt be merged until we fix all the associated issues that cause CI to fail.
I've rebased this against main. I assume it will still fail CI, but we can at least see where we are at with this.
The only test failing (at least on the Linux build that I checked) is the full program test named with-return - it's getting the IR verification error that there is a "Terminator found in the middle of a basic block!".
We need to fix something about the interaction of an explicit return inside a with block. Should be fairly simple I think?
We need to fix something about the interaction of an explicit return inside a with block. Should be fairly simple I think?
Well, maybe? the issue is, we wouldn't want both returns if they end up together, but a return from a with is perfectly fine the issue is that it is the last statement and our "no explicit return except early doesn't cover this"
We are going to remove the with-return test for now as it is flawed. See #4464.
This is looking good, but I don't want to merge yet. I want to get a release that solves #4454