[flang] Remove the old FIR middle end from the f18 program and speed up build time.
authorEric Schweitz <eschweitz@nvidia.com>
Thu, 6 Jun 2019 17:53:38 +0000 (10:53 -0700)
committerEric Schweitz <eschweitz@nvidia.com>
Fri, 7 Jun 2019 17:19:59 +0000 (10:19 -0700)
Original-commit: flang-compiler/f18@5b410b978c50cb367aa9f5e706afea4bd8e1d854
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
Tree-same-pre-rewrite: false

flang/lib/CMakeLists.txt
flang/lib/FIR/CMakeLists.txt
flang/tools/f18/CMakeLists.txt
flang/tools/f18/f18.cc

index a0f33da..660506e 100644 (file)
@@ -17,4 +17,3 @@ add_subdirectory(evaluate)
 add_subdirectory(FIR)
 add_subdirectory(parser)
 add_subdirectory(semantics)
-add_subdirectory(bridge)
index 0c1fa7c..f59accc 100644 (file)
@@ -14,7 +14,6 @@
 
 
 add_library(FortranFIR
-  afforestation.cc
   basicblock.cc
   builder.cc
   flattened.cc
index 0da3f9d..04fe7a7 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-if(LINK_WITH_FIR)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLINK_WITH_FIR")
-  set(FORTRAN_FIR_LIB "FortranFIR")
-endif()
-
 add_executable(f18
   f18.cc
   dump.cc
@@ -26,8 +21,6 @@ target_link_libraries(f18
   FortranParser
   FortranEvaluate
   FortranSemantics
-  ${FORTRAN_FIR_LIB}
-  ${LLVM_COMMON_LIBS}
 )
 
 add_executable(f18-parse-demo
index ab59589..5a1d34b 100644 (file)
 
 // Temporary Fortran front end driver main program for development scaffolding.
 
-#ifdef LINK_WITH_FIR
-#include "../../lib/FIR/afforestation.h"
-#include "../../lib/FIR/graph-writer.h"
-#endif
 #include "../../lib/common/default-kinds.h"
 #include "../../lib/evaluate/expression.h"
 #include "../../lib/parser/characters.h"
@@ -99,8 +95,6 @@ struct DriverOptions {
   bool dumpUnparseWithSymbols{false};
   bool dumpParseTree{false};
   bool dumpSymbols{false};
-  bool dumpGraph{false};
-  bool debugLinearFIR{false};
   bool debugResolveNames{false};
   bool debugSemantics{false};
   bool measureTree{false};
@@ -222,8 +216,7 @@ std::string CompileFortran(std::string path, Fortran::parser::Options options,
   }
   // TODO: Change this predicate to just "if (!driver.debugNoSemantics)"
   if (driver.debugSemantics || driver.debugResolveNames || driver.dumpSymbols ||
-      driver.dumpUnparseWithSymbols || driver.debugLinearFIR ||
-      driver.dumpGraph) {
+      driver.dumpUnparseWithSymbols) {
     Fortran::semantics::Semantics semantics{
         semanticsContext, parseTree, parsing.cooked()};
     semantics.Perform();
@@ -245,14 +238,6 @@ std::string CompileFortran(std::string path, Fortran::parser::Options options,
       return {};
     }
   }
-  if (driver.dumpGraph) {
-#ifdef LINK_WITH_FIR
-    auto *fir{Fortran::FIR::CreateFortranIR(
-        parseTree, semanticsContext, driver.debugLinearFIR)};
-    Fortran::FIR::GraphWriter::print(*fir);
-#endif
-    return {};
-  }
   if (driver.dumpParseTree) {
     Fortran::parser::DumpTree(std::cout, parseTree);
   }
@@ -438,10 +423,6 @@ int main(int argc, char *const argv[]) {
       driver.dumpUnparse = true;
     } else if (arg == "-funparse-with-symbols") {
       driver.dumpUnparseWithSymbols = true;
-    } else if (arg == "-fdotty") {
-      driver.dumpGraph = true;
-    } else if (arg == "-fdebug-dump-linear-ir") {
-      driver.debugLinearFIR = true;
     } else if (arg == "-fparse-only") {
       driver.parseOnly = true;
     } else if (arg == "-c") {
@@ -495,8 +476,6 @@ int main(int argc, char *const argv[]) {
           << "  -fdebug-resolve-names\n"
           << "  -fdebug-instrumented-parse\n"
           << "  -fdebug-semantics    perform semantic checks\n"
-          << "  -fdotty              print FIR as a dotty graph\n"
-          << "  -fdebug-dump-linear-ir dump the flat linear FIR for debug\n"
           << "  -v -c -o -I -D -U    have their usual meanings\n"
           << "  -help                print this again\n"
           << "Other options are passed through to the compiler.\n";