Fix GDB pretty printer for Optional after r354246

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361870 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2019-05-28 20:22:16 +00:00
parent 9c16b5ded4
commit 49044733df

View File

@ -129,8 +129,7 @@ class OptionalPrinter(Iterator):
self.val = None
if not val['Storage']['hasVal']:
raise StopIteration
return ('value', val['Storage']['storage']['buffer'].address.cast(
val.type.template_argument(0).pointer()).dereference())
return ('value', val['Storage']['value'])
def to_string(self):
return 'llvm::Optional{}'.format('' if self.val['Storage']['hasVal'] else ' is not initialized')