Skip to content

Commit 4fc69ab

Browse files
committed
Revert "[OpenMP][FIX] Verify compatible types for declare variant calls"
This reverts commit c942095. One of the tests broke, revert to investigate.
1 parent da036b4 commit 4fc69ab

File tree

3 files changed

+3
-279
lines changed

3 files changed

+3
-279
lines changed

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5921,6 +5921,7 @@ void Sema::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(
59215921
continue;
59225922

59235923
QualType UDeclTy = UDecl->getType();
5924+
// TODO: Verify types for templates eventually.
59245925
if (!UDeclTy->isDependentType()) {
59255926
QualType NewType = Context.mergeFunctionTypes(
59265927
FType, UDeclTy, /* OfBlockPointer */ false,
@@ -6008,8 +6009,6 @@ ExprResult Sema::ActOnOpenMPCall(ExprResult Call, Scope *Scope,
60086009
TargetOMPContext OMPCtx(Context, std::move(DiagUnknownTrait),
60096010
getCurFunctionDecl());
60106011

6011-
QualType CalleeFnType = CalleeFnDecl->getType();
6012-
60136012
SmallVector<Expr *, 4> Exprs;
60146013
SmallVector<VariantMatchInfo, 4> VMIs;
60156014
while (CalleeFnDecl) {
@@ -6062,19 +6061,8 @@ ExprResult Sema::ActOnOpenMPCall(ExprResult Call, Scope *Scope,
60626061
}
60636062
NewCall = BuildCallExpr(Scope, BestExpr, LParenLoc, ArgExprs, RParenLoc,
60646063
ExecConfig);
6065-
if (NewCall.isUsable()) {
6066-
if (CallExpr *NCE = dyn_cast<CallExpr>(NewCall.get())) {
6067-
FunctionDecl *NewCalleeFnDecl = NCE->getDirectCallee();
6068-
QualType NewType = Context.mergeFunctionTypes(
6069-
CalleeFnType, NewCalleeFnDecl->getType(),
6070-
/* OfBlockPointer */ false,
6071-
/* Unqualified */ false, /* AllowCXX */ true);
6072-
if (!NewType.isNull())
6073-
break;
6074-
// Don't use the call if the function type was not compatible.
6075-
NewCall = nullptr;
6076-
}
6077-
}
6064+
if (NewCall.isUsable())
6065+
break;
60786066
}
60796067

60806068
VMIs.erase(VMIs.begin() + BestIdx);

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,6 @@ static void instantiateOMPDeclareVariantAttr(
444444
New->getLocation());
445445
if (!SubstFD)
446446
return;
447-
QualType NewType = S.Context.mergeFunctionTypes(
448-
SubstFD->getType(), FD->getType(),
449-
/* OfBlockPointer */ false,
450-
/* Unqualified */ false, /* AllowCXX */ true);
451-
if (NewType.isNull())
452-
return;
453447
S.InstantiateFunctionDefinition(
454448
New->getLocation(), SubstFD, /* Recursive */ true,
455449
/* DefinitionRequired */ false, /* AtEndOfTU */ false);

0 commit comments

Comments
 (0)