[llvm-branch-commits] [clang] 50d3543 - Revert "[clang][codegen] Fix possible crash when setting TBAA metadata on FP …"

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 16 01:44:40 PDT 2024


Author: Benjamin Maxwell
Date: 2024-09-16T09:44:37+01:00
New Revision: 50d35439b78bc8fdd46d67424f281e2b9440e745

URL: https://github.com/llvm/llvm-project/commit/50d35439b78bc8fdd46d67424f281e2b9440e745
DIFF: https://github.com/llvm/llvm-project/commit/50d35439b78bc8fdd46d67424f281e2b9440e745.diff

LOG: Revert "[clang][codegen] Fix possible crash when setting TBAA metadata on FP …"

This reverts commit a56ca1a0fb248c6f38b5841323a74673748f43ea.

Added: 
    

Modified: 
    clang/lib/CodeGen/CGBuiltin.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index a76cd5f9a6f47d..a52e880a764252 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;


        


More information about the llvm-branch-commits mailing list