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)
commite9d379c038dbe57860290ee068cb18d13604b309
tree0ce660a23ecc563e79bf780da8558ba22a20607c
parente687bf83c0f9e6b75137a97edbb9967780e55562
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.

llvm-svn: 232412
llvm/include/llvm/CodeGen/MachineInstr.h
llvm/include/llvm/CodeGen/MachineInstrBuilder.h
llvm/include/llvm/IR/DebugInfo.h
llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/lib/IR/DebugInfo.cpp
llvm/lib/IR/Verifier.cpp