The problem fixed by commit
53c8d6c9 would have been noticed if we'd
been running LLVM's verify pass on generated IR. Doing so also reveals
a complaint about incorrect name mangling, fixed here. Only enabled for
LLVM 17+ because it uses the new pass manager API.
Suggested-by: Dmitry Dolgov <[email protected]>
Discussion: https://postgr.es/m/CAFj8pRACpVFr7LMdVYENUkScG5FCYMZDDdSGNU-tch%2Bw98OxYg%40mail.gmail.com
LLVMPassBuilderOptionsSetDebugLogging(options, 1);
#endif
+ /* In assertion builds, run the LLVM verify pass. */
+#ifdef USE_ASSERT_CHECKING
+ LLVMPassBuilderOptionsSetVerifyEach(options, true);
+#endif
+
LLVMPassBuilderOptionsSetInlinerThreshold(options, 512);
err = LLVMRunPasses(module, passes, NULL, options);
LLVMContextRef lc;
/* variadic pointer argument */
- const char *nm = "llvm.lifetime.end.p0i8";
+ const char *nm = "llvm.lifetime.end.p0";
fn = LLVMGetNamedFunction(mod, nm);
if (fn)