IR: Take advantage of -verify checks for MDExpression
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 16 Mar 2015 21:03:55 +0000 (21:03 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 16 Mar 2015 21:03:55 +0000 (21:03 +0000)
commit3d5527fb43b1cc3147ea9842c41263a5a156d6ac
tree7404e0eeeba144e73b67abc6df72585ff5d6aa8f
parent83c42e65fb6e7cd9c3a949f265628a986a37811d
IR: Take advantage of -verify checks for MDExpression

Now that we check `MDExpression` during `-verify` (r232299), make
the `DIExpression` wrapper more strict:

  - remove redundant checks in `DebugInfoVerifier`,
  - overload `get()` to `cast_or_null<MDExpression>` (superseding
    `getRaw()`),
  - stop checking for null in any accessor, and
  - remove `DIExpression::Verify()` entirely in favour of
    `MDExpression::isValid()`.

There is still some logic in this class, mostly to do with high-level
iterators; I'll defer cleaning up those until the rest of the wrappers
are similarly strict.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232412 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineInstr.h
include/llvm/CodeGen/MachineInstrBuilder.h
include/llvm/IR/DebugInfo.h
lib/CodeGen/AsmPrinter/DebugLocEntry.h
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/IR/DebugInfo.cpp
lib/IR/Verifier.cpp