File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -22144,7 +22144,8 @@ llvm::CallInst *CodeGenFunction::EmitFPBuiltinIndirectCall(
2214422144 // Even if the current function doesn't have a clang builtin, create
2214522145 // an 'fpbuiltin-max-error' attribute for it; unless it's marked with
2214622146 // an NoBuiltin attribute.
22147- if (!FD->hasAttr<NoBuiltinAttr>()) {
22147+ if (!FD->hasAttr<NoBuiltinAttr>() &&
22148+ FD->getNameInfo().getName().isIdentifier()) {
2214822149 Name = FD->getName();
2214922150 FPAccuracyIntrinsicID =
2215022151 llvm::StringSwitch<unsigned>(Name)
@@ -22155,7 +22156,11 @@ llvm::CallInst *CodeGenFunction::EmitFPBuiltinIndirectCall(
2215522156 .Case("frem", llvm::Intrinsic::fpbuiltin_frem)
2215622157 .Case("sincos", llvm::Intrinsic::fpbuiltin_sincos)
2215722158 .Case("exp10", llvm::Intrinsic::fpbuiltin_exp10)
22158- .Case("rsqrt", llvm::Intrinsic::fpbuiltin_rsqrt);
22159+ .Case("rsqrt", llvm::Intrinsic::fpbuiltin_rsqrt)
22160+ .Default(0);
22161+ if (!FPAccuracyIntrinsicID) {
22162+ return nullptr;
22163+ }
2215922164 } else {
2216022165 return nullptr;
2216122166 }
Original file line number Diff line number Diff line change @@ -5620,8 +5620,9 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
56205620 // Emit the actual call/invoke instruction.
56215621 llvm::CallBase *CI;
56225622 if (!InvokeDest) {
5623- if (!getLangOpts ().FPAccuracyFuncMap .empty () ||
5624- !getLangOpts ().FPAccuracyVal .empty ()) {
5623+ if ((!getLangOpts ().FPAccuracyFuncMap .empty () ||
5624+ !getLangOpts ().FPAccuracyVal .empty ()) &&
5625+ isa_and_nonnull<FunctionDecl>(TargetDecl)) {
56255626 const auto *FD = dyn_cast_if_present<FunctionDecl>(TargetDecl);
56265627 assert (FD && " expecting a function" );
56275628 CI = EmitFPBuiltinIndirectCall (IRFuncTy, IRCallArgs, CalleePtr, FD);
You can’t perform that action at this time.
0 commit comments