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(
22144
22144
// Even if the current function doesn't have a clang builtin, create
22145
22145
// an 'fpbuiltin-max-error' attribute for it; unless it's marked with
22146
22146
// an NoBuiltin attribute.
22147
- if (!FD->hasAttr<NoBuiltinAttr>()) {
22147
+ if (!FD->hasAttr<NoBuiltinAttr>() &&
22148
+ FD->getNameInfo().getName().isIdentifier()) {
22148
22149
Name = FD->getName();
22149
22150
FPAccuracyIntrinsicID =
22150
22151
llvm::StringSwitch<unsigned>(Name)
@@ -22155,7 +22156,11 @@ llvm::CallInst *CodeGenFunction::EmitFPBuiltinIndirectCall(
22155
22156
.Case("frem", llvm::Intrinsic::fpbuiltin_frem)
22156
22157
.Case("sincos", llvm::Intrinsic::fpbuiltin_sincos)
22157
22158
.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
+ }
22159
22164
} else {
22160
22165
return nullptr;
22161
22166
}
Original file line number Diff line number Diff line change @@ -5620,8 +5620,9 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
5620
5620
// Emit the actual call/invoke instruction.
5621
5621
llvm::CallBase *CI;
5622
5622
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)) {
5625
5626
const auto *FD = dyn_cast_if_present<FunctionDecl>(TargetDecl);
5626
5627
assert (FD && " expecting a function" );
5627
5628
CI = EmitFPBuiltinIndirectCall (IRFuncTy, IRCallArgs, CalleePtr, FD);
You can’t perform that action at this time.
0 commit comments