From 856f3fe5bbd6a6b204a4a293efdeba8d25fb1814 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Wed, 28 Aug 2019 20:59:25 +0000 Subject: Fix always_inline 'target' compatibility check code for Lambdas The previous version of this used CurFuncDecl in CodeGenFunction, however this doesn't include lambdas. However, CurCodeDecl DOES. Switch the check to use CurCodeDecl so that the actual function being emitted gets checked, preventing an error in ISEL. llvm-svn: 370261 --- clang/lib/CodeGen/CodeGenFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 4b7986f7162f..e3fb205232e0 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -2203,7 +2203,7 @@ void CodeGenFunction::checkTargetFeatures(SourceLocation Loc, // Get the current enclosing function if it exists. If it doesn't // we can't check the target features anyhow. - const FunctionDecl *FD = dyn_cast_or_null(CurFuncDecl); + const FunctionDecl *FD = dyn_cast_or_null(CurCodeDecl); if (!FD) return; -- cgit v1.2.3