Browse Source

Remove redundant code

Previously the impicit project code was based on a merging transformer - however
this meant that expressions were processed and optimized too many times.  Once
the code to enable unique ids was enabled that caused code to become duplicated.

A previous commit conditionally disabled the code.  This commit removes it.

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 13 năm trước cách đây
mục cha
commit
d53f95321b
4 tập tin đã thay đổi với 5 bổ sung45 xóa
  1. 1 30
      ecl/hqlcpp/hqliproj.cpp
  2. 0 11
      ecl/hqlcpp/hqliproj.ipp
  3. 0 4
      ecl/hqlcpp/hqlttcpp.cpp
  4. 4 0
      ecl/hqlcpp/hqlttcpp.ipp

+ 1 - 30
ecl/hqlcpp/hqliproj.cpp

@@ -935,11 +935,7 @@ static int compareHqlExprPtr(IInterface * * left, IInterface * * right)
 
 //------------------------------------------------------------------------
 
-#ifdef USE_MERGE
-ImplicitProjectInfo::ImplicitProjectInfo(IHqlExpression * _original, ProjectExprKind _kind) : MergingTransformInfo(_original), kind(_kind)
-#else
 ImplicitProjectInfo::ImplicitProjectInfo(IHqlExpression * _original, ProjectExprKind _kind) : NewTransformInfo(_original), kind(_kind)
-#endif
 {
     visited = false;
     gatheredSelectsUsed = false;
@@ -1232,11 +1228,7 @@ void ComplexImplicitProjectInfo::setMatchingOutput(ComplexImplicitProjectInfo *
 
 static HqlTransformerInfo implicitProjectTransformerInfo("ImplicitProjectTransformer");
 ImplicitProjectTransformer::ImplicitProjectTransformer(HqlCppTranslator & _translator, bool _optimizeSpills)
-#ifdef USE_MERGE
-: MergingHqlTransformer(implicitProjectTransformerInfo), translator(_translator)
-#else
 : NewHqlTransformer(implicitProjectTransformerInfo), translator(_translator)
-#endif
 {
     const HqlCppOptions & transOptions = translator.queryOptions();
     targetClusterType = translator.getTargetClusterType();
@@ -2662,28 +2654,7 @@ void ImplicitProjectTransformer::logChange(const char * message, IHqlExpression
 
 void ImplicitProjectTransformer::getTransformedChildren(IHqlExpression * expr, HqlExprArray & children)
 {
-    switch (getChildDatasetType(expr))
-    {
-#ifdef USE_MERGE
-    case childdataset_dataset: 
-    case childdataset_datasetleft: 
-    case childdataset_top_left_right:
-        {
-            IHqlExpression * arg0 = expr->queryChild(0);
-            OwnedHqlExpr child = transform(arg0);
-            children.append(*LINK(child));
-            pushChildContext(arg0, child);
-            transformChildren(expr, children);
-            popChildContext();
-            break;
-        }
-#endif
-    case childdataset_evaluate:
-        throwUnexpected();
-    default:
-        transformChildren(expr, children);
-        break;
-    }
+    transformChildren(expr, children);
 }
 
 IHqlExpression * ImplicitProjectTransformer::createParentTransformed(IHqlExpression * expr)

+ 0 - 11
ecl/hqlcpp/hqliproj.ipp

@@ -26,7 +26,6 @@
 #include "hqlutil.hpp"
 
 //#define USE_IPROJECT_HASH
-//#define USE_MERGE
 
 enum ProjectExprKind
 {
@@ -229,11 +228,7 @@ struct ImplicitProjectOptions
 class ImplicitProjectInfo;
 
 class ComplexImplicitProjectInfo;
-#ifdef USE_MERGE
-class ImplicitProjectInfo : public MergingTransformInfo
-#else
 class ImplicitProjectInfo : public NewTransformInfo
-#endif
 {
 public:
     ImplicitProjectInfo(IHqlExpression * _original, ProjectExprKind _kind);
@@ -343,15 +338,9 @@ public:
 public:
 };
 
-#ifdef USE_MERGE
-class ImplicitProjectTransformer : public MergingHqlTransformer
-{
-    typedef MergingHqlTransformer Parent;
-#else
 class ImplicitProjectTransformer : public NewHqlTransformer
 {
     typedef NewHqlTransformer Parent;
-#endif
 
 public:
     ImplicitProjectTransformer(HqlCppTranslator & _translator, bool _optimizeSpills);

+ 0 - 4
ecl/hqlcpp/hqlttcpp.cpp

@@ -9377,10 +9377,6 @@ void LeftRightTransformInfo::inherit(const LeftRightTransformInfo * other)
 }
 
 
-/*
-This transformer is responsible for reducing the number of selseq used as sequence numbers - so that they only remain
-when nesting makes the selectors ambiguous.  That allows expressions to be commoned up that wouldn't otherwise.
-*/
 static HqlTransformerInfo LeftRightTransformerInfo("LeftRightTransformer");
 LeftRightTransformer::LeftRightTransformer() : NewHqlTransformer(LeftRightTransformerInfo)
 {

+ 4 - 0
ecl/hqlcpp/hqlttcpp.ipp

@@ -907,6 +907,10 @@ public:
 };
 
 
+/*
+This transformer is responsible for reducing the number of selseq used as sequence numbers - so that they only remain
+when nesting makes the selectors ambiguous.  That allows expressions to be commoned up that wouldn't otherwise.
+*/
 class LeftRightTransformer : public NewHqlTransformer
 {
 public: