This is an archive of the discontinued LLVM Phabricator instance.

Use PointerIntPair in llvm::Error instead of hand-rolling it
Needs ReviewPublic

Authored by jordan_rose on Jun 28 2018, 2:58 PM.

Details

Reviewers
lhames
Summary

Also, tweak the application of LLVM_ENABLE_ABI_BREAKING_CHECKS so that a stray setChecked(false) call won't actually break ABI. And make sure the death tests don't run under NDEBUG.

Diff Detail

Repository
rL LLVM

Event Timeline

jordan_rose created this revision.Jun 28 2018, 2:58 PM
lhames added inline comments.Jul 3 2018, 5:00 PM
include/llvm/Support/Error.h
290–292

Where does the stray 'setChecked(false)' happen?

I think I took the guards off this to make sure that Errors generated and checked in release mode code would not appear as "unchecked" to an app built in debug mode.

Sounds like you are hitting the opposite issue?

jordan_rose added inline comments.Jul 3 2018, 5:02 PM
include/llvm/Support/Error.h
290–292

Oh, this wasn't actually necessary; it was just in case someone actually did use setChecked(false). Since getPtr unconditionally does the masking, you'd never actually be able to tell anyway, so I figured it was better to have it optimize away. I'm happy to put it back.