SgProject¶
This class represents a source project, with a list of SgFile objects and global
Synopsis¶
Declared in <src/frontend/SageIII/Cxx_Grammar.h> (not stored in Git)
class [[visibility("default")]] SgProject
: public SgSupport Description¶
information about the project (commandline details, AST merge options, etc.). This IR nodes contains list of files, etc. after internal command-line processing. The original argc and argv are not modified and left in tact for processing by the ROSE translator. The SgProject node keeps a deep copy of the original argc and argv as an STL list of strings (representing the command-line arguments). SgFile::stripRoseCommandLineOptions operates on a vector of argument strings to remove REX options before backend invocation.
- Internal: This IR node does not appear many times in an AST (typically only once).
- Todo: Make the "*PtrList" typed objects non-pointer data members (lists) instead of pointer to lists.
- Todo: Implement a "-dumpversion" for compatibility with GNU (icc does the same).
- See also: Example of using a SgProject object
Data members
SgProject::p_fileList_ptr¶
Points to the SgFileList holding the project's files.
SgProject::p_verbose¶
This is the level of verbosity assumed to apply to the whole project (all AST processing).
- Internal: This is a static variable, which might make it difficult to multiple SgProject IR nodes to coexist within the same problem.
SgProject::p_originalCommandLineArgumentList¶
Copy of original argc and argv command line passed to ROSE translator (converted to STL list of strings).
- Internal: This is a deep copy.
SgProject::p_frontendErrorCode¶
Error status from frontend processing; successful processing returns zero.
SgProject::p_backendErrorCode¶
Error code returnd from processing of generated source code using vendor compiler. This value should be passed back out of the main() function by the user translator (for support of makefile processing).
- Internal: This error code is returned by the ROSE backend() function.
SgProject::p_outputFileName¶
Filename specific using "-o" option on command line. Set as part of normal command line processing within ROSE.
- Internal: This is set to a default value of "a.out" if "-o" is not specified.
SgProject::p_sourceFileNameList¶
List of all source file names specified on the command line.
- Internal: This can be an empty list (if none are specified). This should be updated by the AST Merge mechanism.
SgProject::p_objectFileNameList¶
List of all object files specified on the command line.
- Internal: This can be an empty list (if none are specified).
SgProject::p_libraryFileList¶
List of all libraries specified on command line. List all libraries specified using ".a" or ".so" syntax.
- Internal: Required to assemble link lines for backend vendor compiler.
SgProject::p_librarySpecifierList¶
List of libraries specified using "-lxxx" syntax.
- Internal: Required to assemble link lines for backend vendor compiler.
SgProject::p_libraryDirectorySpecifierList¶
List of directories specified with "-L" option on command line
- Internal:
SgProject::p_includeDirectorySpecifierList¶
List of directories specified with "-I" option on command line
- Internal:
SgProject::p_compileOnly¶
This is true when "-c" requests compilation without linking.
SgProject::p_openmp_linking¶
This flag is used to indicate if OpenMP lowering is requested by the command line so linking to ROSE's OpenMP runtime library is needed. This flag is set to be false by default. "-rose:openmp:lowering" triggers this flag to be set to true. SgFile::p_openmp_lowering will not be sufficient since there is no SgFile in the AST when a ROSE translator is used as a linker wrapper. So we have to have a project level flag to indicate the need. Using a flag like SgProject::p_OpenMP_Only won't be sufficient neither since OpenMP input files can be handled in three different ways in ROSE: 1) parsing only 2) generating dedicated AST 3) actual OpenMP lowering Only the one with lowering will need special linking support to connect to libxomp.a and pthreads.
Member functions
list<string> SgProject::get_originalCommandLineArgumentList() const¶
Returns a list of strings representing the original command-line.
`SgProject::set_originalCommandLineArgumentList( list<string>¶
originalCommandLineArgumentList )` Sets the list of strings representing the original command-line.
bool SgProject::get_C99_only (void) const¶
This controls the c99 mode in the frontend.
Base Classes¶
| Name | Description |
|---|---|
SgSupport | This class represents the base class of a numbr of IR nodes that don't otherwise fit |
Types¶
| Name |
|---|
CallGraphState |
MutationState |
Type Aliases¶
| Name |
|---|
base_node_type |
Enums¶
| Name | Description |
|---|---|
Unnamed enum | static variant value |
constant_folding_enum |
Member Functions¶
| Name | Description |
|---|---|
SgProjectSgProject(); [constructor] | Constructors |
~SgProjectvirtual ~SgProject(); [destructor] [virtual] | Destructor |
RunFrontendint RunFrontend(); | |
acceptvirtual void accept(ROSE_VisitorPattern& visitor) override; [virtual] | support for the classic visitor pattern done in GoF |
addNewAttributevirtual void addNewAttribute( std::string s, AstAttribute* a) override; [virtual] | Add a new attribute represented by the named string. |
appendDestructorOwnedNodesvirtual void appendDestructorOwnedNodes(std::vector<SgNode*>& nodes) const override; [virtual] | |
attributeExistsvirtual bool attributeExists(std::string s) const override; [virtual] | Tests if attribute of name 's' is present. |
class_namevirtual std::string class_name() const override; [virtual] | returns a string representing the class name |
compileOutputint compileOutput(); | function to compile the output from unparsing the project |
copyvirtual SgNode* copy(SgCopyHelp& help) const override; [virtual] | |
displayvoid display(std::string const& label) const; | |
fixupCopy_referencesvirtual void fixupCopy_references( SgNode* copy, SgCopyHelp& help) const override; [virtual] | |
fixupCopy_scopesvirtual void fixupCopy_scopes( SgNode* copy, SgCopyHelp& help) const override; [virtual] | |
fixupCopy_symbolsvirtual void fixupCopy_symbols( SgNode* copy, SgCopyHelp& help) const override; [virtual] | |
getAbsolutePathFileNamesstd::vector<std::string> getAbsolutePathFileNames() const; | This function generates a list of files resolved to absolute paths (symbolic links should not be resolved). |
getAttributevirtual AstAttribute* getAttribute(std::string s) const override; [virtual] | Returns attribute of name 's'. |
get_C11_gnu_onlybool get_C11_gnu_only() const; | |
get_C11_onlybool get_C11_only() const; | |
get_C17_gnu_onlybool get_C17_gnu_only() const; | |
get_C17_onlybool get_C17_only() const; | |
get_C23_gnu_onlybool get_C23_gnu_only() const; | |
get_C23_onlybool get_C23_only() const; | |
get_C2y_gnu_onlybool get_C2y_gnu_only() const; | |
get_C2y_onlybool get_C2y_only() const; | |
get_C89_gnu_onlybool get_C89_gnu_only() const; | |
get_C89_onlybool get_C89_only() const; | |
get_C90_gnu_onlybool get_C90_gnu_only() const; | |
get_C90_onlybool get_C90_only() const; | |
get_C99_gnu_onlybool get_C99_gnu_only() const; | |
get_C99_onlybool get_C99_only() const; | |
get_C_PreprocessorOnlybool get_C_PreprocessorOnly() const; | |
get_C_onlybool get_C_only() const; | |
get_CoArrayFortran_onlybool get_CoArrayFortran_only() const; | |
get_Cxx03_gnu_onlybool get_Cxx03_gnu_only() const; | |
get_Cxx03_onlybool get_Cxx03_only() const; | |
get_Cxx11_gnu_onlybool get_Cxx11_gnu_only() const; | |
get_Cxx11_onlybool get_Cxx11_only() const; | |
get_Cxx14_gnu_onlybool get_Cxx14_gnu_only() const; | |
get_Cxx14_onlybool get_Cxx14_only() const; | |
get_Cxx17_gnu_onlybool get_Cxx17_gnu_only() const; | |
get_Cxx17_onlybool get_Cxx17_only() const; | |
get_Cxx20_gnu_onlybool get_Cxx20_gnu_only() const; | |
get_Cxx20_onlybool get_Cxx20_only() const; | |
get_Cxx23_gnu_onlybool get_Cxx23_gnu_only() const; | |
get_Cxx23_onlybool get_Cxx23_only() const; | |
get_Cxx26_gnu_onlybool get_Cxx26_gnu_only() const; | |
get_Cxx26_onlybool get_Cxx26_only() const; | |
get_Cxx98_gnu_onlybool get_Cxx98_gnu_only() const; | |
get_Cxx98_onlybool get_Cxx98_only() const; | |
get_Cxx_onlybool get_Cxx_only() const; | |
get_F2003_onlybool get_F2003_only() const; | |
get_F2008_onlybool get_F2008_only() const; | |
get_F2018_onlybool get_F2018_only() const; | |
get_F77_onlybool get_F77_only() const; | |
get_F90_onlybool get_F90_only() const; | |
get_F95_onlybool get_F95_only() const; | |
get_Fortran_onlybool get_Fortran_only() const; | |
get_addCppDirectivesToASTbool get_addCppDirectivesToAST() const; | |
get_appendPIDbool get_appendPID() const; | |
get_applicationRootDirectorystd::string get_applicationRootDirectory() const; | |
get_astfile_outstd::string get_astfile_out() const; | |
get_astfiles_instd::list<std::string> get_astfiles_in() const; | |
get_attributeMechanismvirtual AstAttributeMechanism* get_attributeMechanism() const override; [virtual] | |
get_backendErrorCodeint get_backendErrorCode() const; | |
get_callGraphStateCallGraphState& get_callGraphState(); | |
get_childIndexvirtual size_t get_childIndex(SgNode* child) const override; [virtual] | index-based access to traversal successors by child node |
get_compilationPerformanceFilestd::string get_compilationPerformanceFile() const; | |
get_compileOnlybool get_compileOnly() const; | |
get_dataBaseFilenamestd::string get_dataBaseFilename() const; | |
get_detect_dangling_pointersint get_detect_dangling_pointers() const; | |
get_directoryListSgDirectoryList* get_directoryList() const; | |
get_excludeFileListSgStringList& get_excludeFileList(); | |
get_excludePathListSgStringList& get_excludePathList(); | |
get_exit_after_parserbool get_exit_after_parser() const; | |
get_extraIncludeDirectorySpecifierAfterListSgStringList const& get_extraIncludeDirectorySpecifierAfterList() const; | |
get_extraIncludeDirectorySpecifierBeforeListSgStringList const& get_extraIncludeDirectorySpecifierBeforeList() const; | |
get_fileSgFile& get_file(int i) const; | Access function for retriving a SgFile object from the list stored internally This function is depricated and "operator[unsigned int]" should be used instead. |
get_fileListSgFilePtrList& get_fileList() const; | |
get_fileList_ptrSgFileList* get_fileList_ptr() const; | |
get_filesSgFilePtrList get_files() const; | |
get_frontendConstantFoldingSgProject::constant_folding_enum get_frontendConstantFolding() const; | |
get_frontendErrorCodeint get_frontendErrorCode() const; | |
get_globalScopeAcrossFilesSgGlobal* get_globalScopeAcrossFiles() const; | |
get_gnuOptionForUndefinedSymbolstd::string get_gnuOptionForUndefinedSymbol() const; | |
get_includeDirectorySpecifierListSgStringList const& get_includeDirectorySpecifierList() const; | |
get_includeFileListSgStringList& get_includeFileList(); | |
get_includePathListSgStringList& get_includePathList(); | |
get_includingPreprocessingInfosMapstd::map<std::string, std::set<PreprocessingInfo*>> get_includingPreprocessingInfosMap() const; | |
get_libraryDirectorySpecifierListSgStringList const& get_libraryDirectorySpecifierList() const; | |
get_libraryFileListSgStringList const& get_libraryFileList() const; | |
get_librarySpecifierListSgStringList const& get_librarySpecifierList() const; | |
get_macroSpecifierListSgStringList const& get_macroSpecifierList() const; | |
get_midendErrorCodeint get_midendErrorCode() const; | |
get_mode_32_bitbool get_mode_32_bit() const; | |
get_mutationStateMutationState& get_mutationState(); | |
get_noclobber_if_different_output_filebool get_noclobber_if_different_output_file() const; | |
get_noclobber_output_filebool get_noclobber_output_file() const; | |
get_numberOfTraversalSuccessorsvirtual size_t get_numberOfTraversalSuccessors() const override; [virtual] | return number of children in the traversal successor list |
get_objectFileNameListSgStringList const& get_objectFileNameList() const; | |
get_openmp_linkingbool get_openmp_linking() const; | |
get_originalCommandLineArgumentListSgStringList const& get_originalCommandLineArgumentList() const; | |
get_original_header_snapshotsstd::map<std::string, std::string> const& get_original_header_snapshots() const; | |
get_outputFileNamestd::string get_outputFileName() const; | |
get_preincludeDirectoryListSgStringList const& get_preincludeDirectoryList() const; | |
get_preincludeFileListSgStringList const& get_preincludeFileList() const; | |
get_projectSpecificDatabaseFilestd::string get_projectSpecificDatabaseFile() const; | |
get_reportOnHeaderFileUnparsingbool get_reportOnHeaderFileUnparsing() const; | |
get_skip_post_processingbool get_skip_post_processing() const; | |
get_skip_transformationbool get_skip_transformation() const; | |
get_skip_unparsebool get_skip_unparse() const; | |
get_skipfinalCompileStepbool get_skipfinalCompileStep() const; | |
get_sourceFileNameListSgStringList const& get_sourceFileNameList() const; | |
get_stop_after_compilation_do_not_assemble_filebool get_stop_after_compilation_do_not_assemble_file() const; | |
get_suppressNameQualificationAcrossWholeTranslationUnitbool get_suppressNameQualificationAcrossWholeTranslationUnit() const; | |
get_traversalSuccessorByIndexvirtual SgNode* get_traversalSuccessorByIndex(size_t idx) const override; [virtual] | index-based access to traversal successors by index number |
get_traversalSuccessorContainervirtual std::vector<SgNode*> get_traversalSuccessorContainer() const override; [virtual] | container of pointers to AST successor nodes used in the traversal overridden in every class by generated implementation |
get_traversalSuccessorIsListElementvirtual std::vector<bool> get_traversalSuccessorIsListElement() const override; [virtual] | |
get_traversalSuccessorNamesContainervirtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override; [virtual] | container of names of variables or container indices used used in the traversal to access AST successor nodes overridden in every class by generated implementation |
get_unparseHeaderFilesRootFolderstd::string get_unparseHeaderFilesRootFolder() const; | |
get_unparse_in_same_directory_as_input_filebool get_unparse_in_same_directory_as_input_file() const; | |
get_unparse_tokensbool get_unparse_tokens() const; | |
get_unparser__clobber_input_filebool get_unparser__clobber_input_file() const; | |
get_useBackendOnlybool get_useBackendOnly() const; | |
get_usingApplicationRootDirectorybool get_usingApplicationRootDirectory() const; | |
initializationvoid initialization(); | |
linkint link(std::string linkerName); | |
numberOfAttributesvirtual int numberOfAttributes() const override; [virtual] | Returns the number of attributes on this IR node. |
numberOfDirectoriesint numberOfDirectories() const; | Total number of directories in the project. |
numberOfFilesint numberOfFiles() const; | The total number of files in this project (equal to the number of source files specified on the command line) |
operator deletevoid operator delete( void* pointer, size_t size); | deallocated memory for IR node (returns memory to memory pool for reuse) |
operator newvoid* operator new(size_t size); | returns pointer to newly allocated IR node |
operator[]SgFile* operator[](std::string filename); | Subscript operators |
parseint parse(); | parse overloads |
processCommandLinevoid processCommandLine(std::vector<std::string> const& argv); | process command line and store options in the SgProject object. This options are used by parse und unparse. |
processDataMemberReferenceToPointersvirtual void processDataMemberReferenceToPointers(ReferenceToPointerHandler*) override; [virtual] | Pass references to stored node pointers to a handler. |
release_callGraphStatevoid release_callGraphState(); | |
release_mutationStatevoid release_mutationState(); | |
removeAttributevirtual void removeAttribute(std::string s) override; [virtual] | Remove attribute of name 's' if present. |
returnDataMemberPointersvirtual std::vector<std::pair<SgNode*, std::string>> returnDataMemberPointers() const override; [virtual] | Return the node pointers stored in this node's data members. |
roseRTIvirtual RTIReturnType roseRTI() override; [virtual] | return C++ Runtime-Time-Information |
sage_class_namevirtual char const* sage_class_name() const override; [virtual] | returns a C style string (char*) representing the class name |
setAttributevirtual void setAttribute( std::string s, AstAttribute* a) override; [virtual] | This is a wrapper function with the following semantics: if no attribute of name 's' exists then addNewAttribute(s,a); is called, otherwise updateAttribute(s,a); is called. |
set_C_PreprocessorOnlyvoid set_C_PreprocessorOnly(bool C_PreprocessorOnly); | |
set_C_onlyvoid set_C_only(bool value); | |
set_Cxx_onlyvoid set_Cxx_only(bool value); | |
set_Fortran_onlyvoid set_Fortran_only(bool value); | |
set_addCppDirectivesToASTvoid set_addCppDirectivesToAST(bool addCppDirectivesToAST); | |
set_appendPIDvoid set_appendPID(bool appendPID); | |
set_applicationRootDirectoryvoid set_applicationRootDirectory(std::string applicationRootDirectory); | |
set_astfile_outvoid set_astfile_out(std::string astfile_out); | |
set_astfiles_invoid set_astfiles_in(std::list<std::string> astfiles_in); | |
set_attributeMechanismvirtual void set_attributeMechanism(AstAttributeMechanism* attributeMechanism) override; [virtual] | |
set_backendErrorCodevoid set_backendErrorCode(int backendErrorCode); | |
set_compilationPerformanceFilevoid set_compilationPerformanceFile(std::string compilationPerformanceFile); | |
set_compileOnlyvoid set_compileOnly(bool compileOnly); | |
set_dataBaseFilenamevoid set_dataBaseFilename(std::string dataBaseFilename); | |
set_directoryListvoid set_directoryList(SgDirectoryList* directoryList); | |
set_excludeFileListvoid set_excludeFileList(SgStringList const& excludeFileList); | |
set_excludePathListvoid set_excludePathList(SgStringList const& excludePathList); | |
set_filevoid set_file(SgFile& file); | Access function for putting a new SgFile object into the list stored internally This function is depricated and "get_fileList->push_back(SgFile*)" should be used instead. |
set_fileList_ptrvoid set_fileList_ptr(SgFileList* fileList_ptr); | |
set_frontendConstantFoldingvoid set_frontendConstantFolding(SgProject::constant_folding_enum frontendConstantFolding); | |
set_frontendErrorCodevoid set_frontendErrorCode(int frontendErrorCode); | |
set_globalScopeAcrossFilesvoid set_globalScopeAcrossFiles(SgGlobal* globalScopeAcrossFiles); | |
set_gnuOptionForUndefinedSymbolvoid set_gnuOptionForUndefinedSymbol(std::string gnuOptionForUndefinedSymbol); | |
set_includeFileListvoid set_includeFileList(SgStringList const& includeFileList); | |
set_includePathListvoid set_includePathList(SgStringList const& includePathList); | |
set_includingPreprocessingInfosMapvoid set_includingPreprocessingInfosMap(std::map<std::string, std::set<PreprocessingInfo*>> includingPreprocessingInfosMap); | |
set_midendErrorCodevoid set_midendErrorCode(int midendErrorCode); | |
set_mode_32_bitvoid set_mode_32_bit(bool mode_32_bit); | |
set_noclobber_if_different_output_filevoid set_noclobber_if_different_output_file(bool noclobber_if_different_output_file); | |
set_noclobber_output_filevoid set_noclobber_output_file(bool noclobber_output_file); | |
set_openmp_linkingvoid set_openmp_linking(bool openmp_linking); | |
set_outputFileNamevoid set_outputFileName(std::string outputFileName); | |
set_projectSpecificDatabaseFilevoid set_projectSpecificDatabaseFile(std::string projectSpecificDatabaseFile); | |
set_reportOnHeaderFileUnparsingvoid set_reportOnHeaderFileUnparsing(bool reportOnHeaderFileUnparsing); | |
set_skip_post_processingvoid set_skip_post_processing(bool skip_post_processing); | |
set_stop_after_compilation_do_not_assemble_filevoid set_stop_after_compilation_do_not_assemble_file(bool stop_after_compilation_do_not_assemble_file); | |
set_suppressNameQualificationAcrossWholeTranslationUnitvoid set_suppressNameQualificationAcrossWholeTranslationUnit(bool suppressNameQualificationAcrossWholeTranslationUnit); | |
set_unparseHeaderFilesRootFoldervoid set_unparseHeaderFilesRootFolder(std::string unparseHeaderFilesRootFolder); | |
set_unparse_in_same_directory_as_input_filevoid set_unparse_in_same_directory_as_input_file(bool unparse_in_same_directory_as_input_file); | |
set_unparser__clobber_input_filevoid set_unparser__clobber_input_file(bool unparser__clobber_input_file); | |
set_usingApplicationRootDirectoryvoid set_usingApplicationRootDirectory(bool usingApplicationRootDirectory); | |
skipfinalCompileStepvoid skipfinalCompileStep(bool value); | |
unparsevoid unparse( UnparseFormatHelp* unparseFormatHelp = NULL, UnparseDelegate* unparseDelegate = NULL); | function to generate output for all files in the project (arguments control code generation) |
updateAttributevirtual void updateAttribute( std::string s, AstAttribute* a) override; [virtual] | Replace existing attribute of name 's' with new AstAttribute. |
variantTvirtual VariantT variantT() const override; [virtual] | returns new style SageIII enum values |
Static Member Functions¶
| Name | Description |
|---|---|
get_showBackendCommandLinestatic bool get_showBackendCommandLine(); | |
get_unparseHeaderFilesDebugstatic int get_unparseHeaderFilesDebug(); | |
get_verbosestatic int get_verbose(); | DQ: Modified to accept a value on the command line (no longer a boolean variable) value of 0 means quiet and higher values output more information, default value is zero (quiet). |
memoryUsagestatic size_t memoryUsage(); | Returns the size in bytes of the total memory allocated for all IR nodes of this type |
numberOfNodesstatic size_t numberOfNodes(); | Returns the total number of IR nodes of this type |
set_showBackendCommandLinestatic void set_showBackendCommandLine(bool show); | |
set_unparseHeaderFilesDebugstatic void set_unparseHeaderFilesDebug(int); | |
set_verbosestatic void set_verbose(int); | |
traverseMemoryPoolNodesstatic void traverseMemoryPoolNodes(ROSE_VisitTraversal& visit); | FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node. |
traverseMemoryPoolVisitorPatternstatic void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern& visitor); | FOR INTERNAL USE Support for visitor pattern. |
visitRepresentativeNodestatic void visitRepresentativeNode(ROSE_VisitTraversal& visit); | FOR INTERNAL USE Support for type-based traversal. |
Static Data Members¶
| Name | Description |
|---|---|
free_slots | Free slots, each numbered pool_index * pool_size + slot_index. The last entry is allocated next. |
p_showBackendCommandLine | global to output the command line that goes to the backend compiler. Default is false. |
p_unparseHeaderFilesDebug | global concept of verbose level which controls useful output from the unparse headers feature (values greater than zero increase output level) |
p_verbose | global concept of verbose level which controls useful output from the compiler (values greater than zero increase output level) |
pool_live_flags | |
pool_size | |
pools |
Protected Data Members¶
Friends¶
| Name | Description |
|---|---|
isSgProject | Casts pointer from base class to derived class (for const pointers) |
isSgProject | Casts pointer from base class to derived class |
Created with MrDocs