This is an archive of the discontinued LLVM Phabricator instance.

Move CallInst::CreateFree to IRBuilderBase

Authored by kwk on Sep 4 2023, 1:34 AM.



Similarly to D158861 I'm moving the CreateFree method from CallInst to IRBuilderBase.

Diff Detail

Event Timeline

kwk created this revision.Sep 4 2023, 1:34 AM
Herald added a project: Restricted Project. · View Herald Transcript
kwk requested review of this revision.Sep 4 2023, 1:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2023, 1:34 AM
nikic added inline comments.Sep 4 2023, 9:40 AM

This doesn't look right to me: At this point the terminator is not inserted yet, so this should be inserting at endbb->end() as before.

nikic added inline comments.Sep 19 2023, 1:54 AM

Should also remove the three CreateFree declarations above.

kwk updated this revision to Diff 557016.Sep 19 2023, 2:07 AM
  • Rebase
  • Insert at endbb->end() as before.
  • Remove left-over declarations of CreateFree
  • Format
nikic added inline comments.Sep 19 2023, 2:42 AM

I don't think this is going to compile. Should be something like builder->SetInsertPoint(endbb);

You probably need to pass -DLLVM_BUILD_EXAMPLES=ON to cmake to build this code.


I think you may need an IRB.SetInsertPoint(I) here? I'm not sure what the insertion point of this IRB is at this point.

kwk marked an inline comment as done.Sep 19 2023, 2:55 AM
kwk added inline comments.

I have this setting on -DLLVM_BUILD_EXAMPLES=ON`:

$ grep LLVM_BUILD_EXAMPLES CMakeCache.txt 
//Path for examples subdirectory (enabled by LLVM_BUILD_EXAMPLES=ON)

But I have changed it to what you wanted.

nikic accepted this revision.Sep 19 2023, 2:56 AM


This revision is now accepted and ready to land.Sep 19 2023, 2:56 AM
This revision was landed with ongoing or failed builds.Sep 19 2023, 3:04 AM
This revision was automatically updated to reflect the committed changes.