This is an archive of the discontinued LLVM Phabricator instance.

[clang] NFC: Simplify the interface to CodeGenModule::GetOrCreateMultiVersionResolver().
ClosedPublic

Authored by tahonermann on Apr 1 2022, 7:26 PM.

Details

Summary

Previously, GetOrCreateMultiVersionResolver() required the caller to provide
a GlobalDecl along with an llvm::type and FunctionDecl. The latter two can be
cheaply obtained from the first, and the llvm::type parameter is not always
used, so requiring the caller to provide them was unnecessary and created the
possibility that callers would pass an inconsistent set. This change simplifies
the interface to only require the GlobalDecl value.

Diff Detail

Event Timeline

tahonermann created this revision.Apr 1 2022, 7:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2022, 7:26 PM
tahonermann added inline comments.Apr 2 2022, 10:01 AM
clang/lib/CodeGen/CodeGenModule.cpp
3539–3541

This is a drive by cleanup. arrangeGlobalDeclaration() handles the CXXMethodDecl special case (as well as other special cases). We rely on such calls elsewhere; see CodeGenModule::emitMultiVersionFunctions() for example.

tahonermann published this revision for review.Apr 2 2022, 2:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2022, 2:11 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane accepted this revision.Apr 4 2022, 6:46 AM
This revision is now accepted and ready to land.Apr 4 2022, 6:46 AM