Skip to content

Commit

Permalink
(outliner) working with secondary pass processing within buildSourceF…
Browse files Browse the repository at this point in the history
…ile()

* additional check for enclosing SgSourceFile to skip pragmas from another copy of AST

RC-0420
  • Loading branch information
chunhualiao committed Apr 20, 2021
1 parent 58e4722 commit 2ecad6f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/frontend/SageIII/ompAstConstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1859,6 +1859,12 @@ This is no perfect solution until we handle preprocessing information as structu
if (decl->get_file_info()->get_filename()!= sageFilePtr->get_file_info()->get_filename()
&& !(decl->get_file_info()->isTransformation()))
continue;

// We now support building a lib file from the same input file. The filename will be identical even we have two different ASTs.
// We must add another check to skip pragma nodes from the first AST.
if (getEnclosingSourceFile(decl)!=sageFilePtr)
continue;

// Liao 10/19/2010
// We now support OpenMP AST construction for both C/C++ and Fortran
// But we allow Fortran End directives to exist after -rose:openmp:ast_only
Expand Down
2 changes: 1 addition & 1 deletion src/midend/programTransformation/astOutlining/Transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ SgSourceFile* Outliner::getLibSourceFile(SgBasicBlock* target) {

// par1: input file, par 2: output file name, par 3: the project to attach the new file
// to simplify the lib file generation, we copy entire original source file to it, then later append outlined functions
new_file = isSgSourceFile(buildSourceFile(input_file_name, new_file_name, project));
new_file = isSgSourceFile(buildSourceFile(input_file_name, new_file_name, project)); //TODO: should we pass false as the last parameter?

#if 0
printf ("DONE: In Outliner::getLibSourceFile(): Calling buildSourceFile(): input_file_name = %s \n",input_file_name.c_str());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,9 @@ CXX2_TESTS_REQUIRED_TO_PASS = \
test_52.cpp

#This set of CPP files must contain main() to run
CXX4_TESTS_REQUIRED_TO_RUN=

# DQ (4/6/2021): Failing test (get_nextStatement() returns error).
# ft_cfftz_omp.cpp

CXX4_TESTS_REQUIRED_TO_RUN= \
ft_cfftz_omp.cpp

CXX4_TESTS_OBJECT_REQUIRED_TO_RUN=${CXX4_TESTS_REQUIRED_TO_RUN:.cpp=.o}

Expand Down

0 comments on commit 2ecad6f

Please sign in to comment.