llvm/lib
Duncan P. N. Exon Smith f9f505e626 IR: Make Metadata::print() reliable and useful
Replumb the `AsmWriter` so that `Metadata::print()` is generally useful.
(Similarly change `Metadata::printAsOperand()`.)

- `SlotTracker` now has a mode where all metadata will be correctly
  numbered when initializing a `Module`.  Normally, `Metadata` only
  referenced from within `Function`s gets numbered when the `Function`
  is incorporated.
- `Metadata::print()` and `Metadata::printAsOperand()` (and
  `Metadata::dump()`) now take an optional `Module` argument.  When
  provided, `SlotTracker` is initialized with the new mode, and the
  numbering will be complete and consistent for all calls to `print()`.
- `Value::print()` uses the new `SlotTracker` mode when printing
  intrinsics with `MDNode` operands, `MetadataAsValue` operands, or the
  bodies of functions.  Thus, metadata numbering will be consistent
  between calls to `Metadata::print()` and `Value::print()`.
- `Metadata::print()` (and `Metadata::dump()`) now print the full
  definition of `MDNode`s:

    !5 = !{!6, !"abc", !7}

  This matches behaviour for `Value::print()`, which includes the name
  of instructions.
- Updated call sites in `Verifier` to call `print()` instead of
  `printAsOperand()`.

All this, so that `Verifier` can print out useful failure messages that
involve `Metadata` for PR22777.

Note that `Metadata::printAsOperand()` previously took an optional
`bool` and `Module` operand.  The former was cargo-culted from
`Value::printAsOperand()` and wasn't doing anything useful.  The latter
didn't give consistent results (without the new `SlotTracker` mode).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 20:19:36 +00:00
..
Analysis [opaque pointer type] more gep API migration 2015-03-14 19:53:33 +00:00
AsmParser [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
Bitcode [opaque pointer type] more gep API migration 2015-03-14 19:53:33 +00:00
CodeGen [MachineLICM] First steps of sinking GEPs near calls. 2015-03-14 10:58:38 +00:00
DebugInfo DWARFFormValue: Add getAsSignedConstant method. 2015-03-04 22:07:41 +00:00
ExecutionEngine [Orc][MCJIT][RuntimeDyld] Re-apply r231726 and r231724 with fix suggested by 2015-03-11 00:43:26 +00:00
Fuzzer [sanitizer/coverage] Add AFL-style coverage counters (search heuristic for fuzzing). 2015-03-03 23:27:02 +00:00
IR IR: Make Metadata::print() reliable and useful 2015-03-14 20:19:36 +00:00
IRReader Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
LineEditor Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
Linker DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
LTO Add a parameter for getLazyBitcodeModule to lazily load Metadata. 2015-03-13 19:24:30 +00:00
MC Recommit r232027 with PR22883 fixed: Add infrastructure for support of multiple memory constraints. 2015-03-13 12:45:09 +00:00
Object Be lazy about loading metadata in IRObjectFile. 2015-03-13 21:54:20 +00:00
Option Remove explicit no-op dtor in favor of the implicit dtor so as not to disable/deprecate the copy operations. 2015-03-03 19:53:02 +00:00
Passes [PM] Fixup for r231556 where I missed a dependency on intrinsics 2015-03-07 09:08:20 +00:00
ProfileData InstrProf: Teach llvm-cov to handle universal binaries when given -arch 2015-03-11 02:30:51 +00:00
Support No need to prototype RtlCaptureContext with mingw-w64. 2015-03-14 19:20:56 +00:00
TableGen Add missing includes. make_unique proliferated everywhere. 2015-03-01 21:28:53 +00:00
Target [opaque pointer type] more gep API migration 2015-03-14 19:53:33 +00:00
Transforms [opaque pointer type] more gep API migration 2015-03-14 19:53:33 +00:00
CMakeLists.txt [PM] Create a separate library for high-level pass management code. 2015-03-07 09:02:36 +00:00
LLVMBuild.txt [PM] Create a separate library for high-level pass management code. 2015-03-07 09:02:36 +00:00
Makefile [PM] Create a separate library for high-level pass management code. 2015-03-07 09:02:36 +00:00