This is an archive of the discontinued LLVM Phabricator instance.

Small update to Expected<StringRef>
ClosedPublic

Authored by sidneym on Aug 29 2019, 3:07 PM.

Details

Summary

I think this was missed when the original change was made. Should have used NameOrErr instead of SecIOrErr.

Diff Detail

Repository
rL LLVM

Event Timeline

sidneym created this revision.Aug 29 2019, 3:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2019, 3:07 PM
Herald added a subscriber: rupprecht. · View Herald Transcript
MaskRay accepted this revision.Aug 29 2019, 6:47 PM

LGTM. Did you run into this issue with a binary? If yes, can you simplify it and add a test?

This revision is now accepted and ready to land.Aug 29 2019, 6:47 PM
grimar accepted this revision.EditedAug 30 2019, 2:36 AM

Blame list shows it was my change. LGTM. I'll take care about the test.
Thanks!

This revision was automatically updated to reflect the committed changes.

Any chance of a test case? This looks like it fixed a bug/difference in behavior.

Any chance of a test case? This looks like it fixed a bug/difference in behavior.

rL370669 added a test

Any chance of a test case? This looks like it fixed a bug/difference in behavior.

rL370669 added a test

That doesn't seem to test this patch, though - if I revert this patch no tests fail.

grimar added a comment.Sep 6 2019, 1:29 AM

Any chance of a test case? This looks like it fixed a bug/difference in behavior.

rL370669 added a test

That doesn't seem to test this patch, though - if I revert this patch no tests fail.

Did you set LLVM_ENABLE_ABI_BREAKING_CHECKS to 1?

Before this patch NameOrErr was not consumed/ignored by consumeError.
If you revert it and run the test from rL370669, you should get a
"Expected<T> must be checked before access or destruction" failture.

Any chance of a test case? This looks like it fixed a bug/difference in behavior.

rL370669 added a test

That doesn't seem to test this patch, though - if I revert this patch no tests fail.

Did you set LLVM_ENABLE_ABI_BREAKING_CHECKS to 1?

Before this patch NameOrErr was not consumed/ignored by consumeError.
If you revert it and run the test from rL370669, you should get a
"Expected<T> must be checked before access or destruction" failture.

Must've screwed it up somehow - maybe I used lit to run the test directly without rebuilding llvm-nm.

In any case - got it now - sorry for the runaround!
(also, can be helpful in the future to note that a patch is fixing a buildbot failure/existing test suite failure - otherwise it's harder to tell if it's missing test coverage)

(also, can be helpful in the future to note that a patch is fixing a buildbot failure/existing test suite failure - otherwise it's harder to tell if it's missing test coverage)

Sure. But in this case this patch was landed first, since it fixed an obvious misspeling. (i.e. there was bo BB failture or existent test).
Writing the test was a bit complicated since it requred one more patch for yaml2obj
to produce the binary broken in a specific way. So it was landed without the test which was added in rL370669 after rL370633 (patch for yaml2obj) was landed.
And the description for rL370669 contans the information about what it is for :)