This is an archive of the discontinued LLVM Phabricator instance.

Remove all DWARFDie::getAttributeAsXXX() calls that returned default values and use new llvm::OptionalDefault template instead.
AbandonedPublic

Authored by clayborg on Jan 10 2017, 5:50 PM.

Details

Summary

This removes many APIs and provides a generic way to get the result of a function that is an Optional<T> and get a default value for T that is specified if the optional doesn't have a value.

Diff Detail

Event Timeline

clayborg updated this revision to Diff 83908.Jan 10 2017, 5:50 PM
clayborg retitled this revision from to Remove all DWARFDie::getAttributeAsXXX() calls that returned default values and use new llvm::OptionalDefault template instead..
clayborg updated this object.

Do we want the case to be:

llvm::ValueOr(...)

or

llvm::value_or(...)
clayborg abandoned this revision.Jan 11 2017, 9:13 AM

Looking in Optional,h I saw that is already has a getValueOr() function that does this. I will post a new patch that uses this since the title no longer makes sense.