non-exiting diagnostic handler for LTO code generator

Gao, Yunzhong via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 19:02:09 PDT 2015


Hi Rafael,

Writing a test with llvm-lto turns out to be slightly more tricky than I thought it would be. llvm-lto does something like:
  if (!CodeGen.addModule(Module.get()))
    return 1;
So with my patch, addModule() will no longer call exit(1) on errors in modules, but when it returns to the main()
function of llvm-lto, it silently returns 1, and I cannot distinguish between exit(1) and "return 1" within lit. My
current attempt (attached) is to make llvm-lto print an extra message before returning 1, so that lit can FileCheck
that. Is this acceptable? I think it does make llvm-lto print excessive diagnostics, but hopefully llvm-lto is used only
for testing and therefore it does not matter,

- Gao


________________________________________
From: Rafael EspĂ­ndola [rafael.espindola at gmail.com]
Sent: Wednesday, September 09, 2015 5:33 AM
To: Gao, Yunzhong
Cc: Duncan P. N. Exon Smith (dexonsmith at apple.com); Peter Collingbourne (peter at pcc.me.uk); llvm-commits at lists.llvm.org
Subject: Re: non-exiting diagnostic handler for LTO code generator

I think the included patch is correct. You should be able to write a
test for it with llvm-lto, no?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto.patch
Type: text/x-patch
Size: 2597 bytes
Desc: lto.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150911/f8fe6eb1/attachment.bin>


More information about the llvm-commits mailing list