@@ -825,37 +825,33 @@ class IDEInstInteractionAnalysisT
825825 // behavior that is intended. In that case, we must propagate all data-flow
826826 // facts alongside the call site.
827827 bool OnlyDecls = true ;
828+ bool AllVoidRetTys = true ;
828829 for (auto Callee : Callees) {
829830 if (!Callee->isDeclaration ()) {
830831 OnlyDecls = false ;
831832 }
833+ if (!Callee->getReturnType ()->isVoidTy ()) {
834+ AllVoidRetTys = false ;
835+ }
832836 }
837+
833838 struct MapFactsAlongsideCallSite : public FlowFunction <IDEIIAFlowFact> {
834839 bool OnlyDecls;
840+ bool AllVoidRetTys;
835841 const llvm::CallBase *CallSite;
836842 d_t ZeroValue;
837- std::set<f_t > Callees;
838843
839- MapFactsAlongsideCallSite (bool OnlyDecls, const llvm::CallBase *CallSite ,
840- d_t ZeroValue, std::set< f_t > Callees )
841- : OnlyDecls(OnlyDecls), CallSite(CallSite), ZeroValue(ZeroValue ),
842- Callees (Callees ) {}
844+ MapFactsAlongsideCallSite (bool OnlyDecls, bool AllVoidRetTys ,
845+ const llvm::CallBase *CallSite, d_t ZeroValue )
846+ : OnlyDecls(OnlyDecls), AllVoidRetTys(AllVoidRetTys ),
847+ CallSite (CallSite), ZeroValue(ZeroValue ) {}
843848
844849 std::set<IDEIIAFlowFact> computeTargets (IDEIIAFlowFact Source) override {
845850 // There are a few things to consider, in case only declarations of
846851 // callee targets are available.
847852 if (OnlyDecls) {
848- auto AllVoidRetTys = [](const std::set<f_t > &Callees) {
849- // Check if one of the callee targets returns a value.
850- bool AllVoidRetTys = true ;
851- for (const auto *Callee : Callees) {
852- if (!Callee->getReturnType ()->isVoidTy ()) {
853- AllVoidRetTys = false ;
854- }
855- }
856- return AllVoidRetTys;
857- };
858- if (!AllVoidRetTys (Callees)) {
853+
854+ if (!AllVoidRetTys) {
859855 // If one or more of the declaration-only targets return a value, it
860856 // must be generated from zero!
861857 if (Source == ZeroValue) {
@@ -881,8 +877,8 @@ class IDEInstInteractionAnalysisT
881877 }
882878 };
883879 return std::make_shared<MapFactsAlongsideCallSite>(
884- OnlyDecls, llvm::dyn_cast<llvm::CallBase>(CallSite),
885- this ->getZeroValue (), Callees );
880+ OnlyDecls, AllVoidRetTys, llvm::dyn_cast<llvm::CallBase>(CallSite),
881+ this ->getZeroValue ());
886882 }
887883
888884 inline FlowFunctionPtrType
0 commit comments