[utils] Fix the llvm::Optional data formatter
authorVedant Kumar <vsk@apple.com>
Mon, 23 Jul 2018 21:59:06 +0000 (21:59 +0000)
committerVedant Kumar <vsk@apple.com>
Mon, 23 Jul 2018 21:59:06 +0000 (21:59 +0000)
commit0970e2e34f82d9957e30338891f8e9c5df955388
tree0152aaa10db6bce4045fff090945533821fd1317
parent22bd6f99fabe16a214268ca3f4ba0fffaddbab39
[utils] Fix the llvm::Optional data formatter

The llvm::Optional data formatter needs to look through the `Storage`
container if it's present.

Before:

   220    if (Op && Op->getOp() != dwarf::DW_OP_LLVM_fragment)
-> 221      HasComplexExpression = true;
   222
   223    // If the register can only be described by a complex expression (i.e.,
   224    // multiple subregisters) it doesn't safely compose with another complex
Target 0: (llc) stopped.
(lldb) p Op
(llvm::Optional<llvm::DIExpression::ExprOperand>) $0 = None

After:

(lldb) p Op
(llvm::Optional<llvm::DIExpression::ExprOperand>) $0 =
(llvm::DIExpression::ExprOperand) storage = {
  Op = 0x000000010603d460
}

llvm-svn: 337752
llvm/utils/lldbDataFormatters.py