aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Maxwell <macdue@dueutil.tech>2024-09-16 09:44:37 +0100
committerGitHub <noreply@github.com>2024-09-16 09:44:37 +0100
commit50d35439b78bc8fdd46d67424f281e2b9440e745 (patch)
tree1b154106d52655fe364efb0554ff91011bcfa812
parentb7e51b4f139ec18c498c818c6bcaa5a842cea83c (diff)
downloadllvm-revert-108575-crash_fix_tbaa.zip
llvm-revert-108575-crash_fix_tbaa.tar.gz
llvm-revert-108575-crash_fix_tbaa.tar.bz2
Revert "[clang][codegen] Fix possible crash when setting TBAA metadata on FP …"revert-108575-crash_fix_tbaa
This reverts commit a56ca1a0fb248c6f38b5841323a74673748f43ea.
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index a76cd5f..a52e880 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -690,10 +690,8 @@ static RValue emitLibraryCall(CodeGenFunction &CGF, const FunctionDecl *FD,
const CallExpr *E, llvm::Constant *calleeValue) {
CodeGenFunction::CGFPOptionsRAII FPOptsRAII(CGF, E);
CGCallee callee = CGCallee::forDirect(calleeValue, GlobalDecl(FD));
- llvm::CallBase *callOrInvoke = nullptr;
RValue Call =
- CGF.EmitCall(E->getCallee()->getType(), callee, E, ReturnValueSlot(),
- /*Chain=*/nullptr, &callOrInvoke);
+ CGF.EmitCall(E->getCallee()->getType(), callee, E, ReturnValueSlot());
if (unsigned BuiltinID = FD->getBuiltinID()) {
// Check whether a FP math builtin function, such as BI__builtin_expf
@@ -707,7 +705,8 @@ static RValue emitLibraryCall(CodeGenFunction &CGF, const FunctionDecl *FD,
// Emit "int" TBAA metadata on FP math libcalls.
clang::QualType IntTy = Context.IntTy;
TBAAAccessInfo TBAAInfo = CGF.CGM.getTBAAAccessInfo(IntTy);
- CGF.CGM.DecorateInstructionWithTBAA(callOrInvoke, TBAAInfo);
+ Instruction *Inst = cast<llvm::Instruction>(Call.getScalarVal());
+ CGF.CGM.DecorateInstructionWithTBAA(Inst, TBAAInfo);
}
}
return Call;