-
Notifications
You must be signed in to change notification settings - Fork 1
Simplifying ROSE
It is now very complicated for the purpose of just an OpenMP C/C++/Fortran compiler. We will need to understand the following details before removing code
- ROSE_INITIALIZATION
- Sawyer messaging and Diagnosis related, do we really need this complicated mechanisms?
- AST::IO for load and merge AST from ast files? AST serialization, AST memory pool?. There are several places for AST IO, SageIII/astFileIo, Rose/AST/io, ROSETTA/Grammar/grammarAST_FileIoHeader.code and ROSETTA/Grammar/grammarAST_FileIoSource.code, and ./ROSETTA/src/buildAstFileIO.C (generate statements for creating memory pool for each AST node?), frontend/SageIII/astFromString
- src/roseSupport/Combinatorics.h/C, they only provide hasher function that are used by src/Rose/SourceLocation.C for file name hashing, but not sure whether this is useful or what is the purpose of this. Combinatorics uses libcrypt.so. So if we remove these two files, we should be able to remove the libcrypt dependency from ROSE as well.
- sqlit database support
- Plugin support
- Which libraries of boost are needed, can we replace it with standard C/C++
- How preprocessing and compilation is handled. It seems that the whole source code C/C++ is preprocessed and then compiled into Sage AST, and then info for comments/preprocessing macro/include file are recollected and attached to the AST node as attribute. Needs to confirm this.
src/rose-compiler.C can be considered the entry with main function
main() -> frontend() or new SgProject()
->src/roseSupport/utility_functions.C -> new SgProject()
SgProject::SgProject
is defined in ROSETTA in src/ROSETTA/src/support.C
and src/ROSETTA/Grammar/Support.code
and some of its functions are implemented in src/frontend/SagIII/sage_support/sage_support.C
file.
new SgProject()
will initialize and then call SgProject::parse()
which is implemented in sage_support.C
file. This file contains most of the driver function to call Frontends
that are organized in a mess. See below call graph and the names they use:
main(), in src/rose-compiler.C
|-> frontend(), in src/roseSupport/utility_functions.C
|-> SgProject::SgProject(), in src/ROSETTA/Grammar/Support.code
|-> SgProject::parse(), in src/frontend/SagIII/sage_support/sage_support.C
|-> SgProject::RunFrontend(), AstPostProcessing(), and SgFile::secondaryPassOverSourceFile()
|-> Rose::Frontend::Run()
|->Rose::Frontend::RunSerial()
|-> SgFile::runFrontend()
|->SgFile::callFrontEnd()
|-> SgSourceFile::buildAST()
|->SgSourceFile::build_C_and_Cxx_AST()
|-> edg_main(), in src/frontend/CxxFrontend/EDG/edgRose/edgRose.C
AstPostProcessing() does all kinds of fixup
AstPostProcessing(), in src/frontend/SageIII/astPostProcessing/astPostProcessing.C
|-> postProcessingSupport() which does all the fixup.
SgFile::secondaryPassOverSourceFile()
pass collects extra information about the source file that may not have
been available from previous tools that operated on the file, e.g. comments, directives, etc.
SgFile::secondaryPassOverSourceFile()
|->attachPreprocessingInfo(), in src/frontend/SageIII/attachPreprocessingInfo.C, ..., processOpenMP() in src/frontend/SageIII/ompAstConstruction.cpp