This is an archive of the discontinued LLVM Phabricator instance.

Move setName after accessing Name.
ClosedPublic

Authored by ioeric on Jul 8 2016, 8:57 AM.

Diff Detail

Event Timeline

ioeric updated this revision to Diff 63236.Jul 8 2016, 8:57 AM
ioeric retitled this revision from to Make a std::string copy of StringRef Name so that it remains valid when the original Name is overridden..
ioeric updated this object.
ioeric added a reviewer: bkramer.
ioeric added a subscriber: llvm-commits.
bkramer added inline comments.Jul 8 2016, 9:04 AM
lib/IR/AutoUpgrade.cpp
351

Can we just move the setName call below the accesses to Name? I think that would be simpler and avoids the string copy.

ioeric updated this revision to Diff 63243.Jul 8 2016, 9:13 AM
  • Move setName after accessing Name
ioeric retitled this revision from Make a std::string copy of StringRef Name so that it remains valid when the original Name is overridden. to Move setName after accessing Name..Jul 8 2016, 9:13 AM
This revision was automatically updated to reflect the committed changes.