This is an archive of the discontinued LLVM Phabricator instance.

Unify the return value of GetByteSize to an llvm::Optional<uint64_t> (NFC-ish)
ClosedPublic

Authored by aprantl on Jul 21 2020, 5:34 PM.

Details

Summary

This cleanup patch unifies all methods called GetByteSize in the ValueObject hierarchy to return an optional, like the methods in CompilerType do. This means fewer magic 0 values, which could fix bugs down the road in languages where types can have a size of zero, such as Swift and C (but not C++).

Diff Detail

Event Timeline

aprantl created this revision.Jul 21 2020, 5:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2020, 5:34 PM
aprantl marked an inline comment as done.
aprantl added inline comments.
lldb/source/Target/StackFrame.cpp
1445

Yeah, I know.

shafik accepted this revision.Jul 23 2020, 10:28 AM

LGTM

lldb/source/Expression/Materializer.cpp
283

Why does this need a cast?

This revision is now accepted and ready to land.Jul 23 2020, 10:28 AM
This revision was automatically updated to reflect the committed changes.