From 5ad52587ec182f03636649e2cb66a0a4d9ffeab2 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 12 Dec 2019 15:33:18 -0500 Subject: [OPENMP50]Fix possible conflict when emitting an alias for the functions in declare variant. If the types of the fnction are not equal, but match, at the codegen thei may have different types. This may lead to compiler crash. --- clang/lib/CodeGen/CGOpenMPRuntime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp') diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index e3e9bd4284c..1aae18b4504 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -1280,7 +1280,7 @@ bool CGOpenMPRuntime::tryEmitDeclareVariant(const GlobalDecl &NewGD, llvm::GlobalValue *Addr = CGM.GetGlobalValue(NewMangledName); if (Addr && !Addr->isDeclaration()) { const auto *D = cast(OldGD.getDecl()); - const CGFunctionInfo &FI = CGM.getTypes().arrangeGlobalDeclaration(OldGD); + const CGFunctionInfo &FI = CGM.getTypes().arrangeGlobalDeclaration(NewGD); llvm::Type *DeclTy = CGM.getTypes().GetFunctionType(FI); // Create a reference to the named value. This ensures that it is emitted -- cgit v1.2.3