[clang] NFC: Redundant code removal in SemaDecl.cpp, CheckTargetCausesMultiVersioning().
authorTom Honermann <tom.honermann@intel.com>
Tue, 8 Mar 2022 21:48:26 +0000 (13:48 -0800)
committerTom Honermann <tom@honermann.net>
Mon, 21 Mar 2022 17:39:43 +0000 (13:39 -0400)
This change removes redundant code in the definition of
CheckTargetCausesMultiVersioning() in SemaDecl.cpp. The removed code checked
for multiversion function support. The code immediately following the removed
code is a call to CheckMultiVersionAdditionalRules(); that function performs
the same check on entry. In both cases, the consequences of missing multiversion
function support results in the same diagnostic message being issued and the
applicable function declaration being marked as invalid.

Reviewed By: erichkeane, aaron.ballman

Differential Revision: https://reviews.llvm.org/D121957

clang/lib/Sema/SemaDecl.cpp

index 852bf64..5bc01e8 100644 (file)
@@ -10610,13 +10610,6 @@ static bool CheckTargetCausesMultiVersioning(
     return false;
 
   // Otherwise, this decl causes MultiVersioning.
-  if (!S.getASTContext().getTargetInfo().supportsMultiVersioning()) {
-    S.Diag(NewFD->getLocation(), diag::err_multiversion_not_supported);
-    S.Diag(OldFD->getLocation(), diag::note_previous_declaration);
-    NewFD->setInvalidDecl();
-    return true;
-  }
-
   if (CheckMultiVersionAdditionalRules(S, OldFD, NewFD, true,
                                        MultiVersionKind::Target)) {
     NewFD->setInvalidDecl();