Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Issue 770853002: Fix error reporting in the PNaCl bitcode reader. (Closed)

Created:
6 years ago by Karl
Modified:
6 years ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Visibility:
Public.

Description

Fix error reporting in the PNaCl bitcode reader. When LLVM 3.5 was merged, the handling of errors was not fixed. The effect is that error messages do not percolate up to the top-level routines (Which expect: ErrorOr<Module*>). Rather, pnacl-llc (and similar reading tools) core dump if there is an error in the bitcode file. This CL fixes this issue. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4006 R=jvoung@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-llvm.git;a=commit;h=12f562956efe164da47f3134eff27b56e4f56174

Patch Set 1 #

Patch Set 2 : Fix nits. #

Total comments: 49

Patch Set 3 : Fix issues and add test case. #

Total comments: 16

Patch Set 4 : Fix issues in patch set 3. #

Patch Set 5 : Fix issue in patch set 3. #

Patch Set 6 : Fix typo. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+723 lines, -377 lines) Patch
M include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h View 1 2 3 6 chunks +107 lines, -66 lines 0 comments Download
M include/llvm/Bitcode/NaCl/NaClReaderWriter.h View 1 2 3 chunks +25 lines, -18 lines 0 comments Download
M include/llvm/IRReader/IRReader.h View 1 2 2 chunks +13 lines, -5 lines 0 comments Download
M lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h View 1 2 6 chunks +51 lines, -28 lines 0 comments Download
M lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp View 1 2 68 chunks +310 lines, -208 lines 0 comments Download
M lib/Bitcode/NaCl/TestUtils/NaClBitcodeMunge.cpp View 1 2 4 chunks +53 lines, -15 lines 0 comments Download
M lib/IRReader/IRReader.cpp View 1 2 3 chunks +9 lines, -6 lines 0 comments Download
M tools/llvm-dis/llvm-dis.cpp View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download
M tools/llvm-nm/llvm-nm.cpp View 1 2 3 2 chunks +14 lines, -5 lines 0 comments Download
M tools/pnacl-abicheck/pnacl-abicheck.cpp View 1 2 2 chunks +11 lines, -1 line 0 comments Download
M tools/pnacl-benchmark/pnacl-benchmark.cpp View 1 2 2 chunks +8 lines, -1 line 0 comments Download
M tools/pnacl-llc/pnacl-llc.cpp View 1 2 3 4 5 2 chunks +8 lines, -3 lines 0 comments Download
M tools/pnacl-thaw/pnacl-thaw.cpp View 1 2 2 chunks +9 lines, -1 line 0 comments Download
M unittests/Bitcode/CMakeLists.txt View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M unittests/Bitcode/NaClObjDumpTypesTest.cpp View 1 2 18 chunks +18 lines, -18 lines 0 comments Download
A unittests/Bitcode/NaClParseTypesTest.cpp View 1 2 3 1 chunk +82 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (1 generated)
Karl
6 years ago (2014-12-01 21:09:16 UTC) #2
jvoung (off chromium)
Was there a way to make a lit or unittest? I guess NaClBitcodeMunge only unittests ...
6 years ago (2014-12-01 23:23:50 UTC) #3
JF
https://codereview.chromium.org/770853002/diff/2/include/llvm/Bitcode/NaCl/NaClReaderWriter.h File include/llvm/Bitcode/NaCl/NaClReaderWriter.h (right): https://codereview.chromium.org/770853002/diff/2/include/llvm/Bitcode/NaCl/NaClReaderWriter.h#newcode82 include/llvm/Bitcode/NaCl/NaClReaderWriter.h:82: /// returning the module. If an error_code if error ...
6 years ago (2014-12-02 00:49:04 UTC) #4
Karl
I also modified NaClBitcodeMunge.{h,cpp} to be able to test parsing errors, and added a simple ...
6 years ago (2014-12-03 18:32:10 UTC) #5
jvoung (off chromium)
A couple of nits, but looks pretty good, thanks! https://codereview.chromium.org/770853002/diff/30001/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h File include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h (right): https://codereview.chromium.org/770853002/diff/30001/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h#newcode99 include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h:99: ...
6 years ago (2014-12-03 19:43:47 UTC) #6
Karl
https://codereview.chromium.org/770853002/diff/30001/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h File include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h (right): https://codereview.chromium.org/770853002/diff/30001/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h#newcode99 include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h:99: /// Returns the resulting string generated by NaClObjDump. On ...
6 years ago (2014-12-03 20:53:44 UTC) #7
jvoung (off chromium)
https://codereview.chromium.org/770853002/diff/30001/tools/pnacl-llc/pnacl-llc.cpp File tools/pnacl-llc/pnacl-llc.cpp (right): https://codereview.chromium.org/770853002/diff/30001/tools/pnacl-llc/pnacl-llc.cpp#newcode335 tools/pnacl-llc/pnacl-llc.cpp:335: raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr; On ...
6 years ago (2014-12-03 22:11:13 UTC) #8
Karl
https://codereview.chromium.org/770853002/diff/30001/tools/pnacl-llc/pnacl-llc.cpp File tools/pnacl-llc/pnacl-llc.cpp (right): https://codereview.chromium.org/770853002/diff/30001/tools/pnacl-llc/pnacl-llc.cpp#newcode335 tools/pnacl-llc/pnacl-llc.cpp:335: raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr; On ...
6 years ago (2014-12-03 22:28:51 UTC) #9
Karl
Fixed typo (used VerboseStrm instead of &VerboseStrm in pnacl-llc.cpp).
6 years ago (2014-12-03 22:32:53 UTC) #10
jvoung (off chromium)
LGTM
6 years ago (2014-12-03 22:34:14 UTC) #11
Karl
6 years ago (2014-12-03 22:47:40 UTC) #12
Message was sent while issue was closed.
Committed patchset #6 (id:90001) manually as
12f562956efe164da47f3134eff27b56e4f56174 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698