@@ -428,10 +428,10 @@ IDELinearConstantAnalysis::l_t IDELinearConstantAnalysis::bottomElement() {
428428
429429IDELinearConstantAnalysis::l_t IDELinearConstantAnalysis::join (l_t Lhs,
430430 l_t Rhs) {
431- if (( Rhs == Lhs) || ( Lhs == TOP && Rhs != BOTTOM) ) {
431+ if (Rhs == Lhs || Lhs == TOP) {
432432 return Rhs;
433433 }
434- if (Rhs == TOP && Lhs != BOTTOM ) {
434+ if (Rhs == TOP) {
435435 return Lhs;
436436 }
437437 return BOTTOM;
@@ -445,13 +445,13 @@ IDELinearConstantAnalysis::allTopFunction() {
445445std::shared_ptr<EdgeFunction<IDELinearConstantAnalysis::l_t >>
446446IDELinearConstantAnalysis::LCAEdgeFunctionComposer::composeWith (
447447 std::shared_ptr<EdgeFunction<l_t >> SecondFunction) {
448- if (auto *AB = dynamic_cast <AllBottom<l_t > *>(SecondFunction.get ())) {
448+ if (dynamic_cast <AllBottom<l_t > *>(SecondFunction.get ())) {
449449 return this ->shared_from_this ();
450450 }
451- if (auto *EI = dynamic_cast <EdgeIdentity<l_t > *>(SecondFunction.get ())) {
451+ if (dynamic_cast <EdgeIdentity<l_t > *>(SecondFunction.get ())) {
452452 return this ->shared_from_this ();
453453 }
454- if (auto *LCAID = dynamic_cast <LCAIdentity *>(SecondFunction.get ())) {
454+ if (dynamic_cast <LCAIdentity *>(SecondFunction.get ())) {
455455 return this ->shared_from_this ();
456456 }
457457 return F->composeWith (G->composeWith (SecondFunction));
@@ -464,7 +464,7 @@ IDELinearConstantAnalysis::LCAEdgeFunctionComposer::joinWith(
464464 OtherFunction->equal_to (this ->shared_from_this ())) {
465465 return this ->shared_from_this ();
466466 }
467- if (auto *AT = dynamic_cast <AllTop<l_t > *>(OtherFunction.get ())) {
467+ if (dynamic_cast <AllTop<l_t > *>(OtherFunction.get ())) {
468468 return this ->shared_from_this ();
469469 }
470470 return std::make_shared<AllBottom<l_t >>(BOTTOM);
@@ -622,6 +622,9 @@ IDELinearConstantAnalysis::BinOp::composeWith(
622622 if (dynamic_cast <LCAIdentity *>(SecondFunction.get ())) {
623623 return this ->shared_from_this ();
624624 }
625+ if (dynamic_cast <GenConstant *>(SecondFunction.get ())) {
626+ return SecondFunction;
627+ }
625628 return std::make_shared<LCAEdgeFunctionComposer>(this ->shared_from_this (),
626629 SecondFunction);
627630}
@@ -636,7 +639,7 @@ IDELinearConstantAnalysis::BinOp::joinWith(
636639 if (dynamic_cast <AllTop<l_t > *>(OtherFunction.get ())) {
637640 return this ->shared_from_this ();
638641 }
639- return std::make_shared<AllBottom<l_t >>(IDELinearConstantAnalysis:: BOTTOM);
642+ return std::make_shared<AllBottom<l_t >>(BOTTOM);
640643}
641644
642645bool IDELinearConstantAnalysis::BinOp::equal_to (
0 commit comments