Browse Source

Merge pull request #11164 from ghalliday/issue19684

HPCC-19684 Add --ignoreunknownimport to eclcc

Reviewed-By: Shamser Ahmed <shamser.ahmed@lexisnexis.co.uk>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 years ago
parent
commit
83e375fdce
2 changed files with 11 additions and 5 deletions
  1. 10 5
      ecl/eclcc/eclcc.cpp
  2. 1 0
      ecl/eclcc/eclcc.hpp

+ 10 - 5
ecl/eclcc/eclcc.cpp

@@ -180,8 +180,9 @@ class EclCC;
 struct EclCompileInstance : public CInterfaceOf<ICodegenContextCallback>
 struct EclCompileInstance : public CInterfaceOf<ICodegenContextCallback>
 {
 {
 public:
 public:
-    EclCompileInstance(EclCC & _eclcc, IFile * _inputFile, IErrorReceiver & _errorProcessor, FILE * _errout, const char * _outputFilename, bool _legacyImport, bool _legacyWhen, bool _ignoreSignatures, bool _optXml) :
-      eclcc(_eclcc), inputFile(_inputFile), errorProcessor(&_errorProcessor), errout(_errout), outputFilename(_outputFilename), legacyImport(_legacyImport), legacyWhen(_legacyWhen), ignoreSignatures(_ignoreSignatures), optXml(_optXml)
+    EclCompileInstance(EclCC & _eclcc, IFile * _inputFile, IErrorReceiver & _errorProcessor, FILE * _errout, const char * _outputFilename, bool _legacyImport, bool _legacyWhen, bool _ignoreSignatures, bool _optIgnoreUnknownImport, bool _optXml) :
+      eclcc(_eclcc), inputFile(_inputFile), errorProcessor(&_errorProcessor), errout(_errout), outputFilename(_outputFilename),
+      legacyImport(_legacyImport), legacyWhen(_legacyWhen), ignoreSignatures(_ignoreSignatures), ignoreUnknownImport(_optIgnoreUnknownImport), optXml(_optXml)
 {
 {
         stats.parseTime = 0;
         stats.parseTime = 0;
         stats.generateTime = 0;
         stats.generateTime = 0;
@@ -409,6 +410,7 @@ protected:
     bool optTraceCache = false;
     bool optTraceCache = false;
     bool optVerifySimplified = false;
     bool optVerifySimplified = false;
     bool optRegenerateCache = false;
     bool optRegenerateCache = false;
+    bool optIgnoreUnknownImport = false;
     bool optIgnoreCache = false;
     bool optIgnoreCache = false;
     bool optExtraStats = false;
     bool optExtraStats = false;
 
 
@@ -2012,7 +2014,7 @@ bool EclCC::processFiles()
     else if (inputFiles.ordinality() == 0)
     else if (inputFiles.ordinality() == 0)
     {
     {
         assertex(optQueryRepositoryReference);
         assertex(optQueryRepositoryReference);
-        EclCompileInstance info(*this, NULL, *errs, stderr, optOutputFilename, optLegacyImport, optLegacyWhen, optIgnoreSignatures, optXml);
+        EclCompileInstance info(*this, NULL, *errs, stderr, optOutputFilename, optLegacyImport, optLegacyWhen, optIgnoreSignatures, optIgnoreUnknownImport, optXml);
         processReference(info, optQueryRepositoryReference);
         processReference(info, optQueryRepositoryReference);
         ok = (errs->errCount() == 0);
         ok = (errs->errCount() == 0);
 
 
@@ -2020,7 +2022,7 @@ bool EclCC::processFiles()
     }
     }
     else
     else
     {
     {
-        EclCompileInstance info(*this, &inputFiles.item(0), *errs, stderr, optOutputFilename, optLegacyImport, optLegacyWhen, optIgnoreSignatures, optXml);
+        EclCompileInstance info(*this, &inputFiles.item(0), *errs, stderr, optOutputFilename, optLegacyImport, optLegacyWhen, optIgnoreSignatures, optIgnoreUnknownImport, optXml);
         processFile(info);
         processFile(info);
         ok = (errs->errCount() == 0);
         ok = (errs->errCount() == 0);
 
 
@@ -2517,6 +2519,9 @@ int EclCC::parseCommandLineOptions(int argc, const char* argv[])
         else if (iter.matchPathFlag(includeLibraryPath, "-I"))
         else if (iter.matchPathFlag(includeLibraryPath, "-I"))
         {
         {
         }
         }
+        else if (iter.matchFlag(optIgnoreUnknownImport, "--ignoreunknownimport"))
+        {
+        }
         else if (iter.matchFlag(optKeywords, "--keywords"))
         else if (iter.matchFlag(optKeywords, "--keywords"))
         {
         {
         }
         }
@@ -2828,7 +2833,7 @@ void EclCC::processBatchedFile(IFile & file, bool multiThreaded)
             }
             }
 
 
             Owned<IErrorReceiver> localErrs = createFileErrorReceiver(logFile);
             Owned<IErrorReceiver> localErrs = createFileErrorReceiver(logFile);
-            EclCompileInstance info(*this, &file, *localErrs, logFile, outFilename, optLegacyImport, optLegacyWhen, optIgnoreSignatures, optXml);
+            EclCompileInstance info(*this, &file, *localErrs, logFile, outFilename, optLegacyImport, optLegacyWhen, optIgnoreSignatures, optIgnoreUnknownImport, optXml);
             info.metaOutputFilename.set(metaFilename);
             info.metaOutputFilename.set(metaFilename);
             processFile(info);
             processFile(info);
             if (info.wu &&
             if (info.wu &&

+ 1 - 0
ecl/eclcc/eclcc.hpp

@@ -90,6 +90,7 @@ const char * const helpText[] = {
     "?!  --fastsyntax  Delay expanding functions when parsing.  May speed up processing for some queries",
     "?!  --fastsyntax  Delay expanding functions when parsing.  May speed up processing for some queries",
     "    -help, --help Display this message",
     "    -help, --help Display this message",
     "    -help -v      Display verbose help message",
     "    -help -v      Display verbose help message",
+    "!   --ignoreunknownimport Do not report an error on an unknown import",
     "!   -internal     Run internal tests",
     "!   -internal     Run internal tests",
     "?!  -legacy       Use legacy import and when semantics (deprecated)",
     "?!  -legacy       Use legacy import and when semantics (deprecated)",
     "!   --leakcheck   Clean up memory since checking for memory leaks",
     "!   --leakcheck   Clean up memory since checking for memory leaks",