llvm-6502/test/Bitcode
Rafael Espindola 68016e0a6e Use the DiagnosticHandler to print diagnostics when reading bitcode.
The bitcode reading interface used std::error_code to report an error to the
callers and it is the callers job to print diagnostics.

This is not ideal for error handling or diagnostic reporting:

* For error handling, all that the callers care about is 3 possibilities:
  * It worked
  * The bitcode file is corrupted/invalid.
  * The file is not bitcode at all.

* For diagnostic, it is user friendly to include far more information
  about the invalid case so the user can find out what is wrong with the
  bitcode file. This comes up, for example, when a developer introduces a
  bug while extending the format.

The compromise we had was to have a lot of error codes.

With this patch we use the DiagnosticHandler to communicate with the
human and std::error_code to communicate with the caller.

This allows us to have far fewer error codes and adds the infrastructure to
print better diagnostics. This is so because the diagnostics are printed when
he issue is found. The code that detected the problem in alive in the stack and
can pass down as much context as needed. As an example the patch updates
test/Bitcode/invalid.ll.

Using a DiagnosticHandler also moves the fatal/non-fatal error decision to the
caller. A simple one like llvm-dis can just use fatal errors. The gold plugin
needs a bit more complex treatment because of being passed non-bitcode files. An
hypothetical interactive tool would make all bitcode errors non-fatal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225562 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-10 00:07:30 +00:00
..
2006-12-11-Cast-ConstExpr.ll
2009-06-11-FirstClassAggregateConstant.ll
aggregateInstructions.3.2.ll
aggregateInstructions.3.2.ll.bc
arm32_neon_vcnt_upgrade.ll
atomic.ll
attributes-3.3.ll
attributes-3.3.ll.bc
attributes.ll
binaryFloatInstructions.3.2.ll
binaryFloatInstructions.3.2.ll.bc
binaryIntInstructions.3.2.ll
binaryIntInstructions.3.2.ll.bc
bitwiseInstructions.3.2.ll
bitwiseInstructions.3.2.ll.bc
blockaddress.ll
calling-conventions.3.2.ll Parse 'ghccc' in .ll files as the GHC convention (cc 10) 2014-12-01 21:04:44 +00:00
calling-conventions.3.2.ll.bc
case-ranges-3.3.ll
case-ranges-3.3.ll.bc
cmpxchg-upgrade.ll
cmpxchg-upgrade.ll.bc
constantsTest.3.2.ll Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
constantsTest.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
conversionInstructions.3.2.ll Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
conversionInstructions.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
drop-debug-info.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
extractelement.ll
flags.ll
function-encoding-rel-operands.ll
function-local-metadata.3.5.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
function-local-metadata.3.5.ll.bc IR: Fix bitcode compatability filenames 2014-12-08 00:41:39 +00:00
global-variables.3.2.ll
global-variables.3.2.ll.bc
highLevelStructure.3.2.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
highLevelStructure.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
inalloca.ll
invalid.ll Use the DiagnosticHandler to print diagnostics when reading bitcode. 2015-01-10 00:07:30 +00:00
invalid.ll.bc
linkage-types-3.2.ll Make this test a bit stricter. 2015-01-08 16:11:18 +00:00
linkage-types-3.2.ll.bc
local-linkage-default-visibility.3.4.ll
local-linkage-default-visibility.3.4.ll.bc
mdstring-high-bits.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
memInstructions.3.2.ll
memInstructions.3.2.ll.bc
metadata-2.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
metadata.3.5.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
metadata.3.5.ll.bc Bitcode: Add METADATA_NODE and METADATA_VALUE 2014-12-11 23:02:24 +00:00
metadata.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
miscInstructions.3.2.ll Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
miscInstructions.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
null-type.ll
null-type.ll.bc
old-aliases.ll
old-aliases.ll.bc
pr18704.ll
pr18704.ll.bc
ptest-new.ll
ptest-old.ll
select.ll
shuffle.ll
ssse3_palignr.ll
standardCIntrinsic.3.2.ll Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
standardCIntrinsic.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
tailcall.ll
terminatorInstructions.3.2.ll Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
terminatorInstructions.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
upgrade-global-ctors.ll
upgrade-global-ctors.ll.bc
upgrade-loop-metadata.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
upgrade-loop-metadata.ll.bc
upgrade-tbaa.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
use-list-order.ll
variableArgumentIntrinsic.3.2.ll
variableArgumentIntrinsic.3.2.ll.bc
vectorInstructions.3.2.ll
vectorInstructions.3.2.ll.bc
visibility-styles.3.2.ll
visibility-styles.3.2.ll.bc
weak-cmpxchg-upgrade.ll
weak-cmpxchg-upgrade.ll.bc