This is an archive of the discontinued LLVM Phabricator instance.

[IR] Set name when inserting 'llvm::Value*'
ClosedPublic

Authored by modocache on Feb 17 2020, 8:14 PM.

Details

Summary

I noticed a small regression in a toy project of mine after applying
D73835, in which instruction names weren't being set properly. In the
example test case included with this patch,
llvm::IRBuilderBase::CreateAdd returns an llvm::Value * that is then
passed as an argument to llvm::IRBuilderBase::Insert. The overloaded
function that is selected for that call then ignores the Name
parameter that is given. This patch addresses that issue.

Event Timeline

modocache created this revision.Feb 17 2020, 8:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2020, 8:14 PM
fhahn accepted this revision.Feb 18 2020, 12:20 AM

Looks like a straight-forward fix, thanks! LGTM. Please wait a bit until committing, in case there are additional comments.

llvm/unittests/IR/IRBuilderTest.cpp
934
This revision is now accepted and ready to land.Feb 18 2020, 12:20 AM
nikic accepted this revision.Feb 18 2020, 12:39 AM

LGTM as well. Thanks for catching.

Probably didn't show up in any existing tests because it only happens with NoFolder, which we don't use often.

modocache updated this revision to Diff 245132.Feb 18 2020, 5:21 AM
modocache marked an inline comment as done.

Thanks for the reviews! Good point about the variable casing, I changed it and am going to commit this shortly.

This revision was automatically updated to reflect the committed changes.
modocache marked an inline comment as not done.