[DWARF] hoist nullptr checks. NFC
authorNick Desaulniers <ndesaulniers@google.com>
Mon, 20 May 2019 16:58:59 +0000 (16:58 +0000)
committerNick Desaulniers <ndesaulniers@google.com>
Mon, 20 May 2019 16:58:59 +0000 (16:58 +0000)
commitbf940622c8574d3ab48792536500b9b2927fc051
tree26f6e58b7b294559381995aa945e5488f44f7c4e
parentb93f8ae7a78bd260970d4d28bcd6407b778c0a28
[DWARF] hoist nullptr checks. NFC

Summary:
This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
15" (see under #13). It looks like PVS studio flags nullptr checks where
the ptr is used inbetween creation and checking against nullptr.

Reviewers: JDevlieghere, probinson

Reviewed By: JDevlieghere

Subscribers: RKSimon, hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62118

llvm-svn: 361176
llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp