This is an archive of the discontinued LLVM Phabricator instance.

[lld] Fixes wrong Twine uses in FileNode::errStr() and in LayoutPass.cpp
AbandonedPublic

Authored by rafaelauler on Sep 18 2014, 4:09 PM.

Details

Summary

This patch fixes forbidden uses of Twine. It should only be used as an intermediary value, but never stored.

Diff Detail

Event Timeline

rafaelauler retitled this revision from to [lld] Fixes wrong Twine uses in FileNode::errStr() and in LayoutPass.cpp .
rafaelauler updated this object.
rafaelauler edited the test plan for this revision. (Show Details)
rafaelauler added reviewers: ruiu, rafael, Bigcheese.
rafaelauler added a project: lld.
rafaelauler added a subscriber: Unknown Object (MLST).
ruiu edited edge metadata.Sep 18 2014, 4:17 PM

LGTM. Is there any place we need to fix for this incorrect use of Twine?

Sorry for sending this in another patch. I double checked the lld tree and now I think I covered all bad cases of Twine. Could you please commit it?

Is there some C++ language feature we can use to mark the Twine class in a way that causes a warning/error on these incorrect usages?

ruiu added a comment.Sep 18 2014, 4:32 PM

Committed as r218088.

Thanks, Ruiu

Kledzik, I can't think of anything...

rafaelauler abandoned this revision.Oct 2 2014, 10:53 AM