[Rose-commits] r119 - in branches/rice: . config docs/Rose docs/Rose/Tutorial projects projects/AstEquivalence projects/AstEquivalence/gui projects/BinQ projects/BinaryCloneDetection/gui projects/autoParallelization projects/autoParallelization/tests projects/binCompass projects/binaryVisualization projects/compass/extensions/checkers projects/compass/extensions/checkers/nameConsistency projects/compass/extensions/checkers/pointerComparison projects/compass/extensions/prerequisites projects/compass/src/compassSupport projects/compass/src/compass_scripts/compass_template_generator projects/compass/tools/compass projects/compass/tools/compass/doc projects/palette src/ROSETTA src/ROSETTA/Grammar src/ROSETTA/src src/backend/unparser src/frontend/BinaryDisassembly src/frontend/CxxFrontend src/frontend/Disassemblers src/frontend/ExecFormats src/frontend/OpenFortranParser_SAGE_Connection src/frontend/SageIII src/frontend/SageIII/astMerge src/frontend/SageIII/astPostProcessing src/frontend/SageIII/sageInterface src/midend/abstractHandle src/midend/astProcessing src/midend/astRewriteMechanism src/midend/astUtil/astInterface src/midend/binaryAnalyses src/midend/loopProcessing/depGraph src/midend/loopProcessing/depInfo src/util/support tests/CompileTests tests/CompileTests/OpenMP_tests tests/roseTests/programTransformationTests tutorial

fzhao at osp5.lbl.gov fzhao at osp5.lbl.gov
Tue Nov 11 14:06:35 PST 2008


Author: fzhao
Date: 2008-11-11 14:06:33 -0800 (Tue, 11 Nov 2008)
New Revision: 119

Added:
   branches/rice/config/support-dwarf.m4
   branches/rice/docs/Rose/asm_code_samples_gcc.pdf
   branches/rice/projects/AstEquivalence/createTextFiles.C
   branches/rice/projects/BinQ/AlignFunctions.C
   branches/rice/projects/BinQ/AlignFunctionsSmart.C
   branches/rice/projects/BinQ/Clone.C
   branches/rice/projects/BinQ/Clone.h
   branches/rice/projects/BinQ/Item.h
   branches/rice/projects/BinQ/slide.C
   branches/rice/projects/BinQ/slide.h
   branches/rice/projects/autoParallelization/
   branches/rice/projects/autoParallelization/Makefile.am
   branches/rice/projects/autoParallelization/README
   branches/rice/projects/autoParallelization/autoPar.C
   branches/rice/projects/autoParallelization/makefile.external
   branches/rice/projects/autoParallelization/tests/
   branches/rice/projects/autoParallelization/tests/Makefile.am
   branches/rice/projects/autoParallelization/tests/anti_dep.c
   branches/rice/projects/autoParallelization/tests/doall.c
   branches/rice/projects/autoParallelization/tests/doall_2.c
   branches/rice/projects/autoParallelization/tests/doall_vector.C
   branches/rice/projects/autoParallelization/tests/firstprivate.c
   branches/rice/projects/autoParallelization/tests/inner_only.c
   branches/rice/projects/autoParallelization/tests/jacobi_seq.c
   branches/rice/projects/autoParallelization/tests/matrixmultiply.c
   branches/rice/projects/autoParallelization/tests/output_dep.c
   branches/rice/projects/autoParallelization/tests/output_dep2.c
   branches/rice/projects/autoParallelization/tests/output_dep3.c
   branches/rice/projects/autoParallelization/tests/pointer.c
   branches/rice/projects/autoParallelization/tests/private.c
   branches/rice/projects/autoParallelization/tests/reduction.c
   branches/rice/projects/autoParallelization/tests/scalar_privatization.c
   branches/rice/projects/autoParallelization/tests/shared.c
   branches/rice/projects/autoParallelization/tests/true_dep.c
   branches/rice/projects/autoParallelization/tests/true_dep_2.c
   branches/rice/projects/autoParallelization/tests/true_l2.c
   branches/rice/projects/autoParallelization/tests/vector_1.C
   branches/rice/projects/autoParallelization/tests/vector_2.C
   branches/rice/projects/autoParallelization/tests/vectorize_1.c
   branches/rice/projects/compass/extensions/checkers/pointerComparison/
   branches/rice/projects/compass/extensions/checkers/pointerComparison/compass_parameters
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.C
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.compass.external.makefile
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.inc
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonDocs.tex
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonMain.C
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonTest1.C
   branches/rice/projects/compass/tools/compass/doc/compass_categories.tex
   branches/rice/src/ROSETTA/Grammar/grammarProcessDataMemberReferenceToPointers.macro
   branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-i686-apple-darwin9.5.0-b0847234cb4f3e1afaefa965207df2c0.tar.gz
   branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-i686-pc-linux-gnu-b0847234cb4f3e1afaefa965207df2c0.tar.gz
   branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-x86_64-pc-linux-gnu-b0847234cb4f3e1afaefa965207df2c0.tar.gz
   branches/rice/src/frontend/SageIII/OmpAttribute.C
   branches/rice/src/frontend/SageIII/OmpAttribute.h
   branches/rice/src/frontend/SageIII/omp.h
   branches/rice/src/frontend/SageIII/sageInterface/integerOps.h
   branches/rice/tests/CompileTests/OpenMP_tests/
   branches/rice/tests/CompileTests/OpenMP_tests/3loops.c
   branches/rice/tests/CompileTests/OpenMP_tests/Makefile.am
   branches/rice/tests/CompileTests/OpenMP_tests/README
   branches/rice/tests/CompileTests/OpenMP_tests/atomic.c
   branches/rice/tests/CompileTests/OpenMP_tests/collapse.c
   branches/rice/tests/CompileTests/OpenMP_tests/copyin.c
   branches/rice/tests/CompileTests/OpenMP_tests/copyprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/copyprivate2.c
   branches/rice/tests/CompileTests/OpenMP_tests/copyprivate3.c
   branches/rice/tests/CompileTests/OpenMP_tests/critical.c
   branches/rice/tests/CompileTests/OpenMP_tests/critical_dead.c
   branches/rice/tests/CompileTests/OpenMP_tests/critical_orphaned.c
   branches/rice/tests/CompileTests/OpenMP_tests/dynamicChunk.c
   branches/rice/tests/CompileTests/OpenMP_tests/empty.c
   branches/rice/tests/CompileTests/OpenMP_tests/expressions.c
   branches/rice/tests/CompileTests/OpenMP_tests/falsesharing.c
   branches/rice/tests/CompileTests/OpenMP_tests/firstlastprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/flush.c
   branches/rice/tests/CompileTests/OpenMP_tests/get_max_threads.c
   branches/rice/tests/CompileTests/OpenMP_tests/hello-ordered.c
   branches/rice/tests/CompileTests/OpenMP_tests/hello.c
   branches/rice/tests/CompileTests/OpenMP_tests/lastprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/lastprivate0.c
   branches/rice/tests/CompileTests/OpenMP_tests/limits_threads.c
   branches/rice/tests/CompileTests/OpenMP_tests/lockarray.c
   branches/rice/tests/CompileTests/OpenMP_tests/lu_factorization.c
   branches/rice/tests/CompileTests/OpenMP_tests/masterSingle.c
   branches/rice/tests/CompileTests/OpenMP_tests/matrix_vector.c
   branches/rice/tests/CompileTests/OpenMP_tests/nestedpar.c
   branches/rice/tests/CompileTests/OpenMP_tests/nestedpar1.c
   branches/rice/tests/CompileTests/OpenMP_tests/omp1.c
   branches/rice/tests/CompileTests/OpenMP_tests/ompfor.c
   branches/rice/tests/CompileTests/OpenMP_tests/ordered.c
   branches/rice/tests/CompileTests/OpenMP_tests/ordered2.c
   branches/rice/tests/CompileTests/OpenMP_tests/orphaned-directives.c
   branches/rice/tests/CompileTests/OpenMP_tests/parallel.c
   branches/rice/tests/CompileTests/OpenMP_tests/parallelfor.c
   branches/rice/tests/CompileTests/OpenMP_tests/parseOmp.C
   branches/rice/tests/CompileTests/OpenMP_tests/private.c
   branches/rice/tests/CompileTests/OpenMP_tests/privatej.c
   branches/rice/tests/CompileTests/OpenMP_tests/recursive.c
   branches/rice/tests/CompileTests/OpenMP_tests/reduction.c
   branches/rice/tests/CompileTests/OpenMP_tests/reduction2.c
   branches/rice/tests/CompileTests/OpenMP_tests/section.c
   branches/rice/tests/CompileTests/OpenMP_tests/set_num_threads.c
   branches/rice/tests/CompileTests/OpenMP_tests/single_copyprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/spmd1.c
   branches/rice/tests/CompileTests/OpenMP_tests/staticChunk.c
   branches/rice/tests/CompileTests/OpenMP_tests/subteam.c
   branches/rice/tests/CompileTests/OpenMP_tests/subteam2.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_largenumber.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_link.cpp
   branches/rice/tests/CompileTests/OpenMP_tests/task_orphaned.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_tree.cpp
   branches/rice/tests/CompileTests/OpenMP_tests/task_underIf.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_untied.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_wait.c
   branches/rice/tests/CompileTests/OpenMP_tests/threadProcessor.c
   branches/rice/tests/CompileTests/OpenMP_tests/threadprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/threadprivate2.c
   branches/rice/tests/CompileTests/OpenMP_tests/threadprivate3.c
   branches/rice/tests/CompileTests/OpenMP_tests/variables.c
Removed:
   branches/rice/projects/OpenMP_Parser/
   branches/rice/projects/autoParallelization/Makefile.am
   branches/rice/projects/autoParallelization/README
   branches/rice/projects/autoParallelization/autoPar.C
   branches/rice/projects/autoParallelization/makefile.external
   branches/rice/projects/autoParallelization/tests/
   branches/rice/projects/autoParallelization/tests/Makefile.am
   branches/rice/projects/autoParallelization/tests/anti_dep.c
   branches/rice/projects/autoParallelization/tests/doall.c
   branches/rice/projects/autoParallelization/tests/doall_2.c
   branches/rice/projects/autoParallelization/tests/doall_vector.C
   branches/rice/projects/autoParallelization/tests/firstprivate.c
   branches/rice/projects/autoParallelization/tests/inner_only.c
   branches/rice/projects/autoParallelization/tests/jacobi_seq.c
   branches/rice/projects/autoParallelization/tests/matrixmultiply.c
   branches/rice/projects/autoParallelization/tests/output_dep.c
   branches/rice/projects/autoParallelization/tests/output_dep2.c
   branches/rice/projects/autoParallelization/tests/output_dep3.c
   branches/rice/projects/autoParallelization/tests/pointer.c
   branches/rice/projects/autoParallelization/tests/private.c
   branches/rice/projects/autoParallelization/tests/reduction.c
   branches/rice/projects/autoParallelization/tests/scalar_privatization.c
   branches/rice/projects/autoParallelization/tests/shared.c
   branches/rice/projects/autoParallelization/tests/true_dep.c
   branches/rice/projects/autoParallelization/tests/true_dep_2.c
   branches/rice/projects/autoParallelization/tests/true_l2.c
   branches/rice/projects/autoParallelization/tests/vector_1.C
   branches/rice/projects/autoParallelization/tests/vector_2.C
   branches/rice/projects/autoParallelization/tests/vectorize_1.c
   branches/rice/projects/compass/extensions/checkers/pointerComparison/compass_parameters
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.C
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.compass.external.makefile
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.inc
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonDocs.tex
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonMain.C
   branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonTest1.C
   branches/rice/src/ROSETTA/Grammar/grammarReturnDataMemberReferenceToPointers.macro
   branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-i686-apple-darwin9.5.0-a0cac5c137a2be0e2ce8fb85a561050f.tar.gz
   branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-i686-pc-linux-gnu-a0cac5c137a2be0e2ce8fb85a561050f.tar.gz
   branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-x86_64-pc-linux-gnu-a0cac5c137a2be0e2ce8fb85a561050f.tar.gz
   branches/rice/tests/CompileTests/OpenMP_tests/3loops.c
   branches/rice/tests/CompileTests/OpenMP_tests/Makefile.am
   branches/rice/tests/CompileTests/OpenMP_tests/README
   branches/rice/tests/CompileTests/OpenMP_tests/atomic.c
   branches/rice/tests/CompileTests/OpenMP_tests/collapse.c
   branches/rice/tests/CompileTests/OpenMP_tests/copyin.c
   branches/rice/tests/CompileTests/OpenMP_tests/copyprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/copyprivate2.c
   branches/rice/tests/CompileTests/OpenMP_tests/copyprivate3.c
   branches/rice/tests/CompileTests/OpenMP_tests/critical.c
   branches/rice/tests/CompileTests/OpenMP_tests/critical_dead.c
   branches/rice/tests/CompileTests/OpenMP_tests/critical_orphaned.c
   branches/rice/tests/CompileTests/OpenMP_tests/dynamicChunk.c
   branches/rice/tests/CompileTests/OpenMP_tests/empty.c
   branches/rice/tests/CompileTests/OpenMP_tests/expressions.c
   branches/rice/tests/CompileTests/OpenMP_tests/falsesharing.c
   branches/rice/tests/CompileTests/OpenMP_tests/firstlastprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/flush.c
   branches/rice/tests/CompileTests/OpenMP_tests/get_max_threads.c
   branches/rice/tests/CompileTests/OpenMP_tests/hello-ordered.c
   branches/rice/tests/CompileTests/OpenMP_tests/hello.c
   branches/rice/tests/CompileTests/OpenMP_tests/lastprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/lastprivate0.c
   branches/rice/tests/CompileTests/OpenMP_tests/limits_threads.c
   branches/rice/tests/CompileTests/OpenMP_tests/lockarray.c
   branches/rice/tests/CompileTests/OpenMP_tests/lu_factorization.c
   branches/rice/tests/CompileTests/OpenMP_tests/masterSingle.c
   branches/rice/tests/CompileTests/OpenMP_tests/matrix_vector.c
   branches/rice/tests/CompileTests/OpenMP_tests/nestedpar.c
   branches/rice/tests/CompileTests/OpenMP_tests/nestedpar1.c
   branches/rice/tests/CompileTests/OpenMP_tests/omp1.c
   branches/rice/tests/CompileTests/OpenMP_tests/ompfor.c
   branches/rice/tests/CompileTests/OpenMP_tests/ordered.c
   branches/rice/tests/CompileTests/OpenMP_tests/ordered2.c
   branches/rice/tests/CompileTests/OpenMP_tests/orphaned-directives.c
   branches/rice/tests/CompileTests/OpenMP_tests/parallel.c
   branches/rice/tests/CompileTests/OpenMP_tests/parallelfor.c
   branches/rice/tests/CompileTests/OpenMP_tests/parseOmp.C
   branches/rice/tests/CompileTests/OpenMP_tests/private.c
   branches/rice/tests/CompileTests/OpenMP_tests/privatej.c
   branches/rice/tests/CompileTests/OpenMP_tests/recursive.c
   branches/rice/tests/CompileTests/OpenMP_tests/reduction.c
   branches/rice/tests/CompileTests/OpenMP_tests/reduction2.c
   branches/rice/tests/CompileTests/OpenMP_tests/section.c
   branches/rice/tests/CompileTests/OpenMP_tests/set_num_threads.c
   branches/rice/tests/CompileTests/OpenMP_tests/single_copyprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/spmd1.c
   branches/rice/tests/CompileTests/OpenMP_tests/staticChunk.c
   branches/rice/tests/CompileTests/OpenMP_tests/subteam.c
   branches/rice/tests/CompileTests/OpenMP_tests/subteam2.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_largenumber.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_link.cpp
   branches/rice/tests/CompileTests/OpenMP_tests/task_orphaned.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_tree.cpp
   branches/rice/tests/CompileTests/OpenMP_tests/task_underIf.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_untied.c
   branches/rice/tests/CompileTests/OpenMP_tests/task_wait.c
   branches/rice/tests/CompileTests/OpenMP_tests/threadProcessor.c
   branches/rice/tests/CompileTests/OpenMP_tests/threadprivate.c
   branches/rice/tests/CompileTests/OpenMP_tests/threadprivate2.c
   branches/rice/tests/CompileTests/OpenMP_tests/threadprivate3.c
   branches/rice/tests/CompileTests/OpenMP_tests/variables.c
Modified:
   branches/rice/config/Makefile.for.ROSE.includes.and.libs
   branches/rice/configure.in
   branches/rice/docs/Rose/Makefile.am
   branches/rice/docs/Rose/Tutorial/abstractHandle.tex
   branches/rice/docs/Rose/Tutorial/binaryAnalysis.tex
   branches/rice/docs/Rose/Tutorial/loopOptimization.tex
   branches/rice/docs/Rose/developersAppendix.tex
   branches/rice/docs/Rose/installRose.tex
   branches/rice/docs/Rose/leftmenu.html.in
   branches/rice/docs/Rose/manual.tex.in
   branches/rice/docs/Rose/rose.cfg.in
   branches/rice/docs/Rose/roseHelpOutput.txt
   branches/rice/projects/AstEquivalence/Makefile.am
   branches/rice/projects/AstEquivalence/astEquivalenceGui.C
   branches/rice/projects/AstEquivalence/evaluateAllBinaries.C
   branches/rice/projects/AstEquivalence/gui/compilerFlagsGui.C
   branches/rice/projects/AstEquivalence/runIDA.C
   branches/rice/projects/BinQ/BinQGui.C
   branches/rice/projects/BinQ/BinQGui.h
   branches/rice/projects/BinQ/BinQMain.C
   branches/rice/projects/BinQ/BinQSupport.C
   branches/rice/projects/BinQ/BinQSupport.h
   branches/rice/projects/BinQ/Makefile.am
   branches/rice/projects/BinaryCloneDetection/gui/binaryCloneGui.C
   branches/rice/projects/Makefile.am
   branches/rice/projects/binCompass/binCompassMain.cpp
   branches/rice/projects/binaryVisualization/vizzBinary.C
   branches/rice/projects/compass/extensions/checkers/nameConsistency/checkNameImpl.C
   branches/rice/projects/compass/extensions/prerequisites/BinDataFlowPrerequisite.h
   branches/rice/projects/compass/src/compassSupport/compass.C
   branches/rice/projects/compass/src/compass_scripts/compass_template_generator/compass.C
   branches/rice/projects/compass/tools/compass/CHECKER_LIST
   branches/rice/projects/compass/tools/compass/RULE_SELECTION.in
   branches/rice/projects/compass/tools/compass/buildCheckers.C
   branches/rice/projects/compass/tools/compass/checkers.h
   branches/rice/projects/compass/tools/compass/doc/Makefile.am
   branches/rice/projects/compass/tools/compass/doc/compass.tex.in
   branches/rice/projects/compass/tools/compass/doc/usingCompass.tex
   branches/rice/projects/palette/rose.P
   branches/rice/rose.docs.in
   branches/rice/src/ROSETTA/Grammar/BinaryInstruction.code
   branches/rice/src/ROSETTA/Grammar/Common.code
   branches/rice/src/ROSETTA/Grammar/Cxx_GlobalDeclarations.macro
   branches/rice/src/ROSETTA/Grammar/Node.code
   branches/rice/src/ROSETTA/Grammar/Support.code
   branches/rice/src/ROSETTA/astNodeList
   branches/rice/src/ROSETTA/src/Makefile.am
   branches/rice/src/ROSETTA/src/binaryInstruction.C
   branches/rice/src/ROSETTA/src/grammar.C
   branches/rice/src/ROSETTA/src/grammar.h
   branches/rice/src/ROSETTA/src/support.C
   branches/rice/src/ROSETTA/src/terminal.C
   branches/rice/src/ROSETTA/src/terminal.h
   branches/rice/src/backend/unparser/unparser.C
   branches/rice/src/frontend/BinaryDisassembly/RoseBin.cpp
   branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB.cpp
   branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB.h
   branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.cpp
   branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.h
   branches/rice/src/frontend/BinaryDisassembly/RoseBin_support.h
   branches/rice/src/frontend/BinaryDisassembly/instructionDispatch.cpp
   branches/rice/src/frontend/BinaryDisassembly/make-decision-tree.tcl
   branches/rice/src/frontend/BinaryDisassembly/powerpcInstructionEnum.h
   branches/rice/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C
   branches/rice/src/frontend/BinaryDisassembly/readTicl.C
   branches/rice/src/frontend/CxxFrontend/Makefile.am
   branches/rice/src/frontend/Disassemblers/disassemblerCommon.C
   branches/rice/src/frontend/Disassemblers/disassemblers.h
   branches/rice/src/frontend/Disassemblers/powerpcDisassembler.C
   branches/rice/src/frontend/Disassemblers/x86Disassembler.C
   branches/rice/src/frontend/ExecFormats/ROSE_ExecELF.C
   branches/rice/src/frontend/ExecFormats/ROSE_ExecGeneric.C
   branches/rice/src/frontend/ExecFormats/ROSE_ExecPE.C
   branches/rice/src/frontend/OpenFortranParser_SAGE_Connection/FortranModuleInfo.C
   branches/rice/src/frontend/SageIII/Makefile.am
   branches/rice/src/frontend/SageIII/astMerge/fixupTraversal.C
   branches/rice/src/frontend/SageIII/astMerge/merge.C
   branches/rice/src/frontend/SageIII/astMerge/nullifyAST.C
   branches/rice/src/frontend/SageIII/astPostProcessing/fixupDefiningAndNondefiningDeclarations.C
   branches/rice/src/frontend/SageIII/rtiHelpers.h
   branches/rice/src/frontend/SageIII/sageInterface/Makefile.am
   branches/rice/src/frontend/SageIII/sageInterface/sageBuilder.C
   branches/rice/src/frontend/SageIII/sageInterface/sageInterface.C
   branches/rice/src/frontend/SageIII/sageInterface/sageInterface.h
   branches/rice/src/frontend/SageIII/sageSupport.C
   branches/rice/src/midend/abstractHandle/loopAdapter.cpp
   branches/rice/src/midend/abstractHandle/loopAdapter.h
   branches/rice/src/midend/abstractHandle/makefile-myloop
   branches/rice/src/midend/abstractHandle/myloop.h
   branches/rice/src/midend/abstractHandle/testMyLoop.cpp
   branches/rice/src/midend/astProcessing/AstDOTGeneration.C
   branches/rice/src/midend/astRewriteMechanism/rewriteMidLevelInterfaceTemplatesImpl.h
   branches/rice/src/midend/astUtil/astInterface/AstInterface.C
   branches/rice/src/midend/binaryAnalyses/RoseBin_FlowAnalysis.h
   branches/rice/src/midend/loopProcessing/depGraph/DepGraphBuild.h
   branches/rice/src/midend/loopProcessing/depInfo/DepInfo.C
   branches/rice/src/midend/loopProcessing/depInfo/DepInfo.h
   branches/rice/src/midend/loopProcessing/depInfo/DepInfoAnal.C
   branches/rice/src/midend/loopProcessing/depInfo/DepInfoAnal.h
   branches/rice/src/util/support/CountRefHandle.h
   branches/rice/tests/CompileTests/Makefile.am
   branches/rice/tests/roseTests/programTransformationTests/finiteDifferencingDemo.C
   branches/rice/tutorial/abstractHandle2.cpp
Log:
svn merge -r 105:117 https://outreach.scidac.gov/svn/rose/trunk

Modified: branches/rice/config/Makefile.for.ROSE.includes.and.libs
===================================================================
--- branches/rice/config/Makefile.for.ROSE.includes.and.libs	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/config/Makefile.for.ROSE.includes.and.libs	2008-11-11 22:06:33 UTC (rev 119)
@@ -114,6 +114,14 @@
 # ROSE_YICES_LIB_FILE = libyices.a
 endif
 
+# ROSE-DWARF libdwarf
+if ROSE_USE_DWARF
+  ROSE_DWARF_INCLUDES = -I$(dwarf_path)
+  ROSE_DWARF_LIBS = -ldwarf
+  ROSE_DWARF_LIBS_WITH_PATH = $(dwarf_path)/libdwarf.a -lelf
+# ROSE_DWARF_LIB_FILE = libdwarf.a
+endif
+
 # ROSE-WINE Package (Wine is a package to permit execution of Windows binaries under Linux)
 if ROSE_USE_WINDOWS_ANALYSIS_SUPPORT
   ROSE_WINE_INCLUDES = -I$(wine_path)/include
@@ -182,6 +190,9 @@
      -I$(top_srcdir)/src/midend/programAnalysis/pointerAnal \
      -I$(top_srcdir)/src/midend/programAnalysis/valuePropagation \
      -I$(top_srcdir)/src/midend/loopProcessing/driver \
+     -I$(top_srcdir)/src/midend/loopProcessing/computation \
+     -I$(top_srcdir)/src/midend/loopProcessing/depGraph \
+     -I$(top_srcdir)/src/midend/loopProcessing/depInfo \
       $(ROSE_SIDEEFFECTS_INCLUDE) \
       $(ROSE_DATABASE_INCLUDE) \
       $(ROSE_GUI_INCLUDE) \
@@ -207,10 +218,15 @@
      -I$(top_srcdir)/src/util/graphs \
      -I$(top_srcdir)/src/midend/astUtil/astInterface \
      $(ROSE_PHP_INCLUDES) \
+     $(ROSE_YICES_INCLUDES) \
+     $(ROSE_DWARF_INCLUDES) \
+     $(ROSE_WINE_INCLUDES) \
      $(VALGRIND_CFLAGS) \
      $(BOOST_CPPFLAGS) $(SQLITE3_CFLAGS) -DBOOST_REGEX_MATCH_EXTRA
 
-# DQ: Not used currently
+# DQ (10/28/2008): I think these should be included, I don't know why they 
+# were removed (used with Microsoft Windows tests, and Yices tests).
+# DQ: Not used currently 
 #     $(ROSE_YICES_INCLUDES)
 #     $(ROSE_WINE_INCLUDES)
 
@@ -237,7 +253,7 @@
   $(BOOST_THREAD_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) \
   $(BOOST_REGEX_LIB)  $(BOOST_SYSTEM_LIB) $(BOOST_SERIALIZATION_LIB)  \
   $(BOOST_WAVE_LIB) $(SQLITE3_LDFLAGS)  $(JAVA_JVM_LINK) $(RT_LIBS) \
-  $(ROSE_YICES_LIBS_WITH_PATH) $(ROSE_PHP_LIBS_WITH_PATH) \
+  $(ROSE_YICES_LIBS_WITH_PATH) $(ROSE_DWARF_LIBS_WITH_PATH) $(ROSE_PHP_LIBS_WITH_PATH) \
   $(ROSE_GUI_LIBS_WITH_PATH) $(ROSE_QT_LIBS_WITH_PATH)
 
 # This ROSE_SEPARATE_LIBS is used for the linking of preprocessor.C used within

Copied: branches/rice/config/support-dwarf.m4 (from rev 117, trunk/config/support-dwarf.m4)
===================================================================
--- branches/rice/config/support-dwarf.m4	                        (rev 0)
+++ branches/rice/config/support-dwarf.m4	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,31 @@
+AC_DEFUN([ROSE_SUPPORT_DWARF],
+[
+# Begin macro ROSE_SUPPORT_DWARF.
+
+# Inclusion of test for DWARF libdwarf library and it's location.
+
+AC_MSG_CHECKING(for dwarf)
+AC_ARG_WITH(dwarf,
+[  --with-dwarf=PATH	Specify the path where libdwarf is installed],
+,
+if test ! "$with_dwarf" ; then
+   with_dwarf=no
+fi
+)
+
+echo "In ROSE SUPPORT MACRO: with_dwarf $with_dwarf"
+
+if test "$with_dwarf" = no; then
+   # If dwarf is not specified, then don't use it.
+   echo "Skipping use of Dwarf (libdwarf) support!"
+else
+   dwarf_path=$with_dwarf
+   echo "Setup Dwarf support in ROSE! path = $dwarf_path"
+   AC_DEFINE([USE_ROSE_DWARF_SUPPORT],1,[Controls use of ROSE support for Dwarf (libdwarf) library.])
+fi
+
+AC_SUBST(dwarf_path)
+
+# End macro ROSE_SUPPORT_DWARF.
+]
+)

Modified: branches/rice/configure.in
===================================================================
--- branches/rice/configure.in	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/configure.in	2008-11-11 22:06:33 UTC (rev 119)
@@ -261,9 +261,15 @@
 # Call supporting macro to Yices Satisfiability Modulo Theories (SMT) Solver
 ROSE_SUPPORT_YICES
 
-# Setup Automake conditional in Projects/programModeling/Makefile.am
+# Setup Automake conditional in --- (not yet distributed)
 AM_CONDITIONAL(ROSE_USE_YICES,test ! "$with_yices" = no)
 
+# Call supporting macro to DWARF (libdwarf)
+ROSE_SUPPORT_DWARF
+
+# Setup Automake conditional in --- (not yet distributed)
+AM_CONDITIONAL(ROSE_USE_DWARF,test ! "$with_dwarf" = no)
+
 ROSE_SUPPORT_PHP
 
 AM_CONDITIONAL(ROSE_USE_PHP,test ! "$with_php" = no)
@@ -724,7 +730,7 @@
 
 AM_CONDITIONAL(BINARY_EDG_TARBALL_ENABLED, [test "x$binary_edg_tarball_enabled" = "xyes"])
 
-release_binary_compatibility_signature="a0cac5c137a2be0e2ce8fb85a561050f" # This variable will be substituted in binary-EDG release copies of configure.in
+release_binary_compatibility_signature="b0847234cb4f3e1afaefa965207df2c0" # This variable will be substituted in binary-EDG release copies of configure.in
 build_triplet_without_redhat=`echo $build | sed s/-redhat-/-pc-/ | sed s/-unknown-/-pc-/`
 expected_binary_edg_dirname="roseBinaryEDG-${build_triplet_without_redhat}-${release_binary_compatibility_signature}"
 expected_binary_edg_tarball="${expected_binary_edg_dirname}.tar.gz"
@@ -952,6 +958,8 @@
 projects/Makefile
 projects/AstEquivalence/Makefile
 projects/AstEquivalence/gui/Makefile
+projects/autoParallelization/Makefile
+projects/autoParallelization/tests/Makefile
 projects/BinQ/Makefile
 projects/compass/Makefile
 projects/compass/src/Makefile
@@ -1012,8 +1020,6 @@
 projects/OpenMP_Translator/tests/npb2.3-omp-c/LU/Makefile
 projects/OpenMP_Translator/tests/npb2.3-omp-c/MG/Makefile
 projects/OpenMP_Translator/tests/npb2.3-omp-c/SP/Makefile
-projects/OpenMP_Parser/Makefile
-projects/OpenMP_Parser/tests/Makefile
 projects/MPICodeMotion/Makefile
 projects/javaport/Makefile
 projects/palette/Makefile
@@ -1055,6 +1061,7 @@
 tests/CompileTests/ExpressionTemplateExample_tests/Makefile
 tests/CompileTests/PythonExample_tests/Makefile
 tests/CompileTests/UPC_tests/Makefile
+tests/CompileTests/OpenMP_tests/Makefile
 tests/CompileTests/copyAST_tests/Makefile
 tests/CompileTests/colorAST_tests/Makefile
 tests/CompileTests/mergeAST_tests/Makefile

Modified: branches/rice/docs/Rose/Makefile.am
===================================================================
--- branches/rice/docs/Rose/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,8 +1,8 @@
 include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs
 include $(top_srcdir)/projects/compass/src/compassSupport/compass_dirs.inc
 
-PDFLATEX = env TEXINPUTS=$(srcdir):$(top_srcdir)/tests:.: pdflatex --interaction=batchmode
-#PDFLATEX = env TEXINPUTS=$(srcdir):$(top_srcdir)/tests:.: pdflatex 
+#PDFLATEX = env TEXINPUTS=$(srcdir):$(top_srcdir)/tests:.: pdflatex --interaction=batchmode
+PDFLATEX = env TEXINPUTS=$(srcdir):$(top_srcdir)/tests:.: pdflatex 
 
 # Later we will add ROSETTA documentation here ...
 SUBDIRS = Tutorial 
@@ -70,7 +70,7 @@
 	cd $(top_builddir); $(MAKE) rose.docs
 
 # A more complex dependence is defined that requires the sage.tag file
-$(RoseDoxygenDocumentation): $(RoseDocsDependencies) $(ROSE_MAINPAGE_DOCUMENTATION)
+$(RoseDoxygenDocumentation): $(RoseDocsDependencies) $(ROSE_MAINPAGE_DOCUMENTATION) rose.cfg
 	cd $(top_builddir)/src/frontend/SageIII; $(MAKE) sage.docs
 	doxygen rose.cfg
 
@@ -212,7 +212,7 @@
    developersAppendix.tex designOfRose.tex  FAQ.tex glossary.tex introduction.tex lu.tex preface.tex \
    requirements.tex rose-processing-phases.pdf compass_rose.gif SageIII.tex QueryLibrary.tex \
    AstRewrite.tex ProgramAnalysis.tex AstProcessing.tex testing.tex astMerge.tex installRose.tex \
-   roseExecutionOutput.txt roseHelpOutput.txt 
+   roseExecutionOutput.txt roseHelpOutput.txt asm_code_samples_gcc.pdf
 
 clean-web-pages:
 	test ! -d ROSE_WebPages || (test -d ROSE_WebPages && ( chmod +w -R ROSE_WebPages ))

Modified: branches/rice/docs/Rose/Tutorial/abstractHandle.tex
===================================================================
--- branches/rice/docs/Rose/Tutorial/abstractHandle.tex	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/Tutorial/abstractHandle.tex	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,38 +1,66 @@
 \chapter{Abstract Handles to Language Constructs}
-This chapter describes a reference design and its corresponding implementation for supporting abstract handles to language constructs in source code and optimization phases. 
-It can be used to facilitate the interoperability between compilers and tools. 
+This chapter describes a reference design and its corresponding implementation for
+supporting abstract handles to language constructs in source code and optimization
+phases. It can be used to facilitate the interoperability between compilers and tools.
+We define an abstract handle as a representation for a unique language construct in a
+specific program.  Interoperability between tools is achieved by writing out the abstract handles as
+strings and reading them within other tools to build the equivalent abstract handle.
+\footnote{Abstract Handles are not appropriate for program analysis
+since they are not intended to be used to capture the full structure of a program. Instead, 
+Abstract Handles represent references to language constructs in a program, capturing only
+a program's local structure; intended to support interoperability between source based
+tools (including compilers).  We don't advise the use of abstract handles in an
+aggressive way to construct an alternative intermediate representation (IR) for a full
+program.}
 
-The idea is to define unique identifiers for statements, loops, functions, 
-and other language constructs in source code. Given the diverse user
-requirements, an ideal specification should include multiple forms to specify a language construct. 
-Current, we are interested in the following forms for specifying language constructs:
+The idea is to define identifiers for unique statements, loops, functions, 
+and other language constructs in source code. Given the diverse user requirements, an
+ideal specification should include multiple forms to specify a language construct.
+
+Currently, we are interested in the following forms for specifying language constructs:
 \begin{itemize}
-\item Source file position information including path, filename, line and column number etc. 
-GNU standard source position from
-\url{http://www.gnu.org/prep/standards/html\_node/Errors.html} presents
-some examples.  
-\item Global or local numbering of specified language construct in source file
-  (e.g. 2nd "do" loop in a global scope).  The file is itself specified using an abstract
-          handle (typically generated from the file name). 
-\item Global or local names of constructs. Some language constructs, such
-as files, function definitions and namespace, have names which can be
-used as their handle within a context.
-\item Language-specific label mechanisms. They include named constructs in Fortran, numbered labels in Fortran, and statement labels in C and C++ and so on. 
+   \item Source file position information including path, filename, line and column number etc. 
+      GNU standard source position from 
+      \url{http://www.gnu.org/prep/standards/html\_node/Errors.html} presents
+      some examples.  
+   \item Global or local numbering of specified language construct in source file
+      (e.g. 2nd "do" loop in a global scope).  The file is itself specified using an
+       abstract handle (typically generated from the file name). 
+   \item Global or local names of constructs. Some language constructs, such
+      as files, function definitions and namespace, have names which can be
+      used as their handle within a context.
+   \item Language-specific label mechanisms. These include named constructs in Fortran,
+      numbered labels in Fortran, and statement labels in C and C++, etc. 
 \end{itemize}
 In addition to human-readable forms, compilers and tools can generate
 internal IDs for language constructs. It is up to compiler/tool developers
 to provide a way to convert their internal representations into human-readable formats. 
 
-We define an abstract handle as a unique representation for a language construct. It can have any of the human-readable or machine-generated forms. 
-A handle can be used alone or combined with other handles to specify a language construct. 
-A handle can also be converted from one form to another.
+% We define an abstract handle as a unique representation for a language construct. It can
+Abstract Handles can
+have any of the human-readable or machine-generated forms. A handle can be used alone or
+combined with other handles to specify a language construct. A handle can also be
+converted from one form to another (e.g. from a compiler specific form to an human
+readable form relative to the source position; filename, line number, etc.).
 Abstract handles can have different lifetimes depending on their use and implementation. 
-An abstract handle might be required to be persistent if it is used to reference a language construct that would be optimized over  multiple executions of one or more different tools. 
-Where as an abstract-handle might be internally generated only for purposes of
-           optimizations used in a single execution (e.g. optimization within a compiler). 
+An abstract handle might be required to be persistent if it is used to reference a
+language construct that would be optimized over multiple executions of one or more
+different tools. Where as an abstract-handle might be internally generated only for
+purposes of optimizations used in a single execution (e.g. optimization within a compiler).
 
+\section{Use Case}
+   A typical use can for Abstract Handles might be for a performance tool to 
+identify a collection of loops in functions that are computationally intensive
+and to construct Abstract Handles that refer to this specific loops.  Then
+pass the Abstract Handles to a second tool that might analyze the source code
+and/or the binary executable to evaluate if the computational costs are reasonable 
+or if optimizations might be possible.  The specific goal of the Abstract Handles
+is to support these sorts of uses within autotuning using diverse tools used
+and/or developed as part of autotuning research within the DOE SciDAC PERI project.
+
 \section{Syntax}
-A possible specification of language handles can have the following syntax:
+%  A possible specification of language handles can have the following syntax:
+   A possible grammar for abstract handles could be:
 
 \begin{verbatim}
 /* a handle is a single handle item or a link of them separated by ::, or
@@ -86,7 +114,7 @@
 
 \section{Examples}
 We give some examples of language handles using the syntax mentioned above. 
-ROSE AST's node type names are used as the construct type names. 
+Canonical AST's node type names are used as the construct type names. 
 Other implementations can use their own construct type names.
 
 \begin{itemize}
@@ -122,32 +150,44 @@
 SourceFile<name,"/home/PERI/test222.c">::FunctionDeclaration<name,"main">::
 ForStatement<numbering,2>
 \end{verbatim}
+\item A nested loop using numbering information (The first loop inside the second loop in function
+main()): 
+\begin{verbatim}
+SourceFile<name,"/home/PERI/test222.c">::FunctionDeclaration<name,"main">::
+ForStatement<numbering,2>::ForStatement<numbering,1>
+\end{verbatim}
+
 \end{itemize}
 
 \section{Reference Implementation}
-We provide a reference implementation of the abstract handle concept. 
-The source files are located in \textit{src/midend/abstractHandle}.
+Abstract Handles are fundamentally compiler and tool independent, however to
+clarify the concepts, provide meaningful examples, a working reference 
+implementation we have provided a reference implementation in ROSE.
+% Within ROSE we provide a reference implementation of the abstract handle concept. 
+The source files are located in \textit{src/midend/abstractHandle} in the ROSE distribution.
 A generic interface (abstract\_handle.h and abstract\_handle.cpp) provides
-data structures and operations for manipulating abstract handles using source file positions, numbering, or names. 
-Any compilers and tools can have their own implementations using the same interface.  
+data structures and operations for manipulating abstract handles using source file
+positions, numbering, or names. Any compilers and tools can have their own implementations
+using the same interface.
+
 \subsection{Connecting to ROSE}
 A ROSE adapter (roseAdapter.h and roseAdapter.cpp) using the interface is
 provided as a concrete implementation for the maximum capability of the
-implementation.
-
-Figure~\ref{Tutorial:abstractHandle1} shows the code to generate abstract
+implementation (within a source-to-source compiler).
+Figure~\ref{Tutorial:abstractHandle1} shows the code (using ROSE) to generate abstract
 handles for loops in an input source file (as in
 Figure~\ref{Tutorial:abstractHandle1input}). 
-Abstract handle constructors generate handles from abstract nodes, which are implemented using ROSE AST nodes. 
-Source position is used by default to generate a handle item. 
+Abstract handle constructors generate handles from abstract nodes, which are implemented
+using ROSE AST nodes. Source position is used by default to generate a handle item. 
 Names or numbering are used instead when source position information is not available. 
-The Constructor can also be used to generate a handle item using a
-specified handle type (numbering handles in the example).
-Figure~\ref{Tutorial:abstractHandle1out} is the output showing the generated handles for the loops.
+The Constructor can also be used to generate a handle item using a specified handle type
+(numbering handles in the example). Figure~\ref{Tutorial:abstractHandle1out} is the output
+showing the generated handles for the loops.
+
 %---------------------example 1. ----------------------
 \begin{figure}[!h]
 {\indent
-{\mySmallestFontSize
+{\mySmallFontSize
 % Do this when processing latex to generate non-html (not using latex2html)
 \begin{latexonly}
   \lstinputlisting{\TutorialExampleDirectory/abstractHandle1.cpp}
@@ -162,13 +202,13 @@
 }
 % End of scope in indentation
 }
-\caption{Generated handles for loops: using constructors with or without a specified handle type}
+\caption{Example 1: Generated handles for loops: using constructors with or without a specified handle type.}
 \label{Tutorial:abstractHandle1}
 \end{figure}
 %------------------ input------------------------------
 \begin{figure}[!h]
 {\indent
-{\mySmallestFontSize
+{\mySmallFontSize
 % Do this when processing latex to generate non-html (not using latex2html)
 \begin{latexonly}
   \lstinputlisting{\TutorialExampleDirectory/inputCode_AbstractHandle1.cpp}
@@ -183,7 +223,7 @@
 }
 % End of scope in indentation
 }
-\caption{Source code with some loops}
+\caption{Example 1: Example source code with some loops, used as input.}
 \label{Tutorial:abstractHandle1input}
 \end{figure}
 
@@ -191,7 +231,7 @@
 %---------------------example 1's output ----------------------
 \begin{figure}[!h]
 {\indent
-{\mySmallestFontSize
+{\mySmallFontSize
 % Do this when processing latex to generate non-html (not using latex2html)
 \begin{latexonly}
   \lstinputlisting{\TutorialExampleBuildDirectory/abstractHandle1.outx}
@@ -206,11 +246,12 @@
 }
 % End of scope in indentation
 }
-\caption{Handles generated for loops}
+\caption{Example 1: Abstract handles generated for loops.}
 \label{Tutorial:abstractHandle1out}
 \end{figure}
 
-Another example (shown in Figure~\ref{Tutorial:abstractHandle2})
+\clearpage
+A second example (shown in Figure~\ref{Tutorial:abstractHandle2})
 demonstrates how to create handles using user-specified strings
 representing handle items for language constructs within a source file
 (shown in Figure~\ref{Tutorial:abstractHandle2input}). 
@@ -220,7 +261,7 @@
 %---------------------example 2. ----------------------
 \begin{figure}[!h]
 {\indent
-{\mySmallestFontSize
+{\mySmallFontSize
 % Do this when processing latex to generate non-html (not using latex2html)
 \begin{latexonly}
   \lstinputlisting{\TutorialExampleDirectory/abstractHandle2.cpp}
@@ -235,14 +276,14 @@
 }
 % End of scope in indentation
 }
-\caption{Generated handles from strings representing handle items}
+\caption{Example 2: Generated handles from strings representing handle items.}
 \label{Tutorial:abstractHandle2}
 \end{figure}
 
 %------------------ input------------------------------
 \begin{figure}[!h]
 {\indent
-{\mySmallestFontSize
+{\mySmallFontSize
 % Do this when processing latex to generate non-html (not using latex2html)
 \begin{latexonly}
   \lstinputlisting{\TutorialExampleDirectory/inputCode_AbstractHandle2.cpp}
@@ -257,7 +298,7 @@
 }
 % End of scope in indentation
 }
-\caption{Source code with some language constructs}
+\caption{Example 2: Source code with some language constructs.}
 \label{Tutorial:abstractHandle2input}
 \end{figure}
 
@@ -265,7 +306,7 @@
 %---------------------example 2's output ----------------------
 \begin{figure}[!h]
 {\indent
-{\mySmallestFontSize
+{\mySmallFontSize
 % Do this when processing latex to generate non-html (not using latex2html)
 \begin{latexonly}
   \lstinputlisting{\TutorialExampleBuildDirectory/abstractHandle2.outx}
@@ -280,21 +321,25 @@
 }
 % End of scope in indentation
 }
-\caption{Handles generated from string and their language constructs}
+\caption{Example 2: Handles generated from string and their language constructs.}
 \label{Tutorial:abstractHandle2out}
 \end{figure}
 
+\clearpage
 \subsection{Connecting to External Tools}
-We give yet another example to demonstrate how to use the abstract interface
-with any other tools, which may have less features in terms of
-supported language constructs and their correlations compared to a compiler. 
-Assume a tool operating on some simple non-nesting for-loops
-within a source file. The data structure representing such loops is given
-in Figure~\ref{Tutorial:myloop}.
-
+   A third example is provided to demonstrate how to use the abstract interface
+with any other tools, which may have less features in terms of supported language
+constructs and their correlations compared to a compiler. 
+Assume a tool operating on some simple for-loops within an arbitrary source file (the
+input file is not shown in this example). Such a tool might
+have an internal data structure representing loops; such as that in given in 
+Figure~\ref{Tutorial:myloop}.  We will show how the tool specific data structure
+for loops can be used to generate abstract handles and output as strings that can
+be used by other tools which use abstract handles (which would generate the
+abstract handles by reading the strings).
 \begin{figure}[!h]
 {\indent
-{\mySmallestFontSize
+{\mySmallFontSize
 % Do this when processing latex to generate non-html (not using latex2html)
 \begin{latexonly}
   \lstinputlisting{\TutorialExampleDirectory/../src/midend/abstractHandle/myloop.h}
@@ -309,24 +354,25 @@
 }
 % End of scope in indentation
 }
-\caption{A simple data structure representing a loop}
+\caption{Example 3: A simple data structure used to represent a loop in an arbitrary tool.}
 \label{Tutorial:myloop}
 \end{figure}
 
-
 An adapter (loopAdapter.h and loopAdapter.cpp) using the proposed abstract
 handle interface is given in \textit{src/midend/abstractHandle}.
 It provides a concrete implementation for the interface for the simple loops and adds a
-node to support file nodes (Compared to the full-featured ROSE IR, this
-additional file node is an additional work when using tools without internal nodes
-supporting files). 
+node to support file nodes (Compared to a full-featured IR for a compiler, the
+file node is an additional detail for tools without data structures to support files).
 The test program is given in Figure ~\ref{Tutorial:testMyLoop}.
-Again, it creates a top level file handle first. Then a loop handle is
-created within the file handle. Another loop handle is created from its 
-string format. 
+Again, it creates a top level file handle first. Then a loop handle
+({\em loop\_handle1}) is created within the file handle using its relative numbering information. 
+The {\em loop\_handle2} is created from from its string format using file position
+information (using GNU standard file position syntax). The {\em loop\_handle3} uses its
+relative numbering information within {\em loop\_handle1}.
+
 \begin{figure}[!h]
 {\indent
-{\mySmallestFontSize
+{\mySmallFontSize
 % Do this when processing latex to generate non-html (not using latex2html)
 \begin{latexonly}
   \lstinputlisting{\TutorialExampleDirectory/../src/midend/abstractHandle/testMyLoop.cpp}
@@ -341,35 +387,53 @@
 }
 % End of scope in indentation
 }
-\caption{A test program for simple loops' abstract handles}
+\caption{Example 3: A test program for simple loops' abstract handles.}
 \label{Tutorial:testMyLoop}
 \end{figure}
 
 
-The output of the program is shown in Figure~\ref{Tutorial:testMyLoopOutput}
+The output of the program is shown in Figure~\ref{Tutorial:testMyLoopOutput}.  It
+demonstrates the generated strings to represent the abstract handles in the 
+arbitrary code operated upon by the tool.  Interoperability is achieved by 
+another tool reading in the generated string representation to generate an
+abstract handle to the same source code language construct.
 %\begin{verbatim}
 \begin{figure}[!h]
 {\indent
-{\mySmallestFontSize
+{\mySmallFontSize
 \begin{latexonly}
 \begin{lstlisting} 
-bash-3.00$ ./testMyLoop
+bash-3.00: ./testMyLoop
 Created a file handle:
 SourceFile<name,file1.c>
 Created a loop handle:
-SourceFile<name,file1.c>::ForStatement<position,7>
+SourceFile<name,file1.c>::ForStatement<numbering,1>
 Created a loop handle:
 SourceFile<name,file1.c>::ForStatement<position,12>
+Created a loop handle:
+SourceFile<name,file1.c>::ForStatement<numbering,1>::ForStatement<numbering,1>
 \end{lstlisting}
 \end{latexonly}
 % end of scope in font size
 }
 % End of scope in indentation
 }
-\caption{Output of the test program for simple loops' abstract handles}
+\caption{Example 3: Output of the test program for simple loops' abstract handles (as strings).}
 \label{Tutorial:testMyLoopOutput}
 \end{figure}
 
+\clearpage
+\section{Summary}
 
+   Abstract handles are low level mechanisms to support multiple tools
+to exchange references to source code.  Several examples are used to
+present the different features of abstract handles.  Importantly, the 
+specification of abstract handles is tool independent.  A reference
+implementation is provided and is publically available within the
+ROSE compiler framework.  We encourage debate on the pros and cons
+of this concept to support interoperability of tools which must
+pass references to source code between them.  This work is expected
+to a small piece of the infrastructure to suport autotuning research.
+
 %\end{verbatim}
 

Modified: branches/rice/docs/Rose/Tutorial/binaryAnalysis.tex
===================================================================
--- branches/rice/docs/Rose/Tutorial/binaryAnalysis.tex	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/Tutorial/binaryAnalysis.tex	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,15 +1,15 @@
 \chapter{Binary Analysis}
 
-This chapter discusses the capabilities of ROSE to read and analyze software binaries.
+This chapter discusses the capabilities of ROSE to read, analyze and transform 
+(transformations to the binary file format) binary executables.
 
-In the following we use a small example that demonstrates various features of Binary-Rose.
-The source code of our binary example is:
+In the following sections we use a small example that demonstrates various 
+features of Binary-Rose. The source code of our binary example is:
 
 \begin{figure}[!h]
 {\indent
 {\mySmallFontSize
 
-
 % Do this when processing latex to generate non-html (not using latex2html)
 \begin{latexonly}
    \lstinputlisting{\TutorialExampleDirectory/bin_example.C}
@@ -28,13 +28,23 @@
 \label{Tutorial:examplesourcecode}
 \end{figure}
 
+Much larger binaries can be analized, but such larger binary executables are more
+difficult to present (in this tutorial).
 
+
 \section{Loading binaries}
 
-Binary-ROSE is currently based on two front-ends: \emph{objdump} and \emph{IdaPro-mysql}.
+Binary support in ROSE is currently based on two front-ends: 
+% \emph{objdump} and \emph{IdaPro-mysql}.
+\begin{enumerate}
+   \item A custom build \emph{ROSE Disassembler} (for ARM, x86, and PowerPC), and
+   \item \emph{IdaPro-mysql}
+\end{enumerate}
 
-\subsection{objdump}
 
+% \subsection{objdump}
+\subsection{ROSE Disassembler}
+
 The following code reads in a binary and creates a binary ROSE AST:
 
 {\mySmallFontSize

Modified: branches/rice/docs/Rose/Tutorial/loopOptimization.tex
===================================================================
--- branches/rice/docs/Rose/Tutorial/loopOptimization.tex	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/Tutorial/loopOptimization.tex	2008-11-11 22:06:33 UTC (rev 119)
@@ -62,7 +62,7 @@
 \label{Tutorial:exampleLoopOptimization}
 \end{figure}
 
-% \clearpage
+\clearpage
 \section{Matrix Multiply Example}
 
    Using the matrix multiply example code shown in 
@@ -118,7 +118,7 @@
 \end{figure}
 
 
-% \clearpage
+\clearpage
 \section{Loop Fusion Example}
 
    Using the loop fusion example code shown in 
@@ -229,7 +229,7 @@
 \label{Tutorial:exampleLoopProcessor2}
 \end{figure}
 
-% \clearpage
+\clearpage
 \section{Matrix Multiplication Example (mm.C)}
 
    Using the matrix multiplication example code shown in 
@@ -285,7 +285,7 @@
 \end{figure}
 
 
-% \clearpage
+ \clearpage
 \section{Matrix Multiplication Example Using Linearized Matrices (dgemm.C)}
 
    Using the matrix multiplication example code shown in 
@@ -342,7 +342,7 @@
 
 
 
-% \clearpage
+ \clearpage
 \section{LU Factorization Example (lufac.C)}
 
    Using the LU factorization example code shown in 
@@ -398,7 +398,7 @@
 \end{figure}
 
 
-% \clearpage
+ \clearpage
 \section{Loop Fusion Example (tridvpk.C)}
 
    Using the loop fusion example code shown in 

Copied: branches/rice/docs/Rose/asm_code_samples_gcc.pdf (from rev 117, trunk/docs/Rose/asm_code_samples_gcc.pdf)
===================================================================
(Binary files differ)

Modified: branches/rice/docs/Rose/developersAppendix.tex
===================================================================
--- branches/rice/docs/Rose/developersAppendix.tex	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/developersAppendix.tex	2008-11-11 22:06:33 UTC (rev 119)
@@ -113,171 +113,6 @@
 
 \end{itemize}
 
-
-
-\section{Building ROSE from the Source Code Repository Checkout {\em (for developers only)}}
-\label{gettingStarted:DeveloperInstructions}
-
-     The instructions for building ROSE from SVN are a little more complex.
-A few GNU software build tools are required (not required for the user
-{\em ROSE Distribution, e.g. ROSE-\VersionNumber.tar.gz}.  Required 
-tools ({\bf ** Note current dependencies}):
-\begin{itemize}
-     \item autoconf \\
-          Autoconf version 2.53 or higher is required. % Autoconf can be problematic, some
-          Newer versions of Autoconf introduce experimental features that could also be problematic.  The
-          Autoconf development has not been particularly good at verifying compatibility
-          with previous releases of their work.  Some users have reported having to
-          install version 2.53 specifically to use ROSE. 
-          {\em Check the ROSE/ChangeLog for current version numbers to be used with ROSE.}
-     \item automake \\
-          Automake version 1.9 or higher is required. Most software projects appear to be
-          less sensitive to the specific version of automake.
-          {\em Check the ROSE/ChangeLog for current version numbers to be used with ROSE.}
-\end{itemize}
-
-%   Several optional tools are also useful to have for ROSE development (required to build
-% documentation) these are:
-% \begin{itemize}
-%     \item LaTeX
-%     \item Doxygen
-%     \item DOT
-% \end{itemize}
-
-The {\tt ROSE/ChangeLog} details the changes between versions of ROSE and lists the
-specific version numbers of all software upon which ROSE depends. Comments of this type
-appear in the {\tt ChangeLog} as:
-\fixme{This needs to be updated.}
-{\footnotesize
-\begin{verbatim}
-********* TESTED with **************
-(*)  automake (GNU automake) 1.6.3
-(*)  autoconf (GNU Autoconf) 2.57
-(*)  GNU Make version 3.79.1
-(**) g++ (GCC) 3.3.6
-(**) gcc (GCC) 3.3.6
-(*)  doxygen 1.3.8
-(*)  dot version 1.12 (Sun Aug 15 02:43:07 UTC 2004)
-(*)  TeX (Web2C 7.3.1) 3.14159
-(*)  Original LaTeX2HTML Version 2002 (1.62)
-(*)  sqlite (requires g++ 3.3.2) 3.2.1
-
-(*)  Optional for use of ROSE (by users), but required for internal ROSE development (by ROSE project team)
-(**) Required for use of ROSE (and for all internal development)
-\end{verbatim}
-}
-
-The build process for a {\em Developer Version} is:
-\begin{enumerate}
-     \item Checkout a NEW version from SVN: \\
-     The newest work on ROSE (as of March 2008) is using SVN, instead of CVS.
-     This switch to SVN means the directions for how developers use ROSE have
-     changed.  This effects developers of ROSE only (or anyone with access to 
-     the newer SVN repository).
-     {\bf Please learn about SVN on another project before using it on ours.}
-
-     To checkout ROSE (assumes access to repository at LLNL), type: \\
-     {\tt svn checkout file:///usr/casc/overture/ROSE/svn/ROSE/trunk/ROSE svn-rose} \\
-     This will checkout a copy of the source code for ROSE from the svn repository.
-     Any directory name can be used for {\tt svn-rose} in the example commandline.
-
-     \item  Update an {\em existing} version from SVN: \\
-     Run {\tt svn update} from inside the ROSE directory (at the top level) to update
-     an existing version of ROSE with the new changes in the SVN repository.
-%    \fixme{What are the SVN rules for pruning directories?}
-%    Note that the ROSE team uses a common {\tt .cvsrc} file so that reasonable options
-%    to prune empty directories are used uniformly within project development.
-
-     \item After being checked out (or updated) from SVN: \\
-     Run the {\tt build} script in the top level ROSE directory to build all configure scripts
-     and {\tt Makefile.in} files (using {\bf automake}).  This is the difference between the development
-     environment and the distribution. This script will call the different {\bf autoconf}
-     tools required to setup ROSE and also checkout other work common to multiple projects
-     within CASC.
-
-%%     \item {\bf CVS} checkout \\
-%%           Type {\tt cvs -d/usr/casc/overture/ROSE/ROSE2_Repository checkout ROSE} to
-%%           checkout a new version of ROSE into a new directory.  {\em The ROSE directory
-%%           should not exist in the current directory.}  Checking out a new version of ROSE
-%%           on top of an existing version can lead to undefined results.
-%     \item Checkout a NEW version from CVS: \\
-%     In your {\tt .cshrc} file set the variable {\tt CVSROOT} to 
-%     {\tt /usr/casc/overture/ROSE/ROSE2\_Repository}
-%     ({\tt setenv CVSROOT /usr/casc/overture/ROSE/ROSE2\_Repository})
-%     and ({\tt setenv CVS\_RSH ssh}).
-%     The later is to permit checkout of the {\bf acmacros} project from its separate 
-%     CVS repository.  Note that this will only work from a machine on the LLNL domain.
-%     Other machines will have to get the separate tarball for this project (it should
-%     also be in the {\bf CVS} repository and is checked out with ROSE into the top 
-%     level ROSE directory).
-
-%     Then run {\tt source ~/.cshrc} to have this environment variable set properly.
-%     Now you can run {\tt cvs} to checkout the current version from ROSE. Type
-%     {\tt cvs co ROSE} or {\tt cvs checkout ROSE} to do this.
-
-%     \item  Update an {\em existing} version from CVS: \\
-%     Run {\tt cvs update} from inside the ROSE directory (at the top level) to update
-%     an existing version of ROSE with the new changes in the CVS repository.
-%     Note that the ROSE team uses a common {\tt .cvsrc} file so that reasonable options
-%     to prune empty directories are used uniformly within project development.
-
-%     \item After being checked out (or updated) from CVS: \\
-%     Run the {\tt build} script in the top level ROSE directory to build all configure scripts
-%     and {\tt Makefile.in} files (using {\bf automake}).  This is the difference between the development
-%     environment and the distribution. This script will call the different {\bf autoconf}
-%     tools required to setup ROSE and also checkout other work common to multiple projects
-%     within CASC.
-
-     \item Build a compile directory (for the compile tree): \\
-     Make a separate directory to be the root of the compile tree. There can be many compile 
-     trees if you want.
-
-     {\em Note: Before the next step be sure you are using the correct compiler ({\bf g++}
-     C++ compiler
-     [see ChangLog file for current version used for development, generally any 3.x
-     version]) and that you are using the correct version of {\bf autoconf} and 
-     {\bf automake}.}
-
-     \item Running configure: \\
-     Type {\tt <pathToSourceTree>/configure --help} to see the different configuration options.
-     {\tt <pathToSourceTree>} is meant to be the absolute or relative path to the source tree
-     where the {\bf SVN} version was checked out.  After options have been selected, type
-     {\tt <pathToSourceTree>/configure <selected-options>} to run the configure script.
-     Running the configure script with no options is sufficient (uses default values which
-     are either already set or which the configure script will figure out on your machine).
-     For more on ROSE configure options, see \ref{gettingStarted:configureOptions}.
-
-     \item Running Make after running configure: \\
-     After configuration (after the configure script is finished) run {\tt make} or {\tt gmake}.
-     If you have a development version then you can also make distributions by running
-     {\tt make dist}.  If you want to build a new distribution {\em AND} test it, 
-     run {\tt make distcheck} (make or gmake may be used interchangeably). 
-     See details of running make in parallel \ref{gettingStarted:parallelMake}.
-
-     \item Testing your new version of ROSE: \\
-     Automated tests are available within the distribution of ROSE. To run these tests,
-     type {\tt make check}.  Tests on a modern Intel/Linux machine currently take about 
-     15 minutes to run.
-   % if you have configured ROSE to reference a version of the A++/P++ library (since they include
-   % tests of A++/P++ within ROSE).  Tests on a more modern Linux machine are much faster.
-
-     \item Installing ROSE: \\
-     From this point you can generate ROSE the way a user would see it (as if you had
-     started with a {\em ROSE Distribution}).  Type {\tt make install} to install ROSE.
-     See details of installing ROSE \ref{gettingStarted:installation}.
-
-     \item Testing the installed version of ROSE: \\
-     To test the installed version of ROSE type {\tt make installcheck}.  To test
-     compilation, this forces one
-     or more of the Example translators to be built using only the header files from
-     the {\tt \{install\_dir\}/include} directory for their compilation.  To test linking
-     ROSE translators forces the previously compiled example translator to only use the libraries
-     installed in {\tt \{install\_dir\}/lib}.  This is sufficient to test the installation
-     the way that users are expected to use ROSE (only from an installed version).
-     A sample {\tt makefile} is generated, see \ref{gettingStarted:compilingTranslator}.
-
-\end{enumerate}
-
 % DQ (6/5/2008): This is the resulting lesson from the erasure
 % of my ROSE directory as the result of a bad cron script.
 \section{How to recover from a file-system disaster at LLNL}
@@ -806,8 +641,24 @@
 \end{enumerate}
 
 
-\section{Maintaining the ROSE Email List (casc-rose at llnl.gov)}
+\section{ROSE Email Lists}
+\label{rose_email_list_info}
+% DQ (10/28/2008): These email addresses have been copied to the installRose.tex as well.
+   We have three mailing lists for core developers (those who have write access to
+the internal repository), all developers (anyone who has write access to the
+internal or external repository) and all
+users of ROSE. They are:
+\begin{itemize}
+\item rose-core at nersc.gov, web interface: 
+\htmladdnormallink{https://mailman.nersc.gov/mailman/listinfo/rose-core}{https://mailman.nersc.gov/mailman/listinfo/rose-core}.
+\item rose-developer at nersc.gov, web interface: 
+\htmladdnormallink{https://mailman.nersc.gov/mailman/listinfo/rose-developer}{https://mailman.nersc.gov/mailman/listinfo/rose-developer}.
+\item rose-public at nersc.gov, web interface:
+\htmladdnormallink{https://mailman.nersc.gov/mailman/listinfo/rose-public}{https://mailman.nersc.gov/mailman/listinfo/rose-public}.
+\end{itemize}
 
+
+We are phasing out the casc-rose at llnl.gov mail list. 
    There is an open email list for ROSE which can be subscribed to
 automatically.  The list name is: {\bf casc-rose}.
 

Modified: branches/rice/docs/Rose/installRose.tex
===================================================================
--- branches/rice/docs/Rose/installRose.tex	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/installRose.tex	2008-11-11 22:06:33 UTC (rev 119)
@@ -338,6 +338,12 @@
            type {\tt make installcheck}.
            A sample {\tt makefile} is generated.%; see section \ref{gettingStarted:compilingTranslator}.
 \end{enumerate}
+\subsection{Building ROSE from a Development Version}
+Building ROSE from an internal or external development version is very
+similar to building it from a distribution. The major difference is that
+for development versions, you have to type ./build in the source tree to 
+generate the configure script and Makefile.ins. Once this is done, the rest
+steps are the same as those of building a distribution version.
 
 \subsection{ROSE Configure Options}
 \label{gettingStarted:configureOptions}
@@ -474,12 +480,12 @@
 simplify their use of ROSE by using it from an installed version of ROSE.  This permits
 compilation using a single include directory and the specification of only two libraries, 
 as in:
-% {\footnotesize
 \begin{verbatim}
      g++ -I{\<install dir\>/include} -o executable executable.C 
          -L{\<install dir\>/lib} -lrose -ledg -lm $(RT_LIBS)
 \end{verbatim}
-% }
+% $ reset emacs highlighting
+
 See the example makefile in \\
 {\tt ROSE/exampleTranslators/documentedExamples/simpleTranslatorExamples/exampleMakefile} \\
 in Section \ref{gettingStarted:compilingTranslator}
@@ -499,6 +505,32 @@
 %    documentation does not yet really reflect this detail.  Also since the build process
 %    writes to the install directory we have to explain this in the documentation.}
 
+\subsection{MPI Support}
+     ROSE supports the use of MPI for parallel distributed memory program analysis, a
+research focus within the ROSE project.  To support this use the {\tt --with-mpi}
+option on the configure command line.  If you get the following message:
+%{\footnotesize
+\begin{verbatim}
+configuration file /home/<user name>/.mpd.conf not found
+A file named .mpd.conf file must be present in the user's home
+directory (/etc/mpd.conf if root) with read and write access
+only for the user, and must contain at least a line with:
+MPD_SECRETWORD=<secretword>
+One way to safely create this file is to do the following:
+  cd $HOME
+  touch .mpd.conf
+  chmod 600 .mpd.conf
+and then use an editor to insert a line like
+  MPD_SECRETWORD=mr45-j9z
+into the file.  (Of course use some other secret word than mr45-j9z.)
+\end{verbatim}
+%}
+% $ reset emacs highlighting
+Then follow the directions to build the {\tt .mpd.conf} file.  The use of the 
+MPI configure option will allow additional code in ROSE to be compiled and 
+additional tests to be run.
+
+
 \subsection{Testing ROSE}
      A set of test programs is available.  %More details are in section \ref{testing}.
 % written about this in later versions of the manual.  
@@ -506,6 +538,30 @@
 Several years of contributed bug reports and internal test codes have been accumulated 
 in the {\tt ROSE/tests} directory.
 
+Extra tests are available for development versions of ROSE. ROSE developers
+are highly recommended to run {\tt make dist} and {\tt make distcheck} to make
+sure that the modified development versions can be used to create functioning
+distributions.
+
 \subsection{Getting Help}
-     You may use the following mailing list to ask for help from the ROSE development 
-team: {\it casc-rose *dot* llnl *dot* gov}.
+%     You may use the following mailing list to ask for help from the ROSE development 
+% team: {\it casc-rose *dot* llnl *dot* gov}.
+%    The ROSE project maintain a number of email lists for internal development, 
+% external devlopers, and external users. More information is in the ROSE User Manual
+% in the Developer's Appendix (see \ref{rose_email_list_info}).
+
+% DQ (10/28/2008): This information is copied from:
+%                  ROSE User Manual: Developer's: Appendix: ROSE Email Lists.
+
+We have three mailing lists for core developers (those who have write access to
+the internal repository), all developers (anyone who has write access to the
+internal or external repository) and all
+users of ROSE. They are:
+\begin{itemize}
+\item rose-core at nersc.gov, web interface: 
+\htmladdnormallink{https://mailman.nersc.gov/mailman/listinfo/rose-core}{https://mailman.nersc.gov/mailman/listinfo/rose-core}.
+\item rose-developer at nersc.gov, web interface: 
+\htmladdnormallink{https://mailman.nersc.gov/mailman/listinfo/rose-developer}{https://mailman.nersc.gov/mailman/listinfo/rose-developer}.
+\item rose-public at nersc.gov, web interface:
+\htmladdnormallink{https://mailman.nersc.gov/mailman/listinfo/rose-public}{https://mailman.nersc.gov/mailman/listinfo/rose-public}.
+\end{itemize}

Modified: branches/rice/docs/Rose/leftmenu.html.in
===================================================================
--- branches/rice/docs/Rose/leftmenu.html.in	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/leftmenu.html.in	2008-11-11 22:06:33 UTC (rev 119)
@@ -3,20 +3,15 @@
         <tr>
           <td width="221" class="Header3"><p>&nbsp;</p>
             <p class="style3"><a href="index.html" target="_blank">Home</a></p>
-            <p class="style3"><a href="ROSE_InstallationInstructions.pdf">Installation</a></p>
-            <!-- <p class="style3"><a href="ROSE_UserManual/ROSE- at VERSION@-UserManual.ps">User Manual (postscript)</p> -->
-            <!-- <p class="style3"><a href="ROSE_UserManual/manual.html">User Manual</p> -->
-            <!-- <p class="style3"><a href="ROSE_Tutorial/ROSE- at VERSION@-Tutorial.ps">Tutorial (postscript)</p> -->
-            <p class="style3"><a href="ROSE_UserManual/ROSE- at VERSION@-UserManual.pdf">User Manual (pdf)</p>
-            <p class="style3"><a href="ROSE_Tutorial/ROSE- at VERSION@-Tutorial.pdf">Tutorial (pdf)</p>
-            <!-- <p class="style3"><a href="ROSE_Tutorial/tutorial.html">Tutorial (generated from Latex, work in progress)</p> -->
-            <p class="style3"><a href="projects.html" target="_blank">Projects</p>
+            <p class="style3"><a href="ROSE_InstallationInstructions.pdf" target="_blank">Installation Guide (pdf)</a></p>
+            <p class="style3"><a href="ROSE_UserManual/ROSE- at VERSION@-UserManual.pdf" target="_blank">ROSE User Manual (pdf)</p>
+            <p class="style3"><a href="ROSE_Tutorial/ROSE- at VERSION@-Tutorial.pdf" target="_blank">ROSE Tutorial (pdf)</p>
+            <p class="style3"><a href="projects.html" target="_blank">Internal ROSE Projects</p>
             <p class="style3"><a href="ROSE_HTML_Reference/index.html" target="_blank">Programmer's Reference</p>
             <p class="style3"><a href="ROSE_HTML_Reference/ProjectPublications.html" target="_blank">Publications</p>
-            <!-- <p class="style3"><a href="ROSE_HTML_Reference/Gallery.html">Download Software</p> -->
-            <!-- <p class="style3"><a href="ROSE_HTML_Reference/ProjectDownLoadPage.html">Download Software</p> -->
-            <p class="style3"><a href="https://outreach.scidac.gov/projects/rose/" target="_blank">Released Software</p>
-            <p class="style3"><a href="regressionTest.html" target="_blank">Regression Tests</p>
+            <!-- <p class="style3"><a href="ROSE_HTML_Reference/Gallery.html"> Gallery</p> -->
+            <p class="style3"><a href="https://outreach.scidac.gov/projects/rose/" target="_blank">Download Software</p>
+            <p class="style3"><a href="regressionTest.html" target="_blank">External Regression Test Results</p>
             <p class="style3"><a href="https://outreach.scidac.gov/tracker/?group_id=24" target="_blank">Report Bugs</p>
             <!-- <p class="style3"><a href="ROSE_HTML_Reference/ProjectRelatedWorkPage.html">Related Work</p> -->
           </td>

Modified: branches/rice/docs/Rose/manual.tex.in
===================================================================
--- branches/rice/docs/Rose/manual.tex.in	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/manual.tex.in	2008-11-11 22:06:33 UTC (rev 119)
@@ -51,6 +51,7 @@
 \newcommand{\AstRewriteExampleDirectory}{@top_srcdir@/exampleTranslators/documentedExamples/AstRewriteExamples}
 \newcommand{\TutorialExampleDirectory}{@top_srcdir@/tutorial}
 \newcommand{\TutorialExampleBuildDirectory}{@top_builddir@/tutorial}
+\newcommand{\TopSourceDirectory}{@top_srcdir@}
 
 \newcommand{\DatabaseExampleDirectory}{@top_srcdir@/exampleTranslators/documentedExamples/dataBaseExamples}
 

Modified: branches/rice/docs/Rose/rose.cfg.in
===================================================================
--- branches/rice/docs/Rose/rose.cfg.in	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/rose.cfg.in	2008-11-11 22:06:33 UTC (rev 119)
@@ -451,35 +451,35 @@
                          @top_srcdir@/src/extra.docs \
                          @top_srcdir@/projects/projects.docs
 
-EXTRA_STUFF 			= \
-		         @top_srcdir@/src/roseExtensions/roseHPCToolkit/docs \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/util \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml-xercesc \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/sage \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml2profir \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir2sage \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/examples \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/src \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/util \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/xml \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/xml-xercesc \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/profir \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/sage \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/xml2profir \
-                         @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/profir2sage
+# EXTRA_STUFF 			= \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/docs \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/util \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml-xercesc \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/sage \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml2profir \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir2sage \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/examples \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/src \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/util \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/xml \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/xml-xercesc \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/profir \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/sage \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/xml2profir \
+#                          @top_srcdir@/src/roseExtensions/roseHPCToolkit/src/profir2sage
 
-SIMPLE_INPUT                  = \
-                         @top_pwd@/rose.docs \
-                         @top_pwd@/docs/Rose/AvailableDocumentation.docs \
-                         @top_srcdir@/src/frontend/frontend.docs \
-                         @top_srcdir@/src/frontend/CxxFrontend/EDG_3.3/documentation.docs \
-                         @top_srcdir@/src/frontend/Open64/documentation.docs \
-                         @top_pwd@/src/frontend/SageIII/sage.docs \
-                         @top_srcdir@/src/frontend/SageIII/docs \
-                         @top_srcdir@/src/extra.docs
+# SIMPLE_INPUT                  = \
+#                          @top_pwd@/rose.docs \
+#                          @top_pwd@/docs/Rose/AvailableDocumentation.docs \
+#                          @top_srcdir@/src/frontend/frontend.docs \
+#                          @top_srcdir@/src/frontend/CxxFrontend/EDG_3.3/documentation.docs \
+#                          @top_srcdir@/src/frontend/Open64/documentation.docs \
+#                          @top_pwd@/src/frontend/SageIII/sage.docs \
+#                          @top_srcdir@/src/frontend/SageIII/docs \
+#                          @top_srcdir@/src/extra.docs
 
 
 # If the value of the INPUT tag contains directories, you can use the 
@@ -511,7 +511,7 @@
                          @top_srcdir@/AST_RewriteMechanism/testRewriteReplacementPermutations.C \
                          @top_srcdir@/AST_RewriteMechanism/test1.C \
                          @top_srcdir@/AST_RewriteMechanism/inputProgram1.C \
-    			@top_srcdir@/src/frontend/SageIII/sageInterface/highLevelInterface.h \
+                         @top_srcdir@/src/frontend/SageIII/sageInterface/highLevelInterface.h \
                          @top_srcdir@/util/testStrings.C \
                          @top_srcdir@/util/roseString.h \
                          @top_srcdir@/util/roseString.C \
@@ -552,7 +552,8 @@
 # directories that contain image that are included in the documentation (see 
 # the \image command).
 
-IMAGE_PATH             = .
+# IMAGE_PATH             = .
+IMAGE_PATH             = @top_srcdir@/docs/Rose
 
 # The INPUT_FILTER tag can be used to specify a program that doxygen should 
 # invoke to filter for each input file. Doxygen will invoke the filter program 

Modified: branches/rice/docs/Rose/roseHelpOutput.txt
===================================================================
--- branches/rice/docs/Rose/roseHelpOutput.txt	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/docs/Rose/roseHelpOutput.txt	2008-11-11 22:06:33 UTC (rev 119)
@@ -21,6 +21,8 @@
                              follow C99 standard, disable C++
      -rose:Cxx_only, -rose:Cxx
                              follow C++ 89 standard
+     -rose:OpenMP, -rose:openmp
+                             follow OpenMP 3.0 C/C++ specification
      -rose:UPC_only, -rose:UPC
                              follow Unified Parallel C 1.2 specification
      -rose:upc_threads n     Enable UPC static threads compilation with n threads

Modified: branches/rice/projects/AstEquivalence/Makefile.am
===================================================================
--- branches/rice/projects/AstEquivalence/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/AstEquivalence/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -6,7 +6,7 @@
 if ROSE_USE_QT
 if ROSE_USE_SQLITE_DATABASE
 
-bin_PROGRAMS = astEquivalence evaluateAllBinaries runIDA
+bin_PROGRAMS = astEquivalence createTextFiles evaluateAllBinaries runIDA
 
 astEquivalence_SOURCES = \
 	astEquivalenceGui.C \
@@ -15,6 +15,13 @@
       
 astEquivalence_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) -lrt
 
+createTextFiles_SOURCES = \
+	createTextFiles.C 
+
+      
+createTextFiles_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) -lrt
+
+
 evaluateAllBinaries_SOURCES = \
 	evaluateAllBinaries.C 
       

Modified: branches/rice/projects/AstEquivalence/astEquivalenceGui.C
===================================================================
--- branches/rice/projects/AstEquivalence/astEquivalenceGui.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/AstEquivalence/astEquivalenceGui.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -24,24 +24,6 @@
 using namespace std;
 using namespace boost;
 using namespace __gnu_cxx;
-class FindAsmFunctionsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmFunctionDeclaration *>* , void* >
-{
-  public:
-    void* operator()(first_argument_type node, std::vector<SgAsmFunctionDeclaration*>* insns ) const{
-      if (isSgAsmFunctionDeclaration(node)) insns->push_back(isSgAsmFunctionDeclaration(node));
-      return NULL;
-    }
-};
-#if 0
-class FindInstructionsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmx86Instruction *>* , void* >
-{
-  public:
-    void* operator()(first_argument_type node, std::vector<SgAsmx86Instruction*>* insns ) const{
-      if (isSgAsmx86Instruction(node)) insns->push_back(isSgAsmx86Instruction(node));
-      return NULL;
-    }
-};
-#endif
 
 
 static string htmlEscape(const string& s) {

Copied: branches/rice/projects/AstEquivalence/createTextFiles.C (from rev 117, trunk/projects/AstEquivalence/createTextFiles.C)
===================================================================
--- branches/rice/projects/AstEquivalence/createTextFiles.C	                        (rev 0)
+++ branches/rice/projects/AstEquivalence/createTextFiles.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,329 @@
+#include <boost/program_options.hpp>
+#include "boost/filesystem/operations.hpp"
+#include "boost/filesystem/path.hpp"
+#include "boost/progress.hpp"
+#include <boost/algorithm/string.hpp>
+#include <boost/smart_ptr.hpp>
+
+
+#include <iostream>
+#include <list>
+#include "rose.h"
+
+using namespace std;
+using namespace boost;
+class DeleteAST : public SgSimpleProcessing
+   {
+     public:
+      //! Required traversal function
+          void visit (SgNode* node);
+   };
+
+void
+DeleteAST::visit(SgNode* node)
+   {
+     delete node;
+   }
+
+void DeleteSgTree( SgNode* root)
+{
+  DeleteAST deleteTree;
+  deleteTree.traverse(root,postorder);
+}
+
+SgNode* disassembleFile(std::string disassembleName)
+{
+
+    RoseBin_Def::RoseAssemblyLanguage=RoseBin_Def::x86;
+    RoseBin_Arch::arch=RoseBin_Arch::bit32;
+    RoseBin_OS::os_sys=RoseBin_OS::linux_op;
+    RoseBin_OS_VER::os_ver=RoseBin_OS_VER::linux_26;
+
+
+    RoseFile* roseBin = new RoseFile( (char*)disassembleName.c_str()  );
+
+    cerr << " ASSEMBLY LANGUAGE :: " << RoseBin_Def::RoseAssemblyLanguage << endl;
+    // query the DB to retrieve all data
+
+    SgNode* globalBlock = roseBin->retrieve_DB();
+
+    // traverse the AST and test it
+    roseBin->test();
+
+
+    return globalBlock;
+
+}
+
+
+static string htmlEscape(const string& s) {
+  string s2;
+  for (size_t i = 0; i < s.size(); ++i) {
+    switch (s[i]) {
+      case '<': s2 += "&lt;"; break;
+      case '>': s2 += "&gt;"; break;
+      case '&': s2 += "&amp;"; break;
+      default: s2 += s[i]; break;
+    }
+  }
+  return s2;
+}
+
+
+enum ExpressionCategory {ec_reg = 0, ec_mem = 1, ec_val = 2};
+
+static const size_t numberOfInstructionKinds = x86_last_instruction;
+inline size_t getInstructionKind(SgAsmx86Instruction* insn) {return insn->get_kind();}
+
+
+
+inline ExpressionCategory getCategory(SgAsmExpression* e) {
+  if (isSgAsmValueExpression(e)) {
+    return ec_val;
+  } else if (isSgAsmRegisterReferenceExpression(e)) {
+    return ec_reg;
+  } else if (isSgAsmMemoryReferenceExpression(e)) {
+    return ec_mem;
+  } else {
+    abort();
+  }
+}
+
+SgAsmExpressionPtrList& getOperands(SgAsmInstruction* insn) {
+  SgAsmOperandList* ol = insn->get_operandList();
+  SgAsmExpressionPtrList& operands = ol->get_operands();
+  return operands;
+}
+static map<string, void*> internTable;
+
+inline void* intern(const std::string& s) {
+  map<string, void*>::const_iterator i = internTable.find(s);
+  if (i == internTable.end()) {
+    void* sCopy = new string(s);
+    internTable.insert(std::make_pair(s, sCopy));
+    return sCopy;
+  } else {
+    return i->second;
+  }
+}
+static map<SgAsmExpression*, void*> unparseAndInternTable;
+
+inline void* unparseAndIntern(SgAsmExpression* e) {
+  map<SgAsmExpression*, void*>::const_iterator i = unparseAndInternTable.find(e);
+  if (i == unparseAndInternTable.end()) {
+    void* sPtr = intern(unparseX86Expression(e));
+    unparseAndInternTable.insert(std::make_pair(e, sPtr));
+    return sPtr;
+  } else {
+    return i->second;
+  }
+}
+ 
+void numberOperands(std::vector<SgAsmx86Instruction*>::iterator beg,
+        std::vector<SgAsmx86Instruction*>::iterator end, map<SgAsmExpression*, size_t> numbers[3]) {
+  map<void*, size_t> stringNumbers[3];
+  for (; beg != end; ++beg) {
+    SgAsmx86Instruction* insn = *beg;
+    const SgAsmExpressionPtrList& operands = getOperands(insn);
+    //size_t operandCount = operands.size();
+    for (size_t j = 0; j < operands.size(); ++j) {
+      SgAsmExpression* e = operands[j];
+      ExpressionCategory cat = getCategory(e);
+      void* str = unparseAndIntern(e);
+      map<void*, size_t>& currentStringNums = stringNumbers[(int)cat];
+      map<void*, size_t>::const_iterator stringNumIter = currentStringNums.find(str);
+      size_t num = (stringNumIter == currentStringNums.end() ? currentStringNums.size() : stringNumIter->second);
+      if (stringNumIter == currentStringNums.end()) currentStringNums.insert(std::make_pair(str, num));
+      numbers[(int)cat][e] = num;
+    }
+  }
+}
+std::string normalizeInstructionsToHTML(std::vector<SgAsmx86Instruction*>::iterator beg, 
+    std::vector<SgAsmx86Instruction*>::iterator end)
+{
+    string normalizedUnparsedInstructions;
+    map<SgAsmExpression*, size_t> valueNumbers[3];
+    numberOperands( beg,end, valueNumbers);
+
+    // Unparse the normalized forms of the instructions
+    for (; beg != end; ++beg ) {
+      SgAsmx86Instruction* insn = *beg;
+      string mne = insn->get_mnemonic();
+      boost::to_lower(mne);
+      mne = "<font color=\"red\">" + htmlEscape(mne)+"</font>";
+
+      normalizedUnparsedInstructions += mne;
+      const SgAsmExpressionPtrList& operands = getOperands(insn);
+      // Add to total for this variant
+      // Add to total for each kind of operand
+      size_t operandCount = operands.size();
+
+      normalizedUnparsedInstructions += "<font color=\"blue\">";
+      for (size_t i = 0; i < operandCount; ++i) {
+        SgAsmExpression* operand = operands[i];
+        ExpressionCategory cat = getCategory(operand);
+        map<SgAsmExpression*, size_t>::const_iterator numIter = valueNumbers[(int)cat].find(operand);
+        assert (numIter != valueNumbers[(int)cat].end());
+        size_t num = numIter->second;
+
+        normalizedUnparsedInstructions += (cat == ec_reg ? " R" : cat == ec_mem ? " M" : " V") + boost::lexical_cast<string>(num);
+      }
+      normalizedUnparsedInstructions += "; </font> <br> ";
+  
+    }
+   
+    return normalizedUnparsedInstructions;
+};
+void normalizeInstructionInSubTree(SgNode* topNode ){
+  vector<SgAsmx86Instruction*> insns;
+  FindInstructionsVisitor vis;
+  AstQueryNamespace::querySubTree(topNode, std::bind2nd( vis, &insns ));
+
+  for(std::vector<SgAsmx86Instruction*>::iterator iItr = insns.begin(); iItr !=  insns.end();
+      ++iItr)
+  {
+      SgAsmx86Instruction* insn = *iItr;
+       SgAsmExpressionPtrList& operands = getOperands(insn);
+      // Add to total for this variant
+      // Add to total for each kind of operand
+      size_t operandCount = operands.size();
+
+      for (size_t i = 0; i < operandCount; ++i) {
+        SgAsmExpression* operand = operands[i];
+        SgAsmExpression* newOperand;
+        if( isSgAsmMemoryReferenceExpression(operand) )
+        {
+          SgAsmMemoryReferenceExpression* memRefExp = new SgAsmMemoryReferenceExpression;
+          SgAsmWordValueExpression* wordVal = new SgAsmWordValueExpression;
+          wordVal->set_value(0);
+
+          memRefExp->set_segment(wordVal);
+          memRefExp->set_address(wordVal);
+          memRefExp->set_type(new SgAsmTypeWord);
+          newOperand = memRefExp;
+        }else if(isSgAsmRegisterReferenceExpression(operand) ){
+          SgAsmx86RegisterReferenceExpression* regRef = new SgAsmx86RegisterReferenceExpression;
+          regRef->set_register_class(x86_regclass_mm);
+          regRef->set_register_number(0);
+
+          newOperand = regRef;
+
+        }else{
+          SgAsmWordValueExpression* wordVal = new SgAsmWordValueExpression;
+          wordVal->set_value(0);
+          newOperand = wordVal;
+          
+        }
+
+        newOperand->set_parent(operand->get_parent());
+
+        DeleteSgTree(operands[i]);
+        operands[i]=newOperand;
+      }
+        //std::cout << "Unparsed: " <<unparseX86Instruction(insn)<< std::endl;
+
+  }
+
+
+
+
+
+
+
+};
+
+
+
+
+
+int main(int argc, char** argv)
+{
+
+//  SgNode* disFile = disassembleFile(argv[1]);
+  SgProject* disFile = frontend(argc,argv);
+
+
+  VariantVector vv1(V_SgAsmPEDLL);
+  vv1.push_back(V_SgAsmPEDLL); 
+  std::vector<SgNode*> peDLL = NodeQuery::querySubTree(disFile,vv1);
+
+  std::cout << "size: " << peDLL.size();
+    std::cout << "BEGIN - PEDLL" <<std::endl;
+
+  for(int i=0; i < peDLL.size() ; i++)
+  {
+    SgAddressList addrList = isSgAsmPEDLL(peDLL[i])->get_hintname_rvas();
+    for(int j = 0; i < addrList.size() ; j++ )
+    {
+    std::cout << addrList[j] << " ";
+
+    }
+      
+
+  };
+ 
+  std::cout << "END - PEDLL" <<std::endl;
+ 
+  {
+//  normalizeInstructionInSubTree(disFile);
+  
+  FindInstructionsVisitor vis;
+
+  //  backend((SgProject*)disFile);
+  vector<SgNode*> insnsA;
+
+  
+
+  AstQueryNamespace::querySubTree(disFile, std::bind2nd( vis, &insnsA ));
+
+  if(insnsA.size() == 0)
+  {
+    std::cerr << "error: there are no instrucitons" << std::endl;
+    return 0;
+  }
+
+
+  {
+    ofstream myfile;
+    std::string outputFile = string(argv[1])+".roseTxt";
+    myfile.open (outputFile.c_str());
+
+    std::vector<SgAsmx86Instruction*> instructions;
+    for(int i = 0; i < insnsA.size(); i++ )
+      if(isSgAsmx86Instruction(insnsA[i]))
+      {
+        if(isSgAsmx86Instruction(insnsA[i])->get_kind() != x86_call ) 
+          normalizeInstructionInSubTree(insnsA[i]);
+        myfile <<   unparseInstruction((SgAsmInstruction*)insnsA[i]) << "\n";
+      }
+    myfile.close();
+  }
+
+  {
+    ofstream myfile;
+    std::string outputFile = string(argv[1])+".roseTxtNoEndl";
+    myfile.open (outputFile.c_str());
+
+    std::vector<SgAsmx86Instruction*> instructions;
+    for(int i = 0; i < insnsA.size(); i++ )
+      if(isSgAsmx86Instruction(insnsA[i]))
+      {
+  //      normalizeInstructionInSubTree(insnsA[i]);
+    
+        myfile <<   unparseInstruction((SgAsmInstruction*)insnsA[i]) ;
+      }
+
+    myfile.close();
+
+  }
+
+ //     instructions.push_back(isSgAsmx86Instruction(insnsA[i]));
+
+
+//  myfile << normalizeInstructionsToHTML(instructions.begin(), instructions.end());
+
+
+  exit(0);
+
+  }
+};

Modified: branches/rice/projects/AstEquivalence/evaluateAllBinaries.C
===================================================================
--- branches/rice/projects/AstEquivalence/evaluateAllBinaries.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/AstEquivalence/evaluateAllBinaries.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -18,14 +18,6 @@
 using namespace boost::filesystem;
 using namespace boost::program_options;
 
-class FindAsmFunctionsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmFunctionDeclaration *>* , void* >
-{
-  public:
-    void* operator()(first_argument_type node, std::vector<SgAsmFunctionDeclaration*>* insns ) const{
-      if (isSgAsmFunctionDeclaration(node)) insns->push_back(isSgAsmFunctionDeclaration(node));
-      return NULL;
-    }
-};
 
 template <typename T>
 class vector_start_at_zero {

Modified: branches/rice/projects/AstEquivalence/gui/compilerFlagsGui.C
===================================================================
--- branches/rice/projects/AstEquivalence/gui/compilerFlagsGui.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/AstEquivalence/gui/compilerFlagsGui.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -371,7 +371,7 @@
       {
         selectSeparateDatasets += " join function_statistics stat1 on stat1.function_id=function_id_A join function_statistics stat2 on stat2.function_id=function_id_B ";
 
-        selectSeparateDatasets += " where ( (stat1.num_instructions - " +boost::lexical_cast<string>(windowSize)+ ")/" +boost::lexical_cast<string>(stride)+") =( end_index_within_function_A-begin_index_within_function_A  )";
+        selectSeparateDatasets += " AND ( (stat1.num_instructions - " +boost::lexical_cast<string>(windowSize)+ ")/" +boost::lexical_cast<string>(stride)+") =( end_index_within_function_A-begin_index_within_function_A  )";
         selectSeparateDatasets += " AND   ( (stat2.num_instructions - " +boost::lexical_cast<string>(windowSize)+ ")/" +boost::lexical_cast<string>(stride)+") =( end_index_within_function_B-begin_index_within_function_B  )"  ;
 
       }
@@ -380,10 +380,10 @@
       {
        
 
-        if(wholeFunction->currentIndex() == 1) 
+//        if(wholeFunction->currentIndex() == 1) 
           selectSeparateDatasets += " AND ";
-        else
-          selectSeparateDatasets+=" where ";
+  //      else
+    //      selectSeparateDatasets+=" where ";
 
 
         
@@ -446,117 +446,118 @@
 BinaryCloneGui::run( ) 
 {
 
-    
-    //Fill in table
-    // unlink activation callback, which otherwise would trigger each
-    // time we add a row in the table.
-    QROSE::unlink(tableWidget, SIGNAL(activated(int, int, int, int)));
 
-    while(tableWidget->rowCount()) tableWidget->removeRow(0);
+  //Fill in table
+  // unlink activation callback, which otherwise would trigger each
+  // time we add a row in the table.
+  QROSE::unlink(tableWidget, SIGNAL(activated(int, int, int, int)));
 
-    //Read in all largest clones
-    readIntoVector(conA, vectorOfClonesA);
-    std::cout << "Opening database B" << std::endl;
-    readIntoVector(conB, vectorOfClonesB);
-    std::cout << "Opening database B" << std::endl;
+  while(tableWidget->rowCount()) tableWidget->removeRow(0);
 
-    //vectorOfClones.allocate(  vectorOfClonesA.size() > vectorOfClonesB.size() ? vectorOfClonesA.size()  : vectorOfClonesB.size()  );
+  //Read in all largest clones
+  readIntoVector(conA, vectorOfClonesA);
+  std::cout << "Opening database B" << std::endl;
+  readIntoVector(conB, vectorOfClonesB);
+  std::cout << "Opening database B" << std::endl;
 
+  //vectorOfClones.allocate(  vectorOfClonesA.size() > vectorOfClonesB.size() ? vectorOfClonesA.size()  : vectorOfClonesB.size()  );
 
-    std::cout << "WALLIE" << std::endl;
-    //FIXME: Some functions in B may not be in A
-    for(unsigned int i = 0 ; i < vectorOfClonesA.size() ; i++ )
+
+  std::cout << "WALLIE" << std::endl;
+  //FIXME: Some functions in B may not be in A
+  for(unsigned int i = 0 ; i < vectorOfClonesA.size() ; i++ )
+  {
+    int j=0;
+    for(j = 0 ; j != (int)vectorOfClonesB.size() ; j++ )
     {
-      int j=0;
-      for(j = 0 ; j != (int)vectorOfClonesB.size() ; j++ )
+      if( vectorOfClonesA[i].file_A == vectorOfClonesB[j].file_A && 
+          vectorOfClonesA[i].function_name_A == vectorOfClonesB[j].function_name_A &&
+          vectorOfClonesA[i].file_B == vectorOfClonesB[j].file_B && 
+          vectorOfClonesA[i].function_name_B == vectorOfClonesB[j].function_name_B 
+        )
       {
-        if( vectorOfClonesA[i].file_A == vectorOfClonesB[j].file_A && 
-            vectorOfClonesA[i].function_name_A == vectorOfClonesB[j].function_name_A &&
-            vectorOfClonesA[i].file_B == vectorOfClonesB[j].file_B && 
-            vectorOfClonesA[i].function_name_B == vectorOfClonesB[j].function_name_B 
-            )
-        {
 
-          mapAtoB[i] = j;
-          break;
-        }
+        mapAtoB[i] = j;
+        break;
       }
-      if(j == (int)vectorOfClonesB.size())
-        mapAtoB[i]=-1;
-
     }
+    if(j == (int)vectorOfClonesB.size())
+      mapAtoB[i]=-1;
 
-    //FIXME: Some functions in B may not be in A
-    for(unsigned int i = 0 ; i < vectorOfClonesB.size() ; i++ )
+  }
+
+  //FIXME: Some functions in B may not be in A
+  for(unsigned int j = 0 ; j < vectorOfClonesB.size() ; j++ )
+  {
+    int i=0;
+    for(i = 0 ; i != (int)vectorOfClonesA.size() ; i++ )
     {
-      int j=0;
-      for(j = 0 ; j != (int)vectorOfClonesA.size() ; j++ )
+      if( vectorOfClonesA[i].file_A == vectorOfClonesB[j].file_A && 
+          vectorOfClonesA[i].function_name_A == vectorOfClonesB[j].function_name_A &&
+          vectorOfClonesA[i].file_B == vectorOfClonesB[j].file_B && 
+          vectorOfClonesA[i].function_name_B == vectorOfClonesB[j].function_name_B 
+        )
       {
-        if( vectorOfClonesA[i].file_A == vectorOfClonesB[j].file_A && 
-            vectorOfClonesA[i].function_name_A == vectorOfClonesB[j].function_name_A &&
-            vectorOfClonesA[i].file_B == vectorOfClonesB[j].file_B && 
-            vectorOfClonesA[i].function_name_B == vectorOfClonesB[j].function_name_B 
-            )
-        {
 
-          mapBtoA[i] = j;
-          break;
-        }
+        mapBtoA[i] = j;
+        break;
       }
-      if(j == (int)vectorOfClonesB.size())
-        mapBtoA[i]=-1;
-
     }
+    if(i == (int)vectorOfClonesA.size())
+      mapBtoA[j]=-1;
 
-    std::cout << "WALLIE" << std::endl;
+  }
 
-    int row =0;
+  std::cout << "WALLIE" << std::endl;
 
-    if(displayResults->currentIndex() == 0)
+  int row =0;
+
+  if(displayResults->currentIndex() == 0)
+  {
+    for(int i = 0 ; i < (int) vectorOfClonesA.size() ; i++ )
     {
-      for(int i = 0 ; i < (int) vectorOfClonesA.size() ; i++ )
+      if(mapAtoB[i] != -1 )
       {
-        if(mapAtoB[i] != -1 )
-        {
         Element cur_elem  = vectorOfClonesA[i];
         insert_into_table_row(row, cur_elem);
         mapRowtoDB[row]=i;
-        }
+        row++;
       }
-    }else if( displayResults->currentIndex() == 1 )
-    {
+    }
+  }else if( displayResults->currentIndex() == 1 )
+  {
 
     int row =0;
 
     for( std::map<int,int>::iterator mapAitr = mapAtoB.begin(); mapAitr != mapAtoB.end(); ++ mapAitr )
     {
       if(mapAitr->second == -1)
-        {
-          Element cur_elem  = vectorOfClonesA[mapAitr->first];
-          insert_into_table_row(row, cur_elem);
-          mapRowtoDB[row] = mapAitr->first;
-          row++;
+      {
+        Element cur_elem  = vectorOfClonesA[mapAitr->first];
+        insert_into_table_row(row, cur_elem);
+        mapRowtoDB[row] = mapAitr->first;
+        row++;
 
-        }
+      }
     }
 
-    }else if( displayResults->currentIndex() == 2 )
-    {
+  }else if( displayResults->currentIndex() == 2 )
+  {
 
     int row =0;
 
     for( std::map<int,int>::iterator mapBitr = mapBtoA.begin(); mapBitr != mapBtoA.end(); ++ mapBitr )
     {
       if(mapBitr->second == -1)
-        {
-          Element cur_elem  = vectorOfClonesB[mapBitr->first];
-          insert_into_table_row(row, cur_elem);
-          mapRowtoDB[row] = mapBitr->first;
-          row++;
-        }
+      {
+        Element cur_elem  = vectorOfClonesB[mapBitr->first];
+        insert_into_table_row(row, cur_elem);
+        mapRowtoDB[row] = mapBitr->first;
+        row++;
+      }
     }
 
-    }
+  }
 
     QROSE::link(tableWidget, SIGNAL(activated(int, int, int, int)), 
         &tableCellActivated, this);
@@ -567,11 +568,25 @@
 BinaryCloneGui::insert_into_table_row(int row, Element& cur_elem )
 {
 
-  int rowInB = mapAtoB.find(row)->second;
+  int rowInB = -1;
+  Element cur_elemB; 
+  
+  if(displayResults->currentIndex() == 0)
+  {
 
+    rowInB = mapAtoB.find(row)->second;
   ROSE_ASSERT(rowInB >= 0);
-  Element cur_elemB  =  rowInB >= 0 ? vectorOfClonesA[row] : Element();
+  Element cur_elemB  = vectorOfClonesB[rowInB] ;
 
+  }else if( displayResults->currentIndex() == 1 )
+  {
+  }else if( displayResults->currentIndex() == 2 )
+  {
+
+  }
+
+
+
   tableWidget->addRows(1);
   int diffA =  (cur_elem.end_index_within_function_A-cur_elem.begin_index_within_function_A+1)*windowSize;
   int diffB = (cur_elem.end_index_within_function_B-cur_elem.begin_index_within_function_B+1)*windowSize;
@@ -593,7 +608,7 @@
 
   tableWidget->setHAlignment(true, false, 0); // left horizontal alignment
 
-  mapRowtoDB[row] = row;
+//  mapRowtoDB[row] = row;
 
 };
 
@@ -694,24 +709,6 @@
   return std::pair<std::string,std::string>(line,offset);
 }  ;
 
-#if 0
-class FindInstructionsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmx86Instruction *>* , void* >
-{
-  public:
-    void* operator()(first_argument_type node, std::vector<SgAsmx86Instruction*>* insns ) const{
-      if (isSgAsmx86Instruction(node)) insns->push_back(isSgAsmx86Instruction(node));
-      return NULL;
-    }
-};
-#endif
-class FindAsmFunctionsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmFunctionDeclaration *>* , void* >
-{
-  public:
-    void* operator()(first_argument_type node, std::vector<SgAsmFunctionDeclaration*>* insns ) const{
-      if (isSgAsmFunctionDeclaration(node)) insns->push_back(isSgAsmFunctionDeclaration(node));
-      return NULL;
-    }
-};
 
 
 enum ExpressionCategory {ec_reg = 0, ec_mem = 1, ec_val = 2};

Modified: branches/rice/projects/AstEquivalence/runIDA.C
===================================================================
--- branches/rice/projects/AstEquivalence/runIDA.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/AstEquivalence/runIDA.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -206,17 +206,14 @@
 	   exit(1);
 	 }
 
-    path dir_path(argv[1]);
-
-    rename_windows_directories(dir_path);
-
-    exit(0);
     std::list<string> tsvDirectories; 
 
-  //  find_tsv_directories(dir_path, tsvDirectories);
 
-    tsvDirectories.push_back(argv[1]);
+    path dir_path(argv[1]); 
+    
+    find_tsv_directories(dir_path, tsvDirectories);
 
+
     std::cout << "We have " << tsvDirectories.size() << " files " << std::endl;
 
 

Copied: branches/rice/projects/BinQ/AlignFunctions.C (from rev 117, trunk/projects/BinQ/AlignFunctions.C)
===================================================================
--- branches/rice/projects/BinQ/AlignFunctions.C	                        (rev 0)
+++ branches/rice/projects/BinQ/AlignFunctions.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,153 @@
+#include "BinQGui.h"
+
+#include "boost/filesystem/operations.hpp" 
+#include <boost/lexical_cast.hpp>
+#include <iostream>
+
+
+#include "BinQSupport.h"
+#include "slide.h"
+
+#include <qtabwidget.h>
+#include "Clone.h"
+
+using namespace qrs;
+using namespace boost::filesystem;
+using namespace std;
+using namespace boost;
+using namespace __gnu_cxx;
+
+
+
+bool 
+findPosWhenFunctionsAreNotSync(int& position, int& offset, int& currentPos) {
+  BinQGUI *instance = QROSE::cbData<BinQGUI *>();
+  unsigned int max = instance->itemsFileA.size();
+  if (instance->itemsFileB.size()>max) 
+    max=instance->itemsFileB.size();
+  for (unsigned int i=0;i<max;++i) {
+    Item* itemA =NULL;
+    Item* itemB =NULL;
+    if (i<instance->itemsFileA.size())
+      itemA=instance->itemsFileA[i];
+    if (i<instance->itemsFileB.size())
+      itemB=instance->itemsFileB[i];
+    if (itemA && itemB) {
+      SgAsmFunctionDeclaration* fa = isSgAsmFunctionDeclaration(itemA->statement);
+      SgAsmFunctionDeclaration* fb = isSgAsmFunctionDeclaration(itemB->statement);
+      if (fa && !fb) {
+	// fa occured but fb is further away, need padding for fa
+	for (unsigned int k=i;k<instance->itemsFileB.size();++k) {
+	    itemB=instance->itemsFileB[k];
+	    fb = isSgAsmFunctionDeclaration(itemB->statement);
+	    if (fb) {
+	      // We need a padding in B at pos i with length (k-i)
+	      position=i-1;
+	      offset=k-i;
+	      currentPos = itemB->pos;
+	      return true; //left (A)
+	    }
+	}
+      } else if (fb && !fa) {
+	// fa occured but fb is further away, need padding for fa
+	for (unsigned int k=i;k<instance->itemsFileA.size();++k) {
+	    itemA=instance->itemsFileA[k];
+	    fa = isSgAsmFunctionDeclaration(itemA->statement);
+	    if (fa) {
+	      // We need a padding in A at pos i with length (k-i)
+	      position=i-1;
+	      offset=k-i;
+	      currentPos = itemA->pos;
+	      return false; //right (B)
+	    }
+	}
+      }
+
+    }
+  }
+  return true; // should not be reached
+}
+
+
+void
+alignFunctions() {
+  BinQGUI *instance = QROSE::cbData<BinQGUI *>();
+
+#if 1
+  // ------------------------------ Sync statments between itemsFileA amd itemsFileB
+  // add padding 
+  int position=-1, offset=0, currentPos=0;
+  bool fileAPadd = findPosWhenFunctionsAreNotSync(position, offset,currentPos);
+  cerr << " 1 Found PosWhenFunctionsAre not sync : " << position << "   offset : " << offset << 
+    " A? " << fileAPadd << "  currentPos : " << currentPos << endl;
+  //int count=0;
+  while (position!=-1) {
+    // lets add padding
+    if (fileAPadd) {
+      Item* oldItem = *(instance->itemsFileA.begin()+position);
+      int oldPos = oldItem->pos+oldItem->length;
+      //cerr << "    A: old item at : " << (position) << "  oldPos : " << oldPos << endl;
+      vector<Item*>::iterator it = instance->itemsFileA.begin()+position+1;
+      int length=currentPos-oldPos;
+      for (int i=0; i<offset;++i) {
+	Item* item =NULL;
+	if (i==0)
+	  item = new Item(false,NULL,0,4,(position+i+1),length,(oldPos),"",0);
+	else
+	  item = new Item(false,NULL,0,4,(position+i+1),0,(oldPos)+length,"",0);
+	it = instance->itemsFileA.insert(it,item);
+	++it;
+	//	cerr << "    A: adding NULL item at : " << (position+i+1) << "  pos : " << (oldPos+i) <<endl;
+      }
+      // need to adjust the remainder
+      int c=1;
+      for (; it!=instance->itemsFileA.end();++it) {
+	Item* item = (*it);
+	//cerr << "    changing row at : " << (item->row) << "  to : " << (position+offset+c) <<endl;
+	item->row = position+offset+c;
+	item->pos = item->pos+length;
+	c++;
+      }
+    }
+
+    if (!fileAPadd) {
+      Item* oldItem = *(instance->itemsFileB.begin()+position);
+      int oldPos = oldItem->pos+oldItem->length;
+      //cerr << "    B: old item at : " << (position) << "  oldPos : " << oldPos << endl;
+      vector<Item*>::iterator it = instance->itemsFileB.begin()+position+1;
+      int length=currentPos-oldPos;
+      for (int i=0; i<offset;++i) {
+	Item* item =NULL;
+	if (i==0)
+	  item = new Item(false,NULL,0,4,(position+i+1),length,(oldPos),"",0);
+	else
+	  item = new Item(false,NULL,0,4,(position+i+1),0,(oldPos)+length,"",0);
+	it = instance->itemsFileB.insert(it,item);
+	++it;
+	//cerr << "    B: adding NULL item at : " << (position+i+1) << "  pos : " << oldPos+i<<endl;
+      }
+      // need to adjust the remainder
+      int c=1;
+      for (; it!=instance->itemsFileB.end();++it) {
+	Item* item = (*it);
+	//cerr << "    changing row at : " << (item->row) << "  to : " << (position+offset+c) <<endl;
+	item->row = position+offset+c;
+	item->pos = item->pos+length;
+	c++;
+      }
+    }
+    position=-1;
+    offset=0;
+    currentPos=0;
+    fileAPadd = findPosWhenFunctionsAreNotSync(position, offset,currentPos);
+    cerr << " 2 Found PosWhenFunctionsAre not sync : " << position << "   offset : " << offset << 
+      " A? " << fileAPadd << "  currentPos : " << currentPos << endl;
+    //    count++;
+    //if (count==5) break;
+  }
+
+  instance->updateByteItemList();
+#endif
+
+}
+

Copied: branches/rice/projects/BinQ/AlignFunctionsSmart.C (from rev 117, trunk/projects/BinQ/AlignFunctionsSmart.C)
===================================================================
--- branches/rice/projects/BinQ/AlignFunctionsSmart.C	                        (rev 0)
+++ branches/rice/projects/BinQ/AlignFunctionsSmart.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,153 @@
+#include "BinQGui.h"
+
+#include "boost/filesystem/operations.hpp" 
+#include <boost/lexical_cast.hpp>
+#include <iostream>
+
+
+#include "BinQSupport.h"
+#include "slide.h"
+
+#include <qtabwidget.h>
+#include "Clone.h"
+
+using namespace qrs;
+using namespace boost::filesystem;
+using namespace std;
+using namespace boost;
+using namespace __gnu_cxx;
+
+
+
+bool 
+findPosWhenFunctionsAreNotSyncSmart(int& position, int& offset, int& currentPos) {
+  BinQGUI *instance = QROSE::cbData<BinQGUI *>();
+  unsigned int max = instance->itemsFileA.size();
+  if (instance->itemsFileB.size()>max) 
+    max=instance->itemsFileB.size();
+  for (unsigned int i=0;i<max;++i) {
+    Item* itemA =NULL;
+    Item* itemB =NULL;
+    if (i<instance->itemsFileA.size())
+      itemA=instance->itemsFileA[i];
+    if (i<instance->itemsFileB.size())
+      itemB=instance->itemsFileB[i];
+    if (itemA && itemB) {
+      SgAsmFunctionDeclaration* fa = isSgAsmFunctionDeclaration(itemA->statement);
+      SgAsmFunctionDeclaration* fb = isSgAsmFunctionDeclaration(itemB->statement);
+      if (fa && !fb) {
+	// fa occured but fb is further away, need padding for fa
+	for (unsigned int k=i;k<instance->itemsFileB.size();++k) {
+	    itemB=instance->itemsFileB[k];
+	    fb = isSgAsmFunctionDeclaration(itemB->statement);
+	    if (fb) {
+	      // We need a padding in B at pos i with length (k-i)
+	      position=i-1;
+	      offset=k-i;
+	      currentPos = itemB->pos;
+	      return true; //left (A)
+	    }
+	}
+      } else if (fb && !fa) {
+	// fa occured but fb is further away, need padding for fa
+	for (unsigned int k=i;k<instance->itemsFileA.size();++k) {
+	    itemA=instance->itemsFileA[k];
+	    fa = isSgAsmFunctionDeclaration(itemA->statement);
+	    if (fa) {
+	      // We need a padding in A at pos i with length (k-i)
+	      position=i-1;
+	      offset=k-i;
+	      currentPos = itemA->pos;
+	      return false; //right (B)
+	    }
+	}
+      }
+
+    }
+  }
+  return true; // should not be reached
+}
+
+
+void
+alignFunctionsSmart() {
+  BinQGUI *instance = QROSE::cbData<BinQGUI *>();
+
+#if 1
+  // ------------------------------ Sync statments between itemsFileA amd itemsFileB
+  // add padding 
+  int position=-1, offset=0, currentPos=0;
+  bool fileAPadd = findPosWhenFunctionsAreNotSyncSmart(position, offset,currentPos);
+  cerr << " 1 Found PosWhenFunctionsAre not sync : " << position << "   offset : " << offset << 
+    " A? " << fileAPadd << "  currentPos : " << currentPos << endl;
+  //int count=0;
+  while (position!=-1) {
+    // lets add padding
+    if (fileAPadd) {
+      Item* oldItem = *(instance->itemsFileA.begin()+position);
+      int oldPos = oldItem->pos+oldItem->length;
+      //cerr << "    A: old item at : " << (position) << "  oldPos : " << oldPos << endl;
+      vector<Item*>::iterator it = instance->itemsFileA.begin()+position+1;
+      int length=currentPos-oldPos;
+      for (int i=0; i<offset;++i) {
+	Item* item =NULL;
+	if (i==0)
+	  item = new Item(false,NULL,0,4,(position+i+1),length,(oldPos),"",0);
+	else
+	  item = new Item(false,NULL,0,4,(position+i+1),0,(oldPos)+length,"",0);
+	it = instance->itemsFileA.insert(it,item);
+	++it;
+	//	cerr << "    A: adding NULL item at : " << (position+i+1) << "  pos : " << (oldPos+i) <<endl;
+      }
+      // need to adjust the remainder
+      int c=1;
+      for (; it!=instance->itemsFileA.end();++it) {
+	Item* item = (*it);
+	//cerr << "    changing row at : " << (item->row) << "  to : " << (position+offset+c) <<endl;
+	item->row = position+offset+c;
+	item->pos = item->pos+length;
+	c++;
+      }
+    }
+
+    if (!fileAPadd) {
+      Item* oldItem = *(instance->itemsFileB.begin()+position);
+      int oldPos = oldItem->pos+oldItem->length;
+      //cerr << "    B: old item at : " << (position) << "  oldPos : " << oldPos << endl;
+      vector<Item*>::iterator it = instance->itemsFileB.begin()+position+1;
+      int length=currentPos-oldPos;
+      for (int i=0; i<offset;++i) {
+	Item* item =NULL;
+	if (i==0)
+	  item = new Item(false,NULL,0,4,(position+i+1),length,(oldPos),"",0);
+	else
+	  item = new Item(false,NULL,0,4,(position+i+1),0,(oldPos)+length,"",0);
+	it = instance->itemsFileB.insert(it,item);
+	++it;
+	//cerr << "    B: adding NULL item at : " << (position+i+1) << "  pos : " << oldPos+i<<endl;
+      }
+      // need to adjust the remainder
+      int c=1;
+      for (; it!=instance->itemsFileB.end();++it) {
+	Item* item = (*it);
+	//cerr << "    changing row at : " << (item->row) << "  to : " << (position+offset+c) <<endl;
+	item->row = position+offset+c;
+	item->pos = item->pos+length;
+	c++;
+      }
+    }
+    position=-1;
+    offset=0;
+    currentPos=0;
+    fileAPadd = findPosWhenFunctionsAreNotSyncSmart(position, offset,currentPos);
+    cerr << " 2 Found PosWhenFunctionsAre not sync : " << position << "   offset : " << offset << 
+      " A? " << fileAPadd << "  currentPos : " << currentPos << endl;
+    //    count++;
+    //if (count==5) break;
+  }
+
+  instance->updateByteItemList();
+#endif
+
+}
+

Modified: branches/rice/projects/BinQ/BinQGui.C
===================================================================
--- branches/rice/projects/BinQ/BinQGui.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/BinQ/BinQGui.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,22 +1,20 @@
-#include <boost/algorithm/string.hpp>
+// tps: the following line causes the frontend to misbehave!!!
+// that is totally weird!
+//#include <boost/algorithm/string.hpp>
 #include "BinQGui.h"
-#include <ext/hash_map>
 
-#include <sstream>
-#include <QFileDialog>
-#include <unistd.h>
-
-#include "boost/filesystem/operations.hpp" // includes boost/filesystem/path.hpp
+#include "boost/filesystem/operations.hpp" 
 #include <boost/lexical_cast.hpp>
 #include <iostream>
 
 #include "icons.h"
+#include "folder.xpm"
 
-//#include "disks.xpm"
-#include "folder.xpm"
 #include "BinQSupport.h"
+#include "slide.h"
 
-#define EMACS
+#include <qtabwidget.h>
+#include "Clone.h"
 
 using namespace qrs;
 using namespace boost::filesystem;
@@ -24,7 +22,38 @@
 using namespace boost;
 using namespace __gnu_cxx;
 
+
 // ----------------------------------------------------------------------------------------------
+// specify analyses here!
+void alignFunctions();
+void andreasDiff();
+void alignFunctionsSmart();
+
+void clicked1() {
+  BinQGUI *instance = QROSE::cbData<BinQGUI *>();
+  QListWidgetItem *item= instance->listWidget->currentItem(); 
+  QString te = item->text();
+  string t = te.toStdString();
+  //const char *t = (const char *)text;
+  cerr << " Selected : " << t << endl;
+
+  if (t=="Andreas's Diff") {
+    andreasDiff();
+  } // andreas diff
+  else if (t=="Align Functions") {
+    alignFunctions();
+  }
+  else if (t=="Align Functions Smart") {
+    alignFunctionsSmart();
+  }
+
+} 
+
+
+
+
+
+// ----------------------------------------------------------------------------------------------
 void toolbarClick(int action) {
   BinQGUI *instance = QROSE::cbData<BinQGUI *>();
   switch(action){
@@ -45,103 +74,517 @@
   }
 }
 
-static void tableWidgetCellActivated(int col, int row, int oldCol, int oldRow) {
+
+
+static void tableWidgetCellActivatedA(int col, int row, int oldCol, int oldRow) {
   BinQGUI *instance = QROSE::cbData<BinQGUI *>();
-  instance->unhighlightFunctionRow(oldRow);
-  instance->highlightFunctionRow(row);
+  instance->unhighlightFunctionRow(oldRow, true);
+  instance->highlightFunctionRow(row,true);
   return;
 } //tableCellActivated(int col, int row, int oldCol, int oldRow)
 
-static void codeTableWidgetCellActivated(int col, int row, int oldCol, int oldRow) {
+static void codeTableWidgetCellActivatedA(int col, int row, int oldCol, int oldRow) {
   BinQGUI *instance = QROSE::cbData<BinQGUI *>();
-  instance->unhighlightInstructionRow(oldRow);
-  instance->highlightInstructionRow(row);
+  instance->unhighlightInstructionRow(oldRow, true);
+  instance->highlightInstructionRow(row, true);
   return;
 } //tableCellActivated(int col, int row, int oldCol, int oldRow)
 
-static void viewBoxActivated(int selection) {
+static void tableWidgetCellActivatedB(int col, int row, int oldCol, int oldRow) {
   BinQGUI *instance = QROSE::cbData<BinQGUI *>();
-  instance->selectView(selection);
+  instance->unhighlightFunctionRow(oldRow, false);
+  instance->highlightFunctionRow(row,false);
   return;
-}
+} //tableCellActivated(int col, int row, int oldCol, int oldRow)
 
+static void codeTableWidgetCellActivatedB(int col, int row, int oldCol, int oldRow) {
+  BinQGUI *instance = QROSE::cbData<BinQGUI *>();
+  instance->unhighlightInstructionRow(oldRow, false);
+  instance->highlightInstructionRow(row, false);
+  return;
+} //tableCellActivated(int col, int row, int oldCol, int oldRow)
 
 
 
 
+// ----------------------------------------------------------------------------------------------
 
 
-// ----------------------------------------------------------------------------------------------
-
-void BinQGUI::highlightFunctionRow(int row) {
-  activeFunctionRow = -1;
+void BinQGUI::highlightFunctionRow(int row, bool fileA) {
   if(row >= 0)    {         
-    QFont f = tableWidget->getFont(0, row);
-    f.setBold(true);
-    tableWidget->setFont(f, 0, row);
-    activeFunctionRow = row;
-    showFileA(row);
-    //tableWidget->isItemSelected(tableWidget->horizontalHeaderItem(row));
+    if (fileA) {
+      QFont f = tableWidget->getFont(0, row);
+      f.setBold(true);
+      tableWidget->setFont(f, 0, row);
+      tableWidget->setBgColor(QColor(255,255,0),0,row);
+      //showFileA(row);
+      if (isSgAsmFunctionDeclaration(funcsFileA[row])) {
+	SgAsmFunctionDeclaration* func = isSgAsmFunctionDeclaration(funcsFileA[row]);
+	std::vector<Item*>::iterator it = itemsFileA.begin();
+	int offset=0;
+	for (;it!=itemsFileA.end();++it) {
+	  Item* item = *it;
+	  if (isSgAsmStatement(item->statement)) {
+	    SgAsmStatement* stat = isSgAsmStatement(item->statement);
+	    if (func==isSgAsmFunctionDeclaration(stat)) {
+	      offset=item->row;
+	      break;
+	    }
+	  } 
+	}
+      
+      //cerr << " highlight func row : " << row << "  inst row : " << offset << endl;
+      codeTableWidget->setCurrentCell(offset,0);
+      }
+    } else {
+      QFont f = tableWidget2->getFont(0, row);
+      f.setBold(true);
+      tableWidget2->setFont(f, 0, row);
+      tableWidget2->setBgColor(QColor(255,255,0),0,row);
+      //      showFileB(row);
+      if (isSgAsmFunctionDeclaration(funcsFileB[row])) {
+	SgAsmFunctionDeclaration* func = isSgAsmFunctionDeclaration(funcsFileB[row]);
+	std::vector<Item*>::iterator it = itemsFileB.begin();
+	int offset=0;
+	for (;it!=itemsFileB.end();++it) {
+	  Item* item = *it;
+	  SgAsmStatement* stat = isSgAsmStatement(item->statement);
+	  if (func==isSgAsmFunctionDeclaration(stat)) {
+	    offset=item->row;
+	    break;
+	  }
+	}
+      //      cerr << " highlight func row : " << row << "  inst row : " << offset << endl;
+      codeTableWidget2->setCurrentCell(offset,0);
+      } else if (isSgFunctionDeclaration(funcsFileB[row])) {
+	SgFunctionDeclaration* func = isSgFunctionDeclaration(funcsFileB[row]);
+	std::vector<Item*>::iterator it = itemsFileB.begin();
+	int offset=0;
+	for (;it!=itemsFileB.end();++it) {
+	  Item* item = *it;
+	  SgLocatedNode* stat = isSgLocatedNode(item->statement);
+	  if (func==isSgFunctionDeclaration(stat)) {
+	    offset=item->row;
+	    break;
+	  }
+	}
+	codeTableWidget2->setCurrentCell(offset,0);
+      }
+    }
   } //if(row >= 0)
 } //CompassGui::highlighFunctionRow(int row)
 
-void BinQGUI::unhighlightFunctionRow(int row) {
+void BinQGUI::unhighlightFunctionRow(int row, bool fileA) {
   if (row >= 0)     {
-    QFont f = tableWidget->getFont(0, row);
-    f.setBold(false);
-    tableWidget->setFont(f, 0, row);
+    if (fileA) {
+      QFont f = tableWidget->getFont(0, row);
+      f.setBold(false);
+      tableWidget->setFont(f, 0, row);
+      tableWidget->setBgColor(QColor(255,255,255),0,row);
+    } else {
+      QFont f = tableWidget2->getFont(0, row);
+      f.setBold(false);
+      tableWidget2->setFont(f, 0, row);
+      tableWidget2->setBgColor(QColor(255,255,255),0,row);
+    }
   } //if (row >= 0)
 } //CompassGui::unhighlighFunctionRow(int row)
 
 
-void BinQGUI::highlightInstructionRow(int row) {
-  activeInstructionRow = -1;
+
+
+void BinQGUI::highlightInstructionRow(int row, bool fileA) {
   if(row >= 0)    {         
-    QFont f = codeTableWidget->getFont(0, row);
-    f.setBold(true);
-    codeTableWidget->setFont(f, 0, row);
-    activeInstructionRow = row;
-    //tableWidget->isItemSelected(tableWidget->horizontalHeaderItem(row));
+    if (fileA) {
+      QFont f = codeTableWidget->getFont(0, row);
+      f.setBold(true);
+      codeTableWidget->setCurrentCell(row,0);
+      Item* item = itemsFileA[row];
+      for (int j=1;j<maxrows;j++) {
+	codeTableWidget->setFont(f, j, row);
+	if (item->function) 
+	  codeTableWidget->setBgColor(QColor(120,120,120),j,row);
+	else 
+	  codeTableWidget->setBgColor(QColor(255,255,0),j,row);
+      }
+    } else {
+      QFont f = codeTableWidget2->getFont(0, row);
+      f.setBold(true);
+      codeTableWidget2->setCurrentCell(row,0);
+      Item* item = itemsFileB[row];
+      if (item) {
+	for (int j=1;j<maxrows;j++) {
+	  codeTableWidget2->setFont(f, j, row);
+	  if (item->function) 
+	    codeTableWidget2->setBgColor(QColor(120,120,120),j,row);
+	  else
+	    codeTableWidget2->setBgColor(QColor(255,255,0),j,row);
+	}
+      }
+    }
   } //if(row >= 0)
-
 } //CompassGui::highlighFunctionRow(int row)
 
-void BinQGUI::unhighlightInstructionRow(int row) {
+void BinQGUI::unhighlightInstructionRow(int row,bool fileA) {
   if (row >= 0)     {
-    QFont f = codeTableWidget->getFont(0, row);
-    f.setBold(false);
-    codeTableWidget->setFont(f, 0, row);
+    if (fileA) {
+      QFont f = codeTableWidget->getFont(0, row);
+      f.setBold(false);
+      Item* item = itemsFileA[row];
+      for (int j=1;j<maxrows;j++) {      
+	codeTableWidget->setFont(f, j, row);
+	codeTableWidget->setBgColor(item->bg,j,row);
+      }
+    } else {
+      QFont f = codeTableWidget2->getFont(0, row);
+      f.setBold(false);
+      Item* item = itemsFileB[row];
+      if (item) {
+	for (int j=1;j<maxrows;j++) {      
+	  codeTableWidget2->setFont(f, j, row);
+	  codeTableWidget2->setBgColor(item->bg,j,row);
+	}
+      }
+    }
   } //if (row >= 0)
-
 } //CompassGui::unhighlighFunctionRow(int row)
 
 
 
 
 // ----------------------------------------------------------------------------------------------
+
+void BinQGUI::updateByteItemList() {
+  // update byteItemList
+  for (unsigned int i=0;i<itemsFileA.size();++i) {
+    Item* a = itemsFileA[i];
+    if (a) {
+      int pos = a->pos;
+      int length = a->length;
+      for (int k=0; k<length;++k)
+	byteItemFileA[pos+k]=a;
+    }
+  }
+  for (unsigned int i=0;i<itemsFileB.size();++i) {
+    Item* b = itemsFileB[i];
+    if (b) {
+      int pos = b->pos;
+      int length = b->length;
+      for (int k=0; k<length;++k)
+	byteItemFileB[pos+k]=b;
+    }
+  }
+  slide->colorize();
+  showFileA(0);
+  showFileB(0);
+  //  codeTableWidget->viewport()->update();
+  //codeTableWidget2->viewport()->update();
+
+}
+
+
+
 void
-BinQGUI::selectView(int selection) {
-  switch (selection) {
-  case 0:
-    //    codeWidget->setHtml(QString(normalizedView.first.c_str()));
-    codeWidget2->setHtml(QString(normalizedView.second.c_str()));
-    break;
-  case 1:
-    //codeWidget->setHtml(QString(allInsnsUnparsedView.first.c_str()));
-    codeWidget2->setHtml(QString(allInsnsUnparsedView.second.c_str()));
-    break;
+BinQGUI::insertFileInformation() {
+  ROSE_ASSERT(isSgProject(fileA));
+  SgBinaryFile* binaryFile = isSgBinaryFile(isSgProject(fileA)->get_fileList()[0]);
+  SgAsmFile* file = binaryFile != NULL ? binaryFile->get_binaryFile() : NULL;
+
+  SgAsmInterpretationPtrList& interps = file->get_interpretations();
+  SgAsmInterpretationPtrList::iterator it = interps.begin();
+  for (;it!=interps.end();++it) {
+    SgAsmInterpretation* mainInt = *it;
+    SgAsmGenericHeader* header = mainInt->get_header();
+    fileInfo->append(header->class_name().c_str());
+    SgAsmElfFileHeader* elf = isSgAsmElfFileHeader(header);
+    if (elf) {
+      fileInfo->append(file->get_name().c_str());
+      fileInfo->append(elf->format_name());
+      string num = RoseBin_support::ToString(elf->get_e_machine());
+      fileInfo->append( QString("Machine: %1")
+			.arg(num.c_str()) );
+      SgAsmElfSegmentTable *segments = elf->get_segment_table();
+      string seg = RoseBin_support::ToString(segments);
+      fileInfo->append( QString("ElfSegmentTable: %1")
+			.arg(seg.c_str()) );
+      SgAsmElfSectionTable *sections = elf->get_section_table();
+      string sec = RoseBin_support::ToString(sections);
+      fileInfo->append( QString("ElfSectionTable: %1")
+			.arg(sec.c_str()) );
+    }
   }
-};
+  SgAsmGenericFile *genericF = file->get_genericFile() ;
+  string size = RoseBin_support::ToString(genericF->get_orig_size());
+  fileInfo->append( QString("Orig Size of AsmGenericFile: %1")
+		    .arg(size.c_str()) );
 
+  SgAsmGenericHeaderPtrList headers = genericF->get_headers()->get_headers();
+  fileInfo->append(QString("HEADERS ------------- %1")
+		   .arg(RoseBin_support::ToString(headers.size()).c_str()));	 
+  for (unsigned int i=0;i<headers.size();++i) {
+    SgAsmGenericHeader* h = headers[i];
+    fileInfo->append(h->class_name().c_str());	 
+    fileInfo->append(h->format_name());	 
+  }
 
+  SgAsmGenericSectionPtrList sectionsList = genericF->get_sections();
+  fileInfo->append(QString("SECTIONS ------------- %1")
+		   .arg(RoseBin_support::ToString(sectionsList.size()).c_str()));	 
+  for (unsigned int i=0;i<sectionsList.size();++i) {
+    SgAsmGenericSection* h = sectionsList[i];
+    SgAsmElfSection* elfSec = isSgAsmElfSection(h);
+    if (elfSec) {
+      SgAsmElfSectionTableEntry* entry= elfSec->get_section_entry();
+      if (entry) {
+	rose_addr_t addr = entry->get_sh_addr();
+	rose_addr_t size = entry->get_sh_size();
+	rose_addr_t offset = entry->get_sh_offset();
+	string addrS = RoseBin_support::HexToString(addr);
+	string sizeS = RoseBin_support::HexToString(size);
+	string offsetS = RoseBin_support::HexToString(offset);
+	fileInfo->append( QString("%1           type:     %2 Addr: %3  Size: %4   Offset: %5")
+			  .arg(QString(h->get_name()->get_string().c_str()))
+			  .arg(h->class_name().c_str())
+			  .arg(addrS.c_str())
+			  .arg(sizeS.c_str())
+			  .arg(offsetS.c_str()));	 
+      }
+    } else {
+      fileInfo->append( QString("%1")
+			.arg(h->class_name().c_str()));
+    }
+  }
+  SgFileContentList fileList = genericF->get_data();
+  fileInfo->append(QString("DATA ---------------- %1 ")
+		   .arg(fileList.size()));	 
+#if 0
+  string data="";
+  for (unsigned int i=0;i<fileList.size();++i) {
+    data.append(RoseBin_support::ToString(fileList[i]));	
+  }
+  fileInfo->append( data.c_str());	 
+#endif
+  // doesnt work
+  SgFileContentList contentList = genericF->content();
+  fileInfo->append(QString("CONTENT ------------- %1 ")
+		   .arg(contentList.size()));	 
+#if 0
+  string content="";
+  for (unsigned int i=0;i<contentList.size();++i) {
+    data += RoseBin_support::ToString(contentList[i]);	
+  }
+  fileInfo->append( content.c_str());	 
+#endif
 
 
-BinQGUI::BinQGUI(std::string fA, std::string fB ) :  window(0), fileNameA(fA), fileNameB(fB) {
+}
+
+
+BinQGUI::BinQGUI(std::string fA, std::string fB ) :  window(0), 
+						     fileNameA(fA), fileNameB(fB) {
   window = new QRWindow( "mainWindow", QROSE::TopDown );
   binqsupport= new BinQSupport();
+  maxrows=5;
+  sourceFile=false;
+  init();
+  createGUI();
+}
 
-  fileA = binqsupport->disassembleFile(fileNameA);
-  fileB = binqsupport->disassembleFile(fileNameB);
+void BinQGUI::init(){
+  cerr << "Disassemble File A ... " << fileNameA << endl;
+  std::string sourceFileS;
+  fileA = binqsupport->disassembleFile(fileNameA, sourceFileS);
+  cerr << "\nDisassemble File B ... " << fileNameB << endl;
+  fileB = binqsupport->disassembleFile(fileNameB, sourceFileS);
+  ROSE_ASSERT(fileA);
+  ROSE_ASSERT(fileB);
+  if (sourceFileS=="true")
+    sourceFile=true;
+
+  // this part writes the file out to an assembly file -----------------------------------
+  SgBinaryFile* binaryFileA = isSgBinaryFile(isSgProject(fileA)->get_fileList()[0]);
+  SgAsmFile* file1 = binaryFileA != NULL ? binaryFileA->get_binaryFile() : NULL;
+  SgAsmInterpretation* interpA = SageInterface::getMainInterpretation(file1);
+
+  unparseAsmStatementToFile("unparsedA.s", interpA->get_global_block());
+
+  if(is_directory( fileNameB  ) == false && sourceFile==false) {
+    SgBinaryFile* binaryFileB = isSgBinaryFile(isSgProject(fileB)->get_fileList()[0]);
+    SgAsmFile* file2 = binaryFileB != NULL ? binaryFileB->get_binaryFile() : NULL;
+    SgAsmInterpretation* interpB = SageInterface::getMainInterpretation(file2);
+    unparseAsmStatementToFile("unparsedB.s", interpB->get_global_block());
+  }
+  // -------------------------------------------------------------------------------------
+
+  itemsFileA.clear();
+  itemsFileB.clear();
+  
+  // ---------------------- Create itemsFileA and itemsFileB , containing all statements
+  FindAsmFunctionsVisitor funcVis;
+  AstQueryNamespace::querySubTree(fileA, std::bind2nd( funcVis, &funcsFileA ));
+  if (sourceFile) {
+    FindSgFunctionsVisitor funcVisSource;
+    AstQueryNamespace::querySubTree(fileB, std::bind2nd( funcVisSource, &funcsFileB ));
+  } else
+    AstQueryNamespace::querySubTree(fileB, std::bind2nd( funcVis, &funcsFileB ));
+
+  cerr << " File A has " << funcsFileA.size() << " funcs." << endl;
+  cerr << " File B has " << funcsFileB.size() << " funcs." << endl;
+
+  FindAsmStatementsVisitor visStat;
+  std::vector<SgNode*> stmts;
+  AstQueryNamespace::querySubTree(fileA, std::bind2nd( visStat, &stmts ));
+  vector<SgNode*>::iterator it= stmts.begin();
+  int pos=0;
+  int row=0;
+  for (;it!=stmts.end();++it) {
+    Item* item;
+    int length=1;
+    // make sure file 1 is a binary file -- source file only for file 2 allowed
+    ROSE_ASSERT(isSgAsmStatement(*it));
+    if (isSgAsmFunctionDeclaration(*it)) {
+      FindAsmStatementsVisitor visStat2;
+      std::vector<SgAsmStatement*> stmts2;
+      AstQueryNamespace::querySubTree(fileA, std::bind2nd( visStat2, &stmts2 ));
+      int funcsize= stmts2.size();
+      item = new Item(true,isSgAsmFunctionDeclaration(*it),funcsize,2,row,length, pos,"",0);
+    } else if (isSgAsmBlock(*it)) {
+      continue;
+      //item = new Item(false,*it,0,1,row,0);
+    } else if (isSgAsmInstruction(*it)) {
+      length = isSgAsmInstruction(*it)->get_raw_bytes().size();
+      item = new Item(false,isSgAsmInstruction(*it),0,0,row,length,pos,"",0);
+    }
+    // color code pushes as an example
+    if (isSgAsmx86Instruction(*it)) {
+      length = isSgAsmInstruction(*it)->get_raw_bytes().size();
+      if (isSgAsmx86Instruction(*it)->get_kind() == x86_call) { 
+	SgAsmx86Instruction* inst = isSgAsmx86Instruction(*it);
+	SgAsmOperandList * ops = inst->get_operandList();
+	SgAsmExpressionPtrList& opsList = ops->get_operands();
+	std::string addrDest="";
+	SgAsmExpressionPtrList::iterator itOP = opsList.begin();
+	for (;itOP!=opsList.end();++itOP) {
+	  addrDest += unparseX86Expression(*itOP, false) ;
+	}
+	string s="<...>";
+	for (unsigned int j=0; j<funcsFileA.size();++j) {
+	  SgAsmFunctionDeclaration* f = isSgAsmFunctionDeclaration(funcsFileA[j]);
+	  string addrF= RoseBin_support::HexToString(f->get_address());
+	  addrF="0x"+addrF.substr(1,addrF.size());
+	  if (addrF==addrDest) {
+	    s="<"+f->get_name()+">";
+	    break;
+	  }
+	}
+	item = new Item(false,isSgAsmx86Instruction(*it),0,3,row,length,pos,s,0);
+      }
+    }
+    row++;
+    itemsFileA.push_back(item);
+    pos+=length;
+  }
+
+
+  stmts.clear();
+  if (!sourceFile) {
+    FindAsmStatementsVisitor visStat2;
+    AstQueryNamespace::querySubTree(fileB, std::bind2nd( visStat2, &stmts ));
+  } else {
+    FindNodeVisitor visStat2;
+    AstQueryNamespace::querySubTree(fileB, std::bind2nd( visStat2, &stmts ));
+  }
+  it= stmts.begin();
+  pos=0;
+  row=0;
+  for (;it!=stmts.end();++it) {
+    Item* item = NULL;
+    int length=1;
+    if (isSgAsmFunctionDeclaration(*it)){
+      int funcsize=0;
+      FindAsmStatementsVisitor visStat2;
+      std::vector<SgAsmStatement*> stmts2;
+      AstQueryNamespace::querySubTree(fileB, std::bind2nd( visStat2, &stmts2 ));
+      funcsize= stmts2.size();
+      item = new Item(true,isSgAsmFunctionDeclaration(*it),funcsize,2,row,length,pos,"",0);
+    }    else if (isSgAsmBlock(*it)) {
+      continue;
+      //item = new Item(false,*it,0,1,row,0);
+    } else if (isSgAsmInstruction(*it)) {
+      length = isSgAsmInstruction(*it)->get_raw_bytes().size();
+      item = new Item(false,isSgAsmInstruction(*it),0,0,row,length,pos,"",0);
+    } else if (isSgFunctionDeclaration(*it)) {
+      int funcsize=0;
+      FindNodeVisitor visStat2;
+      std::vector<SgLocatedNode*> stmts2;
+      AstQueryNamespace::querySubTree(fileB, std::bind2nd( visStat2, &stmts2 ));
+      funcsize= stmts2.size();
+      int color=4;
+      SgFunctionDefinition* def = isSgFunctionDefinition(isSgFunctionDeclaration(*it)->get_definition());
+      if (def)
+	color=2;
+      if (isSgFunctionDeclaration(*it)->get_file_info()->isCompilerGenerated())
+	color=3;
+      item = new Item(true,isSgFunctionDeclaration(*it),funcsize,color,row,length,pos,"",0);
+    } else if (isSgLocatedNode(*it)) {
+      Sg_File_Info* fi = isSgLocatedNode(*it)->get_file_info();
+      int line = -1;
+      if (fi) {
+	line = fi->get_line();
+	length = 1;
+      }
+      //      cerr << fi << " creating statement : " << isSgLocatedNode(*it)->class_name() << " ... comment " << line << endl;
+      item = new Item(false,isSgLocatedNode(*it),0,0,row,length,pos,
+		      isSgLocatedNode(*it)->class_name(),line);
+    } else {
+      //      cerr << "unknown node " << endl;//*it->class_name() << endl;
+      //      item = new Item(false,NULL,0,0,row,0,pos, " ",0);
+    }
+    //example -- color pushes red
+    if (isSgAsmx86Instruction(*it)) {
+      length = isSgAsmInstruction(*it)->get_raw_bytes().size();
+      if (isSgAsmx86Instruction(*it)->get_kind() == x86_call) {
+	SgAsmx86Instruction* inst = isSgAsmx86Instruction(*it);
+	SgAsmOperandList * ops = inst->get_operandList();
+	SgAsmExpressionPtrList& opsList = ops->get_operands();
+	std::string addrDest="";
+	SgAsmExpressionPtrList::iterator itOP = opsList.begin();
+	for (;itOP!=opsList.end();++itOP) {
+	  addrDest += unparseX86Expression(*itOP, false) ;
+	}
+	string s="<...>";
+	for (unsigned int j=0; j<funcsFileB.size();++j) {
+	  SgAsmFunctionDeclaration* f = isSgAsmFunctionDeclaration(funcsFileB[j]);
+	  string addrF= RoseBin_support::HexToString(f->get_address());
+	  addrF="0x"+addrF.substr(1,addrF.size());
+	  if (addrF==addrDest) {
+	    s="<"+f->get_name()+">";
+	    break;
+	  }
+	}
+	item = new Item(false,isSgAsmx86Instruction(*it),0,3,row,length,pos,s,0);
+
+      }
+    }
+    if (item) {
+      row++;
+      itemsFileB.push_back(item);
+      pos+=length;
+    }
+  }
+
+}
+
+  void BinQGUI::createGUI() {
+    QDesktopWidget *desktop = QApplication::desktop();
+
+
+  screenWidth = desktop->width()-50;
+  screenHeight = desktop->height()-150;
+  if (screenWidth>1424) screenWidth=1424;
+  if (screenHeight>1224) screenHeight=1224;
+
+
   {
     //--------------------------------------------------------------------------
     QRToolBar *toolbar = (*window)["toolbar"] << new QRToolBar(QROSE::LeftRight, true, true, true);
@@ -156,78 +599,102 @@
 
   QRPanel &mainPanel = *window << *( new QRPanel(QROSE::TopDown, QROSE::UseSplitter) );
   {
-    QRPanel &parameters = mainPanel << *new QRPanel(QROSE::LeftRight, QROSE::UseSplitter);
+    QRPanel &topPanels = mainPanel << *new QRPanel(QROSE::TopDown, QROSE::UseSplitter);
     {
-      QGroupBox *selectGroup =  parameters <<  new QGroupBox(("Data Selection Parameters"));
+      QGroupBox *selectGroup =  topPanels <<  new QGroupBox(("Binary File Analysis Information"));
       {
         QGridLayout *echoLayout =  new QGridLayout;
-        QLabel *echoLabel = new QLabel(">=:");
-	echoLayout->addWidget(echoLabel, 0, 0);
-        largerThanRestriction = new QLineEdit;
-        echoLayout->addWidget(largerThanRestriction, 0, 1);
-        
-        QLabel *functionLabel = new QLabel("<=:");
-        echoLayout->addWidget(functionLabel, 1, 0);
-        smallerThanRestriction = new QLineEdit;
-        echoLayout->addWidget(smallerThanRestriction, 1, 1 );
+	slide = new Slide(this);
+	echoLayout->addWidget(slide, 0, 0 );
+        selectGroup->setLayout(echoLayout);
 
+      }
+      selectGroup->setFixedHeight(70);
+      QRPanel &analysisPanel = topPanels << *new QRPanel(QROSE::LeftRight, QROSE::UseSplitter);
+      {
+	// add analyses here
+	QTabWidget *qtabwidgetL =  analysisPanel << new QTabWidget( );
+	listWidget = new QListWidget;
+	new QListWidgetItem(("Align Functions"), listWidget);
+	new QListWidgetItem(("Align Functions Smart"), listWidget);
+	new QListWidgetItem(("Andreas's Diff"), listWidget);
 
-	wholeFunction = new QComboBox;
-	wholeFunction->addItem(("No"));
-	wholeFunction->addItem(("Yes"));
+	QROSE::link(listWidget, 
+		    SIGNAL(itemSelectionChanged()), 
+		    &clicked1, this);
 
-	QLabel *wholeFunctionLabel = new QLabel("Only whole functions:");
-	echoLayout->addWidget(wholeFunctionLabel, 2, 0 );
+	qtabwidgetL->insertTab(0,listWidget,"Analyses");
+	
+	QTabWidget *qtabwidget =  analysisPanel << new QTabWidget( );
+	analysisPanel.setTileSize(50,50);
 
-	echoLayout->addWidget(wholeFunction, 2, 1 );
+	analysisResult = new QTextEdit;//new QREdit(QREdit::Box);
+	analysisResult->setReadOnly(true);
+	analysisResult->setText("Initializing GUI");
 
-        selectGroup->setLayout(echoLayout);
+	fileInfo = new QTextEdit;//new QREdit(QREdit::Box);
+	fileInfo->setReadOnly(true);
+	insertFileInformation();
+
+	qtabwidget->insertTab(0,analysisResult,"Analysis Results");
+	qtabwidget->insertTab(1,fileInfo,"File Info");
       }
-      
-      comboBox = new QComboBox;
-      comboBox->addItem(("Normalized"));
-      comboBox->addItem(("Whole Function"));
-      
-      QGroupBox *echoGroup =  parameters <<  new QGroupBox(("Selection Clone-View"));
-      QGridLayout *echoLayout =  new QGridLayout;
-      QLabel *echoLabel = new QLabel("Views:");
-      echoLayout->addWidget(echoLabel, 0, 0);
-      echoLayout->addWidget(comboBox, 0, 1);
-
-
-      echoGroup->setLayout(echoLayout);
-
-      QROSE::link(comboBox, SIGNAL(activated(int)), &viewBoxActivated, this);
+      //      topPanels.setFixedHeight(300);
     }
       
     QRPanel &bottomPanel = mainPanel << *new QRPanel(QROSE::LeftRight, QROSE::UseSplitter);
     {
       QRPanel &bottomPanelLeft = bottomPanel << *new QRPanel(QROSE::LeftRight, QROSE::UseSplitter);
       {
-	tableWidget = bottomPanelLeft << new QRTable( 2, "function","#instr" );
-	QROSE::link(tableWidget, SIGNAL(activated(int, int, int, int)), &tableWidgetCellActivated, this);
-	codeTableWidget = bottomPanelLeft << new QRTable( 4, "address","instr","operands","comment" );
+	tableWidget = bottomPanelLeft << new QRTable( 1, "function" );
+	QROSE::link(tableWidget, SIGNAL(activated(int, int, int, int)), &tableWidgetCellActivatedA, this);
+	tableWidget2 = bottomPanelLeft << new QRTable( 1, "function" );
+	QROSE::link(tableWidget2, SIGNAL(activated(int, int, int, int)), &tableWidgetCellActivatedB, this);
 
+	//	bottomPanelLeft.setTileSize(20,20);
+      }
 
-	QROSE::link(codeTableWidget, SIGNAL(activated(int, int, int, int)), &codeTableWidgetCellActivated, this);
+      QRPanel &bottomPanelRight = bottomPanel << *new QRPanel(QROSE::LeftRight, QROSE::UseSplitter);
+      {
+	codeTableWidget = bottomPanelRight << new QRTable( 7, "row","address","instr","operands","comment","pos","byte" );
+	QROSE::link(codeTableWidget, SIGNAL(activated(int, int, int, int)), &codeTableWidgetCellActivatedA, this);
+	if (sourceFile) {
+	  codeTableWidget2 = bottomPanelRight << new QRTable( 5, "row","line","text","type","pos" );
+	  maxrows=3;
+	} else {
+	  codeTableWidget2 = bottomPanelRight << new QRTable( 7, "row","address","instr","operands","comment","pos","byte" );
+	}
+	QROSE::link(codeTableWidget2, SIGNAL(activated(int, int, int, int)), &codeTableWidgetCellActivatedB, this);
 
-	//	codeWidget = bottomPanelLeft << new QTextEdit;//new QREdit(QREdit::Box);
-	//codeWidget->setReadOnly(true);
       }
-      bottomPanelLeft.setTileSize(25,90);
-      codeWidget2 = bottomPanel << new QTextEdit;//new QREdit(QREdit::Box);
-      codeWidget2->setReadOnly(true);
-      bottomPanel.setTileSize(50,50);
+      bottomPanelLeft.setFixedWidth(screenWidth/5 );
     } //mainPanel
-    mainPanel.setTileSize(10,60);
+    mainPanel.setTileSize(30);
   } //window 
 
-  window->setGeometry(0,0,1280,1200);
-  window->setTitle("BinaryCloneMainGui");
+
+
+  window->setGeometry(0,0,screenWidth,screenHeight);
+  window->setTitle("BinQ");
+  analysisResult->append("Initializing done.");
+  QString res = QString("A: Total functions  %1.  Total statements: %2. ")
+    .arg(funcsFileA.size())
+    .arg(itemsFileA.size());
+  analysisResult->append(res);  
+  QString res2 = QString("B: Total functions  %1.  Total statements: %2. ")
+    .arg(funcsFileB.size())
+    .arg(itemsFileB.size());
+  analysisResult->append(res2);  
+
+
+  updateByteItemList();
+  // ------------------------------------
+
 } //BinQGUI::BinQGUI()
 
 
 void BinQGUI::open() {
+#if 0
   char buf[4096] = "\0";
   std::string database = QFileDialog::getOpenFileName( 0, "Open As", getcwd(buf, 4096), "ASCII (*.sql)").toStdString();
   if( database.empty() ) return;
@@ -235,9 +702,12 @@
     //codeWidget->setReadOnly(true);
     //codeWidget->setPlainText(QString("foobar\nBar\nFoobari3"));
   }
+#endif
 } //CompassGui::open()
 
 void BinQGUI::reset() {
+  init();
+  updateByteItemList();
 } //CompassGui::open()
 
 
@@ -246,125 +716,152 @@
 void
 BinQGUI::run( ) {
   QROSE::unlink(tableWidget, SIGNAL(activated(int, int, int, int)));
-  while(tableWidget->rowCount()) tableWidget->removeRow(0);
+  QROSE::unlink(tableWidget2, SIGNAL(activated(int, int, int, int)));
+  while(tableWidget->rowCount()) 
+    tableWidget->removeRow(0);
+  while(tableWidget2->rowCount()) 
+    tableWidget2->removeRow(0);
 
-
-  FindAsmFunctionsVisitor funcVis;
-  AstQueryNamespace::querySubTree(fileA, std::bind2nd( funcVis, &funcs ));
-  //FindInstructionsVisitor vis;
-  //AstQueryNamespace::querySubTree(fileA, std::bind2nd( vis, &insns ));
-  FindStatementsVisitor visStat;
-  AstQueryNamespace::querySubTree(fileA, std::bind2nd( visStat, &stmts ));
-
-  vectorOfClones.allocate(funcs.size());
-  for (size_t row = 0; row < funcs.size(); ++row) {
-    Element cur_elem;
-    cur_elem.function_name_A = funcs[row]->get_name();
-    cur_elem.function_name_B = funcs[row]->get_name();
-
-    FindStatementsVisitor visStat2;
-    std::vector<SgAsmStatement*> stmts2;
-    AstQueryNamespace::querySubTree(funcs[row], std::bind2nd( visStat2, &stmts2 ));
-    cur_elem.size = stmts2.size();
-    vectorOfClones[row] = cur_elem;
-    
+  tableWidget->setTextColor(QColor(0,0,255),0);
+  tableWidget2->setTextColor(QColor(0,0,255),0);
+  for (size_t row = 0; row < funcsFileA.size(); ++row) {
     tableWidget->addRows(1);
-    tableWidget->setText(boost::lexical_cast<std::string>(cur_elem.function_name_A), 0, row);
-    tableWidget->setText(boost::lexical_cast<std::string>(cur_elem.size), 1, row);
+    ROSE_ASSERT(isSgAsmFunctionDeclaration(funcsFileA[row]));
+    tableWidget->setText(boost::lexical_cast<std::string>(isSgAsmFunctionDeclaration(funcsFileA[row])->get_name()), 0, row);
+    //tableWidget->setText(boost::lexical_cast<std::string>(cur_elem.size), 1, row);
     tableWidget->setVDim(row,18);
   }
+  for (size_t row = 0; row < funcsFileB.size(); ++row) {
+    tableWidget2->addRows(1);
+    if (isSgAsmFunctionDeclaration(funcsFileB[row]))
+      tableWidget2->setText(boost::lexical_cast<std::string>(isSgAsmFunctionDeclaration(funcsFileB[row])->get_name()), 0, row);
+    if (isSgFunctionDeclaration(funcsFileB[row])) {
+      SgFunctionDeclaration* func = isSgFunctionDeclaration(funcsFileB[row]);
+      if (func->get_file_info()->isCompilerGenerated())
+	tableWidget2->setTextColor(QColor(255,0,0),0,row);	
+      else if (isSgFunctionDefinition(func->get_definition()))
+	tableWidget2->setTextColor(QColor(0,0,0),0,row);
+      else
+	tableWidget2->setTextColor(QColor(128,128,128),0,row);
+      //      cerr << row << " comp : " << func->get_file_info()->isCompilerGenerated() <<
+      //	"   def : " << isSgFunctionDefinition(func->get_definition()) << endl;
+      tableWidget2->setText(boost::lexical_cast<std::string>(isSgFunctionDeclaration(funcsFileB[row])->get_name().str()), 0, row);
+    }
+    tableWidget2->setVDim(row,18);
+  }
   tableWidget->setHAlignment(true, false, 0); // left horizontal alignment
-  tableWidget->setHAlignment(true, false, 1); // left horizontal alignment
-  tableWidget->setTextColor(QColor(0,0,255),0);
-  tableWidget->setHDim(0,100);
-  tableWidget->setHDim(1,40);
+
+  tableWidget->setHDim(0,140);
   tableWidget->setShowGrid(false);
-  //    tableWidget->setColumnStretchable(0,false);
+  tableWidget2->setHAlignment(true, false, 0); // left horizontal alignment
+  tableWidget2->setHDim(0,140);
+  tableWidget2->setShowGrid(false);
+
   
-  QROSE::link(tableWidget, SIGNAL(activated(int, int, int, int)), 
-	      &tableWidgetCellActivated, this);
-  showFileA(0);
+  QROSE::link(tableWidget, SIGNAL(activated(int, int, int, int)),  &tableWidgetCellActivatedA, this);
+  QROSE::link(tableWidget2, SIGNAL(activated(int, int, int, int)),  &tableWidgetCellActivatedB, this);
+    showFileA(0);
+  showFileB(0);
 }
 
 
-  
-
-
 void BinQGUI::showFileA(int row) {
   QROSE::unlink(codeTableWidget, SIGNAL(activated(int, int, int, int)));
-  while(codeTableWidget->rowCount()) codeTableWidget->removeRow(0);
 
-  //Disassemble files
-  Element& elem = vectorOfClones[row];
-  std::string unparsedFileA;
-  std::string unparsedFileB;
+  while(codeTableWidget->rowCount()) 
+    codeTableWidget->removeRow(0);
 
-  std::string normalizedFileA;
-  std::string normalizedFileB;
-
   ROSE_ASSERT(fileA != NULL);
   ROSE_ASSERT(fileB != NULL);
 
+  ROSE_ASSERT(isSgAsmFunctionDeclaration(funcsFileA[row]));
+  QString res = QString("FILE A : Looking at function  %1  row: %2  size ")
+    .arg(isSgAsmFunctionDeclaration(funcsFileA[row])->get_name().c_str())
+    .arg(row);
+  //    .arg(elem.size);
+  analysisResult->append(res);  
+  //  std::cout << "Looking at function " << elem.function_name_B << "   row : " << row << "   size : " << elem.size << std::endl;
+  int rowC=0;
+  int posC=0;
+  for(size_t i=0; i < itemsFileA.size(); i++ )    {
+    SgAsmStatement* stmts = isSgAsmStatement(itemsFileA[i]->statement);
+    //    ROSE_ASSERT(stmts);
+    int length=1;    
+    bool addRow=false;
+    //posRowA[posC]=-1;
+    if (isSgAsmx86Instruction(stmts)) {
+      codeTableWidget->addRows(1);
+      length = isSgAsmInstruction(stmts)->get_raw_bytes().size();
+      //      if (itemsFileA[i]->plus)
+      //	itemsFileA[i]->bg=QColor(135,206,255);
 
-  int addr=0;
-  for (size_t i = 0; i < funcs.size(); ++i) {
-    if( funcs[i]->get_name() == (elem.function_name_A ))      {
-      addr=funcs[i]->get_address();
-      //cerr << " FOUND FUNCTION " << elem.function_name_A << " at address : " << RoseBin_support::HexToString(addr) << endl;
-    }
-  }
-  size_t pos=0;
-  for (size_t i = 1; i < stmts.size(); ++i) {
-    if (stmts[i]->get_address()==addr) {
-      pos=i;
-      //      cerr << " FOUND STMT at address : " << RoseBin_support::HexToString(addr) << "  at pos : " << pos << endl;
-      break;
-    }
-  }
+      itemsFileA[i]->bg=QColor(255,255,255);
+      QColor back = itemsFileA[i]->bg;
+      itemsFileA[i]->fg=QColor(0,0,0);
+      QColor front = itemsFileA[i]->fg;
 
-  std::cout << "Looking at function " << elem.function_name_B << "   pos : " << pos << "   size : " << elem.size << std::endl;
-  std::string allInsnsUnparsed;
-  for(size_t i=0; i < stmts.size(); i++ )    {
-    bool addRow=false;
-    if (isSgAsmx86Instruction(stmts[i])) {
-      codeTableWidget->addRows(1);
-      codeTableWidget->setTextColor(QColor(255,0,0),0,i);
-      codeTableWidget->setTextColor(QColor(0,0,255),1,i);
-      codeTableWidget->setTextColor(QColor(0,155,0),2,i);
+      for (int j=1;j<maxrows;++j) {
+	codeTableWidget->setBgColor(back,j,i);
+      }
+      codeTableWidget->setTextColor(front,0,i);
+      codeTableWidget->setTextColor(QColor(255,0,0),1,i);
+      codeTableWidget->setTextColor(QColor(0,0,255),2,i);
       codeTableWidget->setTextColor(QColor(0,155,0),3,i);
-      codeTableWidget->setText(boost::lexical_cast<std::string>(RoseBin_support::HexToString((isSgAsmx86Instruction(stmts[i]))->get_address()) ), 0, i);
-      codeTableWidget->setText(boost::lexical_cast<std::string>((isSgAsmx86Instruction(stmts[i]))->get_mnemonic() ), 1, i);
-      SgAsmOperandList * ops = isSgAsmx86Instruction(stmts[i])->get_operandList();
+      codeTableWidget->setTextColor(QColor(0,155,0),4,i);
+      codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->row), 0, i);	
+      codeTableWidget->setText(boost::lexical_cast<std::string>(RoseBin_support::HexToString((isSgAsmx86Instruction(stmts))->get_address()) ), 1, i);
+      codeTableWidget->setText(boost::lexical_cast<std::string>((isSgAsmx86Instruction(stmts))->get_mnemonic() ), 2, i);
+      SgAsmOperandList * ops = isSgAsmx86Instruction(stmts)->get_operandList();
       SgAsmExpressionPtrList& opsList = ops->get_operands();
       SgAsmExpressionPtrList::iterator it = opsList.begin();
       string opsName="";
       for (;it!=opsList.end();++it) {
-	opsName += boost::lexical_cast<std::string>(unparseX86Expression(*it, false) );
+	opsName += boost::lexical_cast<std::string>(unparseX86Expression(*it, false) )+", ";
       }
-      codeTableWidget->setText(boost::lexical_cast<std::string>(opsName), 2, i);	
-      codeTableWidget->setText(boost::lexical_cast<std::string>((isSgAsmx86Instruction(stmts[i]))->get_comment() ), 3, i);
+      codeTableWidget->setText(boost::lexical_cast<std::string>(opsName), 3, i);	
+      codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->comment ), 4, i);
+      codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->pos), 5, i);	
+      codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->length), 6, i);	
       addRow=true;
-    } else if (isSgAsmBlock(stmts[i])  && !(isSgAsmInterpretation(isSgAsmBlock(stmts[i])->get_parent()))) {
-    //cerr << " isSgAsmBlock(stmts[i])->get_parent() " << isSgAsmBlock(stmts[i])->get_parent()->class_name() << endl;
+    } else if (isSgAsmBlock(stmts)  && !(isSgAsmInterpretation(isSgAsmBlock(stmts)->get_parent()))) {
+      //cerr << " isSgAsmBlock(stmts[i])->get_parent() " << isSgAsmBlock(stmts[i])->get_parent()->class_name() << endl;
       codeTableWidget->addRows(1);
       codeTableWidget->setTextColor(QColor(128,128,128),0,i);
-      codeTableWidget->setTextColor(QColor(255,255,0),1,i);
-      codeTableWidget->setText(boost::lexical_cast<std::string>(RoseBin_support::HexToString((isSgAsmBlock(stmts[i]))->get_address()) ), 0, i);
-      codeTableWidget->setText(boost::lexical_cast<std::string>("***"), 1, i);
+      codeTableWidget->setTextColor(QColor(128,128,128),1,i);
+      codeTableWidget->setTextColor(QColor(255,255,0),2,i);
+      codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->row), 0, i);	
+      codeTableWidget->setText(boost::lexical_cast<std::string>(RoseBin_support::HexToString((isSgAsmBlock(stmts))->get_address()) ), 1, i);
+      codeTableWidget->setText(boost::lexical_cast<std::string>("***"), 2, i);
       addRow=true;
-    } else if (isSgAsmFunctionDeclaration(stmts[i]),i) {
+    }  else if (isSgAsmFunctionDeclaration(stmts)) {
       codeTableWidget->addRows(1);
-      //      codeTableWidget->addRows(1);
-      codeTableWidget->setTextColor(QColor(0,0,0),0,i);
-      codeTableWidget->setTextColor(QColor(0,0,0),1,i);
-      codeTableWidget->setTextColor(QColor(0,0,0),2,i);
-      codeTableWidget->setText(boost::lexical_cast<std::string>(RoseBin_support::HexToString((isSgAsmFunctionDeclaration(stmts[i]))->get_address()) ), 0, i);
-      codeTableWidget->setText(boost::lexical_cast<std::string>("FUNC"), 1, i);
-      codeTableWidget->setText(boost::lexical_cast<std::string>((isSgAsmFunctionDeclaration(stmts[i]))->get_name() ), 2, i);
+      itemsFileA[i]->bg=QColor(0,0,0);
+      QColor back = itemsFileA[i]->bg;
+      itemsFileA[i]->fg=QColor(255,255,255);
+      QColor front = itemsFileA[i]->fg;
+      for (int j=1;j<maxrows;++j) {
+	codeTableWidget->setBgColor(back,j,i);
+	codeTableWidget->setTextColor(front,j,i);
+      }
+      codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->row), 0, i);	
+      codeTableWidget->setText(boost::lexical_cast<std::string>(RoseBin_support::HexToString((isSgAsmFunctionDeclaration(stmts))->get_address()) ), 1, i);
+      codeTableWidget->setText(boost::lexical_cast<std::string>("FUNC"), 2, i);
+      codeTableWidget->setText(boost::lexical_cast<std::string>((isSgAsmFunctionDeclaration(stmts))->get_name() ), 3, i);
+      codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->pos), 5, i);	
+      codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->length), 6, i);	
       addRow=true;
     } else {
       codeTableWidget->addRows(1);
-      cerr << " FOUND UNEXPECTED NODE " << stmts[i]->class_name() << endl;
+      itemsFileA[i]->bg=QColor(128,128,128);
+      QColor back = itemsFileA[i]->bg;
+      for (int j=1;j<maxrows;++j) {
+	codeTableWidget->setBgColor(back,j,i);
+      }
+      if (itemsFileA[i]->row) {
+	codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->row), 0, i);	
+	codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->pos), 5, i);	
+	codeTableWidget->setText(boost::lexical_cast<std::string>(itemsFileA[i]->length), 6, i);	
+      }
       addRow=true;
     }
     if (addRow) {
@@ -374,27 +871,212 @@
       codeTableWidget->setHAlignment(true, false, 3); // left horizontal alignment
       
       codeTableWidget->setVDim(i,18);
-      codeTableWidget->setHDim(0,80);
-      codeTableWidget->setHDim(1,50);
-      codeTableWidget->setHDim(2,170);
-      codeTableWidget->setHDim(3,130);
-
+      codeTableWidget->setHDim(0,30);
+      codeTableWidget->setHDim(1,80);
+      codeTableWidget->setHDim(2,50);
+      codeTableWidget->setHDim(3,190);
+      codeTableWidget->setHDim(4,110);
+      codeTableWidget->setHDim(5,30);
+      codeTableWidget->setHDim(6,30);
+      
+      //posRowA[posC]=rowC;
+      //      cerr << "added at pos:" << posC << "  rowC:" << rowC<<endl;
+      rowC++;
+      posC+=length;
     }
   }
 
-  selectView(0);
-     
-  for(size_t i=0; i < stmts.size(); i++ ) 
-    unhighlightInstructionRow(i);  
-  for(size_t i=pos; i < (pos+elem.size); i++ ) 
-    highlightInstructionRow(i);  
+  codeTableWidget->setShowGrid(false);
+  codeTableWidget->setCurrentCell(row,0);
 
+  QROSE::link(codeTableWidget, SIGNAL(activated(int, int, int, int)), &codeTableWidgetCellActivatedA, this);
 
-  codeTableWidget->setShowGrid(false);
-  codeTableWidget->setCurrentCell(pos+elem.size,0);
-  QROSE::link(codeTableWidget, SIGNAL(activated(int, int, int, int)), 
-	      &codeTableWidgetCellActivated, this);
+}
 
+void BinQGUI::showFileB(int row) {
+  QROSE::unlink(codeTableWidget2, SIGNAL(activated(int, int, int, int)));
+
+  while(codeTableWidget2->rowCount()) 
+    codeTableWidget2->removeRow(0);
+
+  ROSE_ASSERT(fileA != NULL);
+  ROSE_ASSERT(fileB != NULL);
+  std::string funcname ="";
+  if (isSgAsmFunctionDeclaration(funcsFileB[row])) {
+    funcname=isSgAsmFunctionDeclaration(funcsFileB[row])->get_name();
+  }
+  QString res = QString("FILE B : Looking at function  %1  row: %2  size ")
+    .arg(funcname.c_str())
+    .arg(row);
+  //    .arg(elem.size);
+  analysisResult->append(res);  
+  //  std::cout << "Looking at function " << elem.function_name_B << "   row : " << row << "   size : " << elem.size << std::endl;
+  int rowC=0;
+  int posC=0;
+  for(size_t i=0; i < itemsFileB.size(); i++ )    {
+    SgNode* stmts = itemsFileB[i]->statement;
+    int length=1;    
+    bool addRow=false;
+    //posRowB[posC]=-1;
+    if (isSgAsmx86Instruction(stmts)) {
+      codeTableWidget2->addRows(1);
+      length = isSgAsmInstruction(stmts)->get_raw_bytes().size();
+
+      itemsFileB[i]->bg=QColor(255,255,255);
+      QColor back = itemsFileB[i]->bg;
+      itemsFileB[i]->fg=QColor(0,0,0);
+      QColor front = itemsFileB[i]->fg;
+      for (int j=1;j<maxrows;++j) {
+	codeTableWidget2->setBgColor(back,j,i);
+      }
+      codeTableWidget2->setTextColor(front,0,i);
+      codeTableWidget2->setTextColor(QColor(255,0,0),1,i);
+      codeTableWidget2->setTextColor(QColor(0,0,255),2,i);
+      codeTableWidget2->setTextColor(QColor(0,155,0),3,i);
+      codeTableWidget2->setTextColor(QColor(0,155,0),4,i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->row), 0, i);	
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(RoseBin_support::HexToString((isSgAsmx86Instruction(stmts))->get_address()) ), 1, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>((isSgAsmx86Instruction(stmts))->get_mnemonic() ), 2, i);
+      SgAsmOperandList * ops = isSgAsmx86Instruction(stmts)->get_operandList();
+      SgAsmExpressionPtrList& opsList = ops->get_operands();
+      SgAsmExpressionPtrList::iterator it = opsList.begin();
+      string opsName="";
+      for (;it!=opsList.end();++it) {
+	opsName += boost::lexical_cast<std::string>(unparseX86Expression(*it, false) )+", ";
+      }
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(opsName), 3, i);	
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->comment ), 4, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->pos), 5, i);	
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->length), 6, i);	
+      addRow=true;
+    } else if (isSgAsmBlock(stmts)  && !(isSgAsmInterpretation(isSgAsmBlock(stmts)->get_parent()))) {
+      //cerr << " isSgAsmBlock(stmts[i])->get_parent() " << isSgAsmBlock(stmts[i])->get_parent()->class_name() << endl;
+      codeTableWidget2->addRows(1);
+      codeTableWidget2->setTextColor(QColor(128,128,128),0,i);
+      codeTableWidget2->setTextColor(QColor(128,128,128),1,i);
+      codeTableWidget2->setTextColor(QColor(255,255,0),2,i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->row), 0, i);	
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(RoseBin_support::HexToString((isSgAsmBlock(stmts))->get_address()) ), 1, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>("***"), 2, i);
+      addRow=true;
+    } else if (isSgAsmFunctionDeclaration(stmts)) {
+      codeTableWidget2->addRows(1);
+      itemsFileB[i]->bg=QColor(0,0,0);
+      QColor back = itemsFileB[i]->bg;
+      itemsFileB[i]->fg=QColor(255,255,255);
+      QColor front = itemsFileB[i]->fg;
+      for (int j=1;j<maxrows;++j) {
+	codeTableWidget2->setBgColor(back,j,i);
+	codeTableWidget2->setTextColor(front,j,i);
+      }
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->row), 0, i);	
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(RoseBin_support::HexToString((isSgAsmFunctionDeclaration(stmts))->get_address()) ), 1, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>("FUNC"), 2, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>((isSgAsmFunctionDeclaration(stmts))->get_name() ), 3, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->pos), 5, i);	
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->length), 6, i);	
+      addRow=true;
+    } 
+    else if (isSgFunctionDeclaration(stmts)) {
+      SgFunctionDeclaration* func = isSgFunctionDeclaration(stmts);
+      //cerr << func->class_name() << "  maxrows: " << maxrows << endl;
+      codeTableWidget2->addRows(1);
+      itemsFileB[i]->bg=QColor(0,0,0);
+      QColor back = itemsFileB[i]->bg;
+      itemsFileB[i]->fg=QColor(255,255,255);
+      QColor front = itemsFileB[i]->fg;
+      for (int j=1;j<maxrows;++j) {
+	codeTableWidget2->setBgColor(back,j,i);
+	codeTableWidget2->setTextColor(front,j,i);
+      }
+      //      if (isSgFunctionDefinition(func->get_definition()))
+      //	cerr << row << " " << func->unparseToString() << endl;
+
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->row), 0, i);	
+      codeTableWidget2->setText(boost::lexical_cast<std::string>("FUNC"), 1, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(func->get_name().str() ), 2, i);
+      std::string comment = func->get_file_info()->isCompilerGenerated() ? "compiler gen": " ";
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(comment ), 3, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->pos), 4, i);	
+      addRow=true;
+
+    } else if (isSgLocatedNode(stmts)) {
+      SgLocatedNode* st = isSgLocatedNode(stmts);
+      //cerr << st->class_name() << "  maxrows: " << maxrows << endl;
+      codeTableWidget2->addRows(1);
+
+      itemsFileB[i]->bg=QColor(255,255,255);
+      QColor back = itemsFileB[i]->bg;
+      itemsFileB[i]->fg=QColor(0,0,0);
+      QColor front = itemsFileB[i]->fg;
+      for (int j=1;j<maxrows;++j) {
+	codeTableWidget2->setBgColor(back,j,i);
+      }
+      codeTableWidget2->setTextColor(front,0,i);
+      codeTableWidget2->setTextColor(QColor(255,0,0),1,i);
+      codeTableWidget2->setTextColor(QColor(0,0,255),2,i);
+      codeTableWidget2->setTextColor(QColor(0,155,0),3,i);
+      codeTableWidget2->setTextColor(QColor(0,155,0),4,i);
+
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->row), 0, i);	
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->lineNr ), 1, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(st->unparseToString()), 2, i);
+      //int size = st->get_traversalSuccessorContainer().size();
+      //cerr << size << " : " << st->unparseToString() << endl;
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->comment ), 3, i);
+      codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->pos), 4, i);	
+
+      addRow=true;
+    } 
+    else {
+	codeTableWidget2->addRows(1);
+	itemsFileB[i]->bg=QColor(128,128,128);
+	QColor back = itemsFileB[i]->bg;
+	for (int j=1;j<maxrows;++j) {
+	  codeTableWidget2->setBgColor(back,j,i);
+	}
+
+	if (itemsFileB[i]->row) {
+	  codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->row), 0, i);	
+	  if (!sourceFile) {
+	    codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->pos), 5, i);	
+	    codeTableWidget2->setText(boost::lexical_cast<std::string>(itemsFileB[i]->length), 6, i);	
+	  }
+	}
+      addRow=true;
+    }
+
+    if (addRow) {
+      codeTableWidget2->setHAlignment(true, false, 0); // left horizontal alignment
+      codeTableWidget2->setHAlignment(true, false, 1); // left horizontal alignment
+      codeTableWidget2->setHAlignment(true, false, 2); // left horizontal alignment
+      codeTableWidget2->setHAlignment(true, false, 3); // left horizontal alignment
+      codeTableWidget2->setHAlignment(true, false, 4); // left horizontal alignment
+      
+      codeTableWidget2->setVDim(i,18);
+      if (sourceFile) {
+	codeTableWidget2->setHDim(0,30);
+	codeTableWidget2->setHDim(1,50);
+	codeTableWidget2->setHDim(2,300);
+	codeTableWidget2->setHDim(3,110);
+	codeTableWidget2->setHDim(4,40);
+      } else {
+	codeTableWidget2->setHDim(0,30);
+	codeTableWidget2->setHDim(1,80);
+	codeTableWidget2->setHDim(2,50);
+	codeTableWidget2->setHDim(3,190);
+	codeTableWidget2->setHDim(4,110);
+	codeTableWidget2->setHDim(5,30);
+	codeTableWidget2->setHDim(6,30);
+      }
+      rowC++;
+      posC+=length;
+    }
+  }
+  codeTableWidget2->setShowGrid(false);
+  codeTableWidget2->setCurrentCell(row,0);
+
+  QROSE::link(codeTableWidget2, SIGNAL(activated(int, int, int, int)), &codeTableWidgetCellActivatedB, this);
 }
 
 

Modified: branches/rice/projects/BinQ/BinQGui.h
===================================================================
--- branches/rice/projects/BinQ/BinQGui.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/BinQ/BinQGui.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -10,111 +10,81 @@
 #include <QLabel>
 #include <QLineEdit>
 #include <QCheckBox>
+#include <QRProgress.h>
 
-#include <boost/smart_ptr.hpp>
-#include <boost/lexical_cast.hpp>
-#include <stdint.h>
-#include "BinQSupport.h"
+#include <QList>
+#include <QListWidget>
+#include <QListWidgetItem>
 
-template <typename T>
-class scoped_array_with_size {
-  boost::scoped_array<T> sa;
-  size_t theSize;
+#include <QDesktopWidget>
+#include <QApplication>
 
-  public:
-  scoped_array_with_size(): sa(), theSize(0) {}
-  scoped_array_with_size(size_t s): sa(new T[s]), theSize(s) {}
+#include "Item.h"
 
-  void allocate(size_t s) {
-    sa.reset(new T[s]);
-    theSize = s;
-  }
-  size_t size() const {return theSize;}
-  T* get() const {return sa.get();}
+class Slide;
+class BinQSupport;
 
-  T& operator[](size_t i) {return sa[i];}
-  const T& operator[](size_t i) const {return sa[i];}
 
-  private:
-  scoped_array_with_size(const scoped_array_with_size<T>&); // Not copyable
-};
-
-
-
-struct Element {
-  uint64_t size;
-  uint64_t function_A ;
-  uint64_t function_B ;
-  uint64_t begin_index_within_function_A ;
-  uint64_t end_index_within_function_A   ;
-  uint64_t begin_index_within_function_B ;
-  uint64_t end_index_within_function_B   ;
-  std::string file_A;
-  std::string function_name_A;
-  std::string file_B;
-  std::string function_name_B;
-
-};
-
-
-class BinQGUI
+class BinQGUI //: public QWidget
 {
   public:
-    BinQGUI(std::string, std::string );
+  BinQGUI(std::string, std::string );
     ~BinQGUI();
     void run( ) ;
     void open();
     void reset();
-    void highlightFunctionRow(int);
-    void unhighlightFunctionRow(int);
-    void highlightInstructionRow(int);
-    void unhighlightInstructionRow(int);
+    void highlightFunctionRow(int,bool fileA);
+    void unhighlightFunctionRow(int,bool fileA);
+    void highlightInstructionRow(int,bool fileA);
+    void unhighlightInstructionRow(int,bool fileA);
 
     void showFileA(int row);
-    //SgNode* disassembleFile(std::string tsv_directory);
-    //std::string normalizeInstructionsToHTML(std::vector<SgAsmx86Instruction*>::iterator beg, 
-    //std::vector<SgAsmx86Instruction*>::iterator end);
+    void showFileB(int row);
 
-    //std::pair<std::string,std::string> getAddressFromVectorsTable(uint64_t function_id, uint64_t index);
+    std::vector<Item*> itemsFileA;
+    std::vector<Item*> itemsFileB;
+    std::map<int,Item*> byteItemFileA;
+    std::map<int,Item*> byteItemFileB;
+    QTextEdit *analysisResult;
+    QTextEdit *fileInfo;
+    QListWidget *listWidget;
+    SgNode* fileA;
+    SgNode* fileB;
+    Slide *slide;
+    int maxrows;
 
-    void selectView(int selection);
-
-  protected:
     qrs::QRWindow *window;
     qrs::QRTable *tableWidget;
     qrs::QRTable *codeTableWidget;
-    //QTextEdit *codeWidget;
-    QTextEdit *codeWidget2;
+
+    qrs::QRTable *tableWidget2;
+    qrs::QRTable *codeTableWidget2;
+
+    
+    void updateByteItemList();
+
+  protected:
     QComboBox *comboBox;
-    QComboBox *wholeFunction;
+    qrs::QRProgress *wholeFunction;
+    
 
     QTextBrowser *codeBrowser;
     QLineEdit *smallerThanRestriction;
     QLineEdit *largerThanRestriction;
-    //    QComboBox *checkBoxLockBars;
-  private:
 
-    std::vector<SgAsmFunctionDeclaration*> funcs;
-    //    std::vector<SgAsmx86Instruction*> insns;
-    std::vector<SgAsmStatement*> stmts;
-
+  private:
+    void insertFileInformation();
+    std::vector<SgNode*> funcsFileA;
+    std::vector<SgNode*> funcsFileB;
     BinQSupport* binqsupport;
     
     std::string fileNameA,fileNameB;
-    SgNode* fileA;
-    SgNode* fileB;
 
-    double similarity;
-    int stride;
-    int windowSize;
-    int activeFunctionRow;
-    int activeInstructionRow;
-
-
-    scoped_array_with_size<Element > vectorOfClones;
-    std::pair<std::string,std::string> normalizedView;
-    std::pair<std::string,std::string> unparsedView;
-    std::pair<std::string,std::string> allInsnsUnparsedView;
+    int screenWidth;
+    int screenHeight;
+    void init();
+    void createGUI();
+    bool sourceFile;
    
 }; //class BinQGUI
 

Modified: branches/rice/projects/BinQ/BinQMain.C
===================================================================
--- branches/rice/projects/BinQ/BinQMain.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/BinQ/BinQMain.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -2,6 +2,7 @@
  *
  */
 
+#include "rose.h"
 #include <vector>
 #include <qrose.h>
 #include "BinQGui.h"
@@ -16,10 +17,19 @@
 
 int main( int argc, char **argv )
 {
+#if 0
+  RoseBin_Def::RoseAssemblyLanguage = RoseBin_Def::x86;
+  fprintf(stderr, "Starting binCompass frontend...\n");
+  SgProject* project = frontend(argc,argv);
+  ROSE_ASSERT (project != NULL);
+  fprintf(stderr, "End binCompass frontend...\n\n\n");
+#endif
+
+
   QROSE::init(argc,argv);
 
   std::string fileA,fileB;
-
+    bool test=false;
   try {
     options_description desc("Allowed options");
     desc.add_options()
@@ -28,8 +38,9 @@
        "file A to be diffed")
       ("fileB,b", value< string >()->composing(), 
        "file B to be diffed")
+      ("test", "for testing")
       ;
-
+//, value< bool >()->composing(), 
     variables_map vm;
     store(command_line_parser(argc, argv).options(desc)
         .run(), vm);
@@ -39,17 +50,22 @@
       cout << desc;            
       exit(0);
     }
+    if (vm.count("test")) {
+      test=true;
+    }
 
     if (vm.count("fileA")!=1 ||vm.count("fileB")!=1 ) {
-      std::cerr << "Missing options. Call as: astEquivalence --fileA <file A> --fileB <file B>" 
+      std::cerr << "Missing options. Call as: BinQ --fileA <file A> --fileB <file B>" 
         << std::endl;
       exit(1);
 
     }
 
+
     fileA = vm["fileA"].as<string >();
     fileB = vm["fileB"].as<string >();
-    cout << "File A: " << fileA << " File B: " << fileB << std::endl;
+    //    test = vm["test"].as<bool >();
+    cout << "File A: " << fileA << " File B: " << fileB << "  test? " << test << std::endl;
 
 
   }
@@ -59,10 +75,9 @@
 
 
 
-  
   BinQGUI binGui(fileA,fileB);
-
   binGui.run();
-  
+  if (test)
+    exit(0);
   return QROSE::exec();
 }

Modified: branches/rice/projects/BinQ/BinQSupport.C
===================================================================
--- branches/rice/projects/BinQ/BinQSupport.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/BinQ/BinQSupport.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -95,60 +95,63 @@
 }
 // ----------------------------------------------------------------------------------------------
 
+std::string BinQSupport::ToUpper(std::string myString)
+{
+  const int length = myString.length();
+  for(int i=0; i!=length ; ++i)
+    {
+      myString[i] = std::toupper(myString[i]);
+    }
+  return myString;
+}
 
 
+SgNode* BinQSupport::disassembleFile(std::string tsv_directory, std::string& sourceFile){
+  SgNode* globalBlock=NULL;
+  int found = tsv_directory.rfind(".");
+  string ending="";
 
-SgNode* BinQSupport::disassembleFile(std::string tsv_directory){
-  SgNode* globalBlock;
-  std::cout << "\nDisassembling: " << tsv_directory << std::endl;
-  if(exists(tsv_directory) == false)  {
-    char buf[4096] = "\0";
-    int i = 0; 
-    while( exists ( relativePathPrefix +"/"+ tsv_directory) == false )     {
-      if(i>10){
-        std::string error_message = "user error: Relative Path to  ";
-        error_message+=tsv_directory;
-        error_message+=" not selected in " ;
-        error_message+= boost::lexical_cast<std::string>(i);
-        error_message+=" attempts.";
-        eAssert(0,  (error_message.c_str()) );
-      }
-
-      QFileDialog dialog;
-      dialog.setFileMode(QFileDialog::DirectoryOnly);
-      //relativePathPrefix = dialog.getOpenFileName( 0, "Relative Path To Binaries", getcwd(buf, 4096), "ASCII (*)").toStdString();
-      relativePathPrefix = dialog.getExistingDirectory(0,  "get existing directory", getcwd(buf, 4096)).toStdString();
-      i++;
-    }
-    tsv_directory = relativePathPrefix +"/"+tsv_directory;
-  };
+  if (found!=string::npos) {
+    ending =tsv_directory.substr(found+1,tsv_directory.length());
+  }
+  std::cout << "\nDisassembling: " << tsv_directory << " Ending : " << ending << std::endl;
   
-  if(is_directory( tsv_directory  ) == true )
-    {
-      RoseBin_Def::RoseAssemblyLanguage=RoseBin_Def::x86;
-      RoseBin_Arch::arch=RoseBin_Arch::bit32;
-      RoseBin_OS::os_sys=RoseBin_OS::linux_op;
-      RoseBin_OS_VER::os_ver=RoseBin_OS_VER::linux_26;
-      RoseFile* roseBin = new RoseFile( (char*)tsv_directory.c_str() );
-      cerr << " ASSEMBLY LANGUAGE :: " << RoseBin_Def::RoseAssemblyLanguage << endl;
-      // query the DB to retrieve all data
-      globalBlock = roseBin->retrieve_DB();
-      // traverse the AST and test it
-      roseBin->test();
-    }else{
+  if(is_directory( tsv_directory  ) == true ){
+    std::cout << "\nsql: " << tsv_directory << std::endl;
+    RoseBin_Def::RoseAssemblyLanguage=RoseBin_Def::x86;
+    RoseBin_Arch::arch=RoseBin_Arch::bit32;
+    RoseBin_OS::os_sys=RoseBin_OS::linux_op;
+    RoseBin_OS_VER::os_ver=RoseBin_OS_VER::linux_26;
+    RoseFile* roseBin = new RoseFile( (char*)tsv_directory.c_str() );
+    cerr << " ASSEMBLY LANGUAGE :: " << RoseBin_Def::RoseAssemblyLanguage << endl;
+    // query the DB to retrieve all data
+    globalBlock = roseBin->retrieve_DB();
+    // traverse the AST and test it
+    roseBin->test();
+    sourceFile="false";
+  } else if (ToUpper(ending)=="C" || ToUpper(ending)=="CPP" || ToUpper(ending)=="CXX") {
+    cerr << "Found C code ... " << endl;
     vector<char*> args;
     args.push_back(strdup(""));
     args.push_back(strdup(tsv_directory.c_str()));
     args.push_back(0);
-
+    globalBlock =  frontend(args.size()-1,&args[0]);
+    sourceFile="true";
+  }  else{
+    vector<char*> args;
+    args.push_back(strdup(""));
+    args.push_back(strdup(tsv_directory.c_str()));
+    args.push_back(0);
+    
     ostringstream outStr; 
     for(vector<char*>::iterator iItr = args.begin(); iItr != args.end();
-        ++iItr )    {
+	++iItr )    {
       outStr << *iItr << " ";
     }     
     ;
     std::cout << "Calling " << outStr.str() << std::endl;
     globalBlock =  frontend(args.size()-1,&args[0]);
+    sourceFile="false";
   }
   return globalBlock;
 };
@@ -158,7 +161,7 @@
 
 std::string 
 BinQSupport::normalizeInstructionsToHTML(std::vector<SgAsmx86Instruction*>::iterator beg, 
-					    std::vector<SgAsmx86Instruction*>::iterator end) {
+					 std::vector<SgAsmx86Instruction*>::iterator end) {
   string normalizedUnparsedInstructions;
   map<SgAsmExpression*, size_t> valueNumbers[3];
   numberOperands( beg,end, valueNumbers);

Modified: branches/rice/projects/BinQ/BinQSupport.h
===================================================================
--- branches/rice/projects/BinQ/BinQSupport.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/BinQ/BinQSupport.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -2,13 +2,15 @@
 #define BINQSUPPORT_H
 #include "rose.h"
 
+SgAsmExpressionPtrList& getOperands(SgAsmInstruction* insn);
 
+
 class BinQSupport
 {
   public:
   BinQSupport(){};
     ~BinQSupport();
-    SgNode* disassembleFile(std::string tsv_directory);
+    SgNode* disassembleFile(std::string tsv_directory, std::string& sourceFile);
     std::string normalizeInstructionsToHTML(std::vector<SgAsmx86Instruction*>::iterator beg, 
 					    std::vector<SgAsmx86Instruction*>::iterator end);
 
@@ -17,7 +19,7 @@
 
   private:
     std::string relativePathPrefix;
-   
+    std::string ToUpper(std::string myString);   
 }; //class BinQGUI
 
 #endif

Copied: branches/rice/projects/BinQ/Clone.C (from rev 117, trunk/projects/BinQ/Clone.C)
===================================================================
--- branches/rice/projects/BinQ/Clone.C	                        (rev 0)
+++ branches/rice/projects/BinQ/Clone.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,257 @@
+#include "BinQGui.h"
+#include "BinQSupport.h"
+#include "Clone.h"
+#include <boost/algorithm/string.hpp>
+
+using namespace boost;
+using namespace std;
+using namespace qrs;
+
+
+
+
+std::string
+unparseInstrFast(SgAsmInstruction* iA)
+{
+  static std::map<SgAsmInstruction*,std::string> strMap = std::map<SgAsmInstruction*,std::string>();
+  std::map<SgAsmInstruction*,std::string>::iterator iItr =
+    strMap.find(iA);
+  std::string value = "";
+  if(iItr == strMap.end() )
+    {
+
+      // Unparse the normalized forms of the instructions
+      string mne = iA->get_mnemonic();
+      boost::to_lower(mne);
+
+      if( isSgAsmx86Instruction(iA) != NULL) 
+        normalizex86Mnemonic(mne);
+      else if( isSgAsmArmInstruction(iA) != NULL  )
+        normalizeArmMnemonic(mne);
+      
+      value += mne;
+      const SgAsmExpressionPtrList& operands = getOperands(iA);
+      // Add to total for this variant
+      // Add to total for each kind of operand
+      size_t operandCount = operands.size();
+
+      for (size_t i = 0; i < operandCount; ++i) {
+        SgAsmExpression* operand = operands[i];
+        value += (  isSgAsmRegisterReferenceExpression(operand) ? " R" : isSgAsmMemoryReferenceExpression(operand) ? " M" : " V");
+      }
+      
+      strMap[iA] = value;
+    }else
+    value = iItr->second;
+  return value;
+};
+
+
+static bool
+isEqual(SgNode* A, SgNode* B)
+{
+  if(A==NULL || B == NULL) return false;
+  SgAsmInstruction* iA = isSgAsmx86Instruction(A);
+  SgAsmInstruction* iB = isSgAsmx86Instruction(B);
+  SgAsmFunctionDeclaration* fA = isSgAsmFunctionDeclaration(A);
+  SgAsmFunctionDeclaration* fB = isSgAsmFunctionDeclaration(B);
+
+  bool isTheSame = false;
+  if(iA != NULL && iB != NULL)
+    isTheSame = unparseInstrFast(iA) == unparseInstrFast(iB) ? true : false;
+  if(fA != NULL && fB != NULL)
+    isTheSame = fA->get_name() == fB->get_name() ? true : false;
+
+  return isTheSame;
+}
+
+
+void LCSLength( scoped_array<scoped_array<size_t> >& C  ,vector_start_at_one<SgNode*>& A, vector_start_at_one<SgNode*>& B )
+{
+  int m = A.size()+1;
+  int n = B.size()+1;
+  C.reset(new scoped_array<size_t>[m]);
+
+  for (int i = 0 ; i < m; i++)
+    C[i].reset(new size_t[n]);
+
+  for (size_t i = 0 ; i <= A.size() ; i++)
+    C[i][0]=0;
+  for (size_t i = 0 ; i <= B.size() ; i++)
+    C[0][i]=0;
+
+  for (size_t i = 1 ; i <= A.size() ; i++)
+    for (size_t j = 1 ; j <= B.size() ; j++)
+      {
+	if(isEqual(A[i],B[j]))
+	  C[i][j] = C[i-1][j-1]+1;
+	else
+	  C[i][j] = C[i][j-1] > C[i-1][j] ? C[i][j-1] : C[i-1][j];
+
+      }
+
+}
+
+
+void printDiff( scoped_array<scoped_array<size_t> >& C,
+		vector_start_at_one<SgNode*>& A, vector_start_at_one<SgNode*>& B, int i, int j,
+		std::vector<pair<int,int> >& addInstr, std::vector<pair<int,int> >& minusInstr
+		)
+{
+  if(i> 0 && j > 0 && isEqual(A[i],B[j]))
+    {
+      printDiff(C,A,B,i-1,j-1,addInstr, minusInstr);
+      //print " " + X[i]
+    }else if( j > 0 && (i == 0 || C[i][j-1] >= C[i-1][j]))
+    {
+      printDiff(C,A,B,i,j-1,addInstr, minusInstr);
+      //print "+ " + B[j]
+      std::cout << "+ " << j << " " << unparseInstrFast( (SgAsmInstruction*) B[j]) <<std::endl;
+      addInstr.push_back(pair<int,int>(i,j));
+    }else  if(i > 0 && (j == 0 || C[i][j-1] < C[i-1][j]))
+    {
+      printDiff(C, A, B, i-1, j,addInstr, minusInstr);
+      //   print "- " + X[i]
+      std::cout << "- " << i << " " << unparseInstrFast((SgAsmInstruction*)A[i]) << std::endl;
+      minusInstr.push_back(pair<int,int>(i,j));
+    }
+}
+
+
+
+void
+andreasDiff() {
+  BinQGUI *instance = QROSE::cbData<BinQGUI *>();
+    // this part is to find the added and removed code (from Andreas)
+    FindInstructionsVisitor vis;
+    scoped_array<scoped_array<size_t> > C;
+    vector_start_at_one<SgNode*> insnsA;
+    AstQueryNamespace::querySubTree(instance->fileA, std::bind2nd( vis, &insnsA ));
+    vector_start_at_one<SgNode*> insnsB;
+    AstQueryNamespace::querySubTree(instance->fileB, std::bind2nd( vis, &insnsB ));
+
+    LCSLength(C,insnsA,insnsB);
+    std::vector<pair<int,int> > addInstr,minusInst;
+    printDiff(C,insnsA, insnsB,insnsA.size(),insnsB.size(),addInstr,minusInst);
+    //    cerr << " found adds on left side : " << addInstr.size() << endl;
+    //cerr << " found subbs on left side : " << minusInst.size() << endl;
+    
+    QString res = QString("Found adds:  %1.  Found subbs: %2. ")
+      .arg(addInstr.size())
+      .arg(minusInst.size());
+    instance->analysisResult->append(res);  
+
+
+
+
+
+    // doing the minus stuff
+    for (unsigned int k=0;k<minusInst.size();++k) {
+      std::pair<int,int> p = minusInst[k];
+      int a = p.first;
+      int b = p.second;
+      SgAsmInstruction* instA = isSgAsmInstruction(insnsA[a]);
+      SgAsmInstruction* instB = isSgAsmInstruction(insnsB[b]);
+#if 0
+      cerr << i << " Found MINUS in A  (a:" << a <<",b:"<<b<<") : " << endl << 
+	"     " << RoseBin_support::HexToString(instA->get_address()) << "  " <<
+	instA->get_mnemonic() <<endl <<
+	"     " << RoseBin_support::HexToString(instB->get_address()) << "  " <<
+	instB->get_mnemonic() <<endl;
+#endif
+
+      int myPosA=0;
+      int myPosB=0;
+      for(size_t i=0; i < instance->itemsFileA.size(); i++ )    {
+	SgAsmStatement* stmts = isSgAsmStatement(instance->itemsFileA[i]->statement);
+	//	ROSE_ASSERT(stmts);
+	SgAsmInstruction* inst = isSgAsmInstruction(stmts);
+	if (inst && inst->get_address()==instA->get_address()) {
+	  myPosA=instance->itemsFileA[i]->row;
+	  //  instance->itemsFileA[i]->plus=true;
+	  instance->itemsFileA[i]->bg=QColor(233,150,122);
+	  for (int j=1;j<instance->maxrows;j++)
+	    instance->codeTableWidget->setBgColor(instance->itemsFileA[i]->bg,j,i);
+	}
+      }
+      for(size_t i=0; i < instance->itemsFileB.size(); i++ )    {
+	SgNode* stmts = instance->itemsFileB[i]->statement;
+	SgAsmInstruction* inst = isSgAsmInstruction(stmts);
+	if (inst && inst->get_address()==instB->get_address()) {
+	  myPosB=instance->itemsFileB[i]->row;
+	  instance->itemsFileA[i]->bg=QColor(233,150,122);
+	  for (int j=1;j<instance->maxrows;j++)
+	    instance->codeTableWidget2->setBgColor(instance->itemsFileB[i]->bg,j,i);
+	}
+      }
+
+      QString res = QString("%1 Found MINUS in A  (a:%2,b:%3) (a:%4,b:%5)  %6 %7   %8 %9")
+	.arg(k)
+	.arg(a)
+	.arg(b)
+	.arg(myPosA)
+	.arg(myPosB)
+	.arg(QString(RoseBin_support::HexToString(instA->get_address()).c_str()))
+	.arg(QString(instA->get_mnemonic().c_str()))
+	.arg(QString(RoseBin_support::HexToString(instB->get_address()).c_str()))
+	.arg(QString(instB->get_mnemonic().c_str()));
+      instance->analysisResult->append(res);  
+
+    }
+
+
+    // doing the add stuff
+    for (unsigned int k=0;k<addInstr.size();++k) {
+      std::pair<int,int> p = addInstr[k];
+      int a = p.first;
+      int b = p.second;
+      SgAsmInstruction* instA = isSgAsmInstruction(insnsA[a]);
+      SgAsmInstruction* instB = isSgAsmInstruction(insnsB[b]);
+#if 0
+      cerr << i << " Found ADD in A  (a:" << a <<",b:"<<b<<") : " << endl << 
+	"     " << RoseBin_support::HexToString(instA->get_address()) << "  " <<
+	instA->get_mnemonic() <<endl <<
+	"     " << RoseBin_support::HexToString(instB->get_address()) << "  " <<
+	instB->get_mnemonic() <<endl;
+#endif
+
+      int myPosA=0;
+      int myPosB=0;
+      for(size_t i=0; i < instance->itemsFileA.size(); i++ )    {
+	SgAsmStatement* stmts = isSgAsmStatement(instance->itemsFileA[i]->statement);
+	//	ROSE_ASSERT(stmts);
+	SgAsmInstruction* inst = isSgAsmInstruction(stmts);
+	if (inst && inst->get_address()==instA->get_address()) {
+	  myPosA=instance->itemsFileA[i]->row;
+	  //  instance->itemsFileA[i]->plus=true;
+	  instance->itemsFileA[i]->bg=QColor(135,206,255);
+	  for (int j=1;j<instance->maxrows;j++)
+	    instance->codeTableWidget->setBgColor(instance->itemsFileA[i]->bg,j,i);
+	}
+      }
+      for(size_t i=0; i < instance->itemsFileB.size(); i++ )    {
+	SgNode* stmts = instance->itemsFileB[i]->statement;
+	SgAsmInstruction* inst = isSgAsmInstruction(stmts);
+	if (inst && inst->get_address()==instB->get_address()) {
+	  myPosB=instance->itemsFileB[i]->row;
+	  instance->itemsFileB[i]->bg=QColor(135,206,255);
+	  for (int j=1;j<instance->maxrows;j++)
+	    instance->codeTableWidget2->setBgColor(instance->itemsFileB[i]->bg,j,i);
+	}
+      }
+
+      QString res = QString("%1 Found ADD in A  (a:%2,b:%3) (a:%4,b:%5)  %6 %7   %8 %9")
+	.arg(k)
+	.arg(a)
+	.arg(b)
+	.arg(myPosA)
+	.arg(myPosB)
+	.arg(QString(RoseBin_support::HexToString(instA->get_address()).c_str()))
+	.arg(QString(instA->get_mnemonic().c_str()))
+	.arg(QString(RoseBin_support::HexToString(instB->get_address()).c_str()))
+	.arg(QString(instB->get_mnemonic().c_str()));
+      instance->analysisResult->append(res);  
+
+    }
+
+}

Copied: branches/rice/projects/BinQ/Clone.h (from rev 117, trunk/projects/BinQ/Clone.h)
===================================================================
--- branches/rice/projects/BinQ/Clone.h	                        (rev 0)
+++ branches/rice/projects/BinQ/Clone.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,45 @@
+#ifndef CLONE_R_H
+#define CLONE_R_H
+#include "rose.h"
+
+#include <boost/smart_ptr.hpp>
+
+#include <iostream>
+#include <list>
+
+
+template <typename T>
+class vector_start_at_one {
+  std::vector<T> sa;
+  size_t theSize;
+
+ public:
+  vector_start_at_one(): sa(), theSize(0) {}
+
+  size_t size() const {return sa.size();}
+  T* get() const {return sa.get();}
+
+  void push_back(T v){ sa.push_back(v); }
+  T& operator[](size_t i) {return sa[i-1];}
+  const T& operator[](size_t i) const {return sa[i];}
+
+ private:
+  vector_start_at_one(const vector_start_at_one<T>&); // Not copyable
+};
+
+
+std::string
+unparseInstrFast(SgAsmInstruction* iA);
+
+static bool
+isEqual(SgNode* A, SgNode* B);
+
+void LCSLength( boost::scoped_array<boost::scoped_array<size_t> >& C  ,vector_start_at_one<SgNode*>& A, vector_start_at_one<SgNode*>& B );
+
+void printDiff( boost::scoped_array<boost::scoped_array<size_t> >& C,
+		vector_start_at_one<SgNode*>& A, vector_start_at_one<SgNode*>& B, int i, int j,
+		std::vector<std::pair<int,int> >& addInstr, std::vector<std::pair<int,int> >& minusInstr
+		);
+
+
+#endif

Copied: branches/rice/projects/BinQ/Item.h (from rev 117, trunk/projects/BinQ/Item.h)
===================================================================
--- branches/rice/projects/BinQ/Item.h	                        (rev 0)
+++ branches/rice/projects/BinQ/Item.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,35 @@
+#ifndef ITEM_R_H
+#define ITEM_R_H
+#include "rose.h"
+
+class Item {
+ public:
+  Item(bool function, SgNode* statement,
+       int functionSize, int resolved, int row, int length, int pos,
+       std::string comment, int lineNr):function(function),
+    statement(statement),functionSize(functionSize),
+    resolved(resolved),row(row),length(length),pos(pos),comment(comment),lineNr(lineNr){
+    fg = QColor(128,128,128);
+    bg = QColor(128,128,128);
+}
+
+  bool function;
+  SgNode* statement;
+  int functionSize;
+  int resolved;
+  int row;
+  
+  int length;
+  int pos;
+  std::string comment;
+  int lineNr;
+  // is this a added or removed instruction (clone detection)
+
+  QColor bg;
+  QColor fg;
+
+};
+
+
+
+#endif

Modified: branches/rice/projects/BinQ/Makefile.am
===================================================================
--- branches/rice/projects/BinQ/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/BinQ/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -8,31 +8,42 @@
 
 BinQ_SOURCES = \
 	BinQMain.C \
-        BinQGui.C \
-	BinQSupport.C
+	BinQSupport.C \
+	BinQGui.C \
+	slide.C \
+	Clone.C \
+	AlignFunctions.C \
+	AlignFunctionsSmart.C
 
-      
+
+
 BinQ_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) -lrt
 
 INCLUDES = $(ROSE_INCLUDES) $(BOOST_CPPFLAGS) -I.
 
 
 check-local:
+	./BinQ --fileA $(srcdir)/buffer2.bin --fileB $(srcdir)/buffer2b.bin --test 
+	./BinQ --fileA $(srcdir)/buffer2.bin --fileB $(srcdir)/buffer2-tsv --test 
+	./BinQ --fileA $(srcdir)/buffer2.bin --fileB $(srcdir)/buffer2.c --test 
 	@echo "************************************************************************************"
 	@echo "*** ROSE/projects/AstEquivalence: make check rule complete (terminated normally) ***"
 	@echo "************************************************************************************"
 
+
 CLEANFILES = 
 
 
 clean:
-	rm -f *.o BinQ
+	rm -f *.o BinQ *.s
 
 endif
 
 EXTRA_DIST = BinQGui.h \
              BinQSupport.h \
+             slide.h \
              disks.xpm  \
              folder.xpm \
-             icons.h
-
+             icons.h \
+             Item.h \
+             Clone.h

Copied: branches/rice/projects/BinQ/slide.C (from rev 117, trunk/projects/BinQ/slide.C)
===================================================================
--- branches/rice/projects/BinQ/slide.C	                        (rev 0)
+++ branches/rice/projects/BinQ/slide.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,196 @@
+#include "rose.h"
+#include <QPainter>
+#include <QMouseEvent>
+#include "slide.h"
+
+using namespace Qt;
+using namespace std;
+
+Slide::Slide(BinQGUI* g,
+	     QWidget *parent)
+  //  : QWidget(parent)
+{
+  lastStringA=QString("  ");
+  lastRowA=-1;
+  lastStringB=QString("  ");
+  lastRowB=-1;
+  gui = g;
+  setPalette(QPalette(QColor(250, 250, 250)));
+  setAutoFillBackground(true);
+  posX=0;
+  posY=0;
+}
+
+void
+Slide::colorize() {
+  ROSE_ASSERT(gui);
+  update();
+}
+
+void Slide::paintEvent(QPaintEvent * /* event */)
+{
+  QPainter painter(this);
+  painter.setPen(Qt::NoPen);
+  ROSE_ASSERT(gui);
+  std::vector<Item*> ite = gui->itemsFileA;
+  std::vector<Item*>::const_iterator it=gui->itemsFileA.begin();
+  int pos=0;
+  for (;it!=gui->itemsFileA.end();++it) {
+    Item* item = *it;
+    if (item) {
+    int pos = item->pos;
+    int length=item->length;
+    int color = item->resolved;
+    if (color==0)   painter.setBrush(Qt::black);
+    if (color==1)   painter.setBrush(Qt::blue);
+    if (color==2)   painter.setBrush(Qt::green);
+    if (color==3)   painter.setBrush(Qt::red);
+    if (color==4)   painter.setBrush(Qt::gray);
+    painter.drawRect(QRect(pos, 0, length, 15));
+    }
+  }
+
+  ite = gui->itemsFileB;
+  it=gui->itemsFileB.begin();
+  pos=0;
+  for (;it!=gui->itemsFileB.end();++it) {
+    Item* item = *it;
+    if (item) {
+    int pos = item->pos;
+    int length=item->length;
+    int color = item->resolved;
+    if (color==0)   painter.setBrush(Qt::black);
+    if (color==1)   painter.setBrush(Qt::blue);
+    if (color==2)   painter.setBrush(Qt::green);
+    if (color==3)   painter.setBrush(Qt::red);
+    if (color==4)   painter.setBrush(Qt::gray);
+    painter.drawRect(QRect(pos, 15, length, 15));
+    }
+  }
+
+  painter.setPen(Qt::white);
+  painter.setBrush(Qt::NoBrush);
+  painter.drawRect(QRect(posX, 0, (1), 30));
+
+}
+
+
+void Slide::mouseMoveEvent( QMouseEvent *mevt )
+{
+  posX=mevt->pos().x();
+  posY=mevt->pos().y();
+  int selected = posX;
+  Item* item = gui->byteItemFileA[selected];
+  Item* item2 = gui->byteItemFileB[selected];
+
+
+  if (item) {
+    SgAsmStatement* stmt=isSgAsmStatement(item->statement);
+    if (stmt) {
+      if (isSgAsmFunctionDeclaration(stmt)) {
+	QString res = QString("FILE_A: selected Function  %1    pos:%2")
+	  .arg(isSgAsmFunctionDeclaration(stmt)->get_name().c_str())
+	  .arg(selected);
+	if (lastStringA!=res) {
+	  lastStringA = res;
+	  gui->analysisResult->append(res);
+	}
+      } else if (isSgAsmBlock(stmt)) {
+	QString res = QString("FILE_A: selected Block");
+	if (lastStringA!=res) {
+	  lastStringA = res;
+	  gui->analysisResult->append(res);
+	}
+      } else if (isSgAsmInstruction(stmt)) {
+	//cerr << " selected Byte: " << isSgAsmInstruction(stmt)->get_mnemonic() << endl;
+	QString res = QString("FILE_A: selected Byte  %1: %2  size %3  pos: %4")
+	  .arg(RoseBin_support::HexToString((isSgAsmx86Instruction(stmt))->get_address()).c_str() )
+	  .arg(	unparseInstruction(isSgAsmInstruction(stmt)).c_str())
+	  .arg(isSgAsmInstruction(stmt)->get_raw_bytes().size())
+	  .arg(selected);
+	if (lastStringA!=res) {
+	  lastStringA = res;
+	  gui->analysisResult->append(res);
+	  int row = item->row;
+	  //cerr << "Selected row: " << row << "   lastRowA:" << lastRowA << endl;
+	  if (row>=0) {
+	    if (lastRowA!=row) {
+	      gui->unhighlightInstructionRow(lastRowA, true);
+	      gui->highlightInstructionRow(row, true);
+	      lastRowA=row;
+	    }
+	  }
+	}
+      } // if
+    } //if stmt
+  }
+
+  if (item2) {
+    SgNode* stmt=item2->statement;
+    if (stmt) {
+      if (isSgAsmFunctionDeclaration(stmt)) {
+	QString res = QString("FILE_B: selected Function  %1    pos:%2")
+	  .arg(isSgAsmFunctionDeclaration(stmt)->get_name().c_str())
+	  .arg(selected);
+	if (lastStringB!=res) {
+	  lastStringB = res;
+	  gui->analysisResult->append(res);
+	}
+      } else if (isSgAsmBlock(stmt)) {
+	QString res = QString("FILE_B: selected Block");
+	if (lastStringB!=res) {
+	  lastStringB = res;
+	  gui->analysisResult->append(res);
+	}
+      } else if (isSgFunctionDeclaration(stmt)) {
+	QString res = QString("FILE_B: Func selected");
+	if (lastStringB!=res) {
+	  lastStringB = res;
+	  gui->analysisResult->append(res);
+	}
+      } else if (isSgStatement(stmt)) {
+	//	cerr << " selected statement!! " << endl;
+	QString res = QString("FILE_B: selected Byte  %1: %2  size %3  pos: %4")
+	  .arg(QString(" ") )
+	  .arg(	isSgStatement(stmt)->class_name().c_str())
+	  .arg(QString(" "))
+	  .arg(selected);
+	if (lastStringB!=res) {
+	  lastStringB = res;
+	  gui->analysisResult->append(res);
+	  int row = item2->row;
+	  //cerr << "Selected row: " << row << "   lastRowB:" << lastRowB << endl;
+	  if (row>=0) {
+	    if (lastRowB!=row) {
+	      gui->unhighlightInstructionRow(lastRowB, false);
+	      gui->highlightInstructionRow(row, false);
+	      lastRowB=row;
+	    }
+	  }
+	}
+      }else if (isSgAsmInstruction(stmt)) {
+	//cerr << " selected Byte: " << isSgAsmInstruction(stmt)->get_mnemonic() << endl;
+	QString res = QString("FILE_B: selected Byte  %1: %2  size %3  pos: %4")
+	  .arg(RoseBin_support::HexToString((isSgAsmx86Instruction(stmt))->get_address()).c_str() )
+	  .arg(	unparseInstruction(isSgAsmInstruction(stmt)).c_str())
+	  .arg(isSgAsmInstruction(stmt)->get_raw_bytes().size())
+	  .arg(selected);
+	if (lastStringB!=res) {
+	  lastStringB = res;
+	  gui->analysisResult->append(res);
+	  int row = item2->row;
+	  //cerr << "Selected row: " << row << "   lastRowB:" << lastRowB << endl;
+	  if (row>=0) {
+	    if (lastRowB!=row) {
+	      gui->unhighlightInstructionRow(lastRowB, false);
+	      gui->highlightInstructionRow(row, false);
+	      lastRowB=row;
+	    }
+	  }
+	}
+      } // if
+    } //if stmt
+  }
+
+  update();
+}

Copied: branches/rice/projects/BinQ/slide.h (from rev 117, trunk/projects/BinQ/slide.h)
===================================================================
--- branches/rice/projects/BinQ/slide.h	                        (rev 0)
+++ branches/rice/projects/BinQ/slide.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,34 @@
+#ifndef CANNONFIELD_H
+#define CANNONFIELD_H
+
+#include "rose.h"
+#include <QWidget>
+
+#include "Item.h"
+#include "BinQGui.h"
+//class BinQGUI;
+
+class Slide : public QWidget
+{
+  //     Q_OBJECT
+
+ public:
+  Slide(BinQGUI* gui, QWidget *parent = 0);
+  void colorize();
+
+ protected:
+  void paintEvent(QPaintEvent *event);
+  void mouseMoveEvent( QMouseEvent *mevt );
+
+  
+ private:
+  int posX;
+  int posY;
+  BinQGUI* gui;
+  QString lastStringA;
+  int lastRowA;
+  QString lastStringB;
+  int lastRowB;
+};
+
+#endif

Modified: branches/rice/projects/BinaryCloneDetection/gui/binaryCloneGui.C
===================================================================
--- branches/rice/projects/BinaryCloneDetection/gui/binaryCloneGui.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/BinaryCloneDetection/gui/binaryCloneGui.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -534,25 +534,8 @@
   return std::pair<std::string,std::string>(line,offset);
 }  ;
 
-class FindInstructionsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmx86Instruction *>* , void* >
-{
-  public:
-    void* operator()(first_argument_type node, std::vector<SgAsmx86Instruction*>* insns ) const{
-      if (isSgAsmx86Instruction(node)) insns->push_back(isSgAsmx86Instruction(node));
-      return NULL;
-    }
-};
 
-class FindAsmFunctionsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmFunctionDeclaration *>* , void* >
-{
-  public:
-    void* operator()(first_argument_type node, std::vector<SgAsmFunctionDeclaration*>* insns ) const{
-      if (isSgAsmFunctionDeclaration(node)) insns->push_back(isSgAsmFunctionDeclaration(node));
-      return NULL;
-    }
-};
 
-
 enum ExpressionCategory {ec_reg = 0, ec_mem = 1, ec_val = 2};
 
 static const size_t numberOfInstructionKinds = x86_last_instruction;

Modified: branches/rice/projects/Makefile.am
===================================================================
--- branches/rice/projects/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -3,6 +3,7 @@
 # Add Projects that are associated with capabilities that belong to ROSE here
 SUBDIRS = \
      AstEquivalence \
+     autoParallelization \
      BinQ \
      compass \
      BinaryCloneDetection \
@@ -28,10 +29,8 @@
      runtimeErrorCheck \
      bugSeeding \
      binaryVisualization \
-     UpcTranslation \
-     OpenMP_Parser
+     UpcTranslation
 
-
 #AS(3/12/2008) the  NameConsistancyChecker is now part of compass
 #     NameConsistancyChecker 
 

Copied: branches/rice/projects/autoParallelization (from rev 117, trunk/projects/autoParallelization)

Deleted: branches/rice/projects/autoParallelization/Makefile.am
===================================================================
--- trunk/projects/autoParallelization/Makefile.am	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,18 +0,0 @@
-include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs
-
-# . is necessary to ensure building the translator before building the tests
-SUBDIRS = . tests
-
-INCLUDES = $(ROSE_INCLUDES) 
-
-bin_PROGRAMS = autoPar
-
-autoPar_SOURCES = autoPar.C
-
-LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) 
-
-EXTRA_DIST = README makefile.external
-
-clean-local:
-	rm -rf autoPar
-

Copied: branches/rice/projects/autoParallelization/Makefile.am (from rev 117, trunk/projects/autoParallelization/Makefile.am)
===================================================================
--- branches/rice/projects/autoParallelization/Makefile.am	                        (rev 0)
+++ branches/rice/projects/autoParallelization/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,18 @@
+include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs
+
+# . is necessary to ensure building the translator before building the tests
+SUBDIRS = . tests
+
+INCLUDES = $(ROSE_INCLUDES) 
+
+bin_PROGRAMS = autoPar
+
+autoPar_SOURCES = autoPar.C
+
+LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) 
+
+EXTRA_DIST = README makefile.external
+
+clean-local:
+	rm -rf autoPar
+

Deleted: branches/rice/projects/autoParallelization/README
===================================================================
--- trunk/projects/autoParallelization/README	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/README	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,4 +0,0 @@
-A project to automatically insert OpenMP directives based on
-* dependence analysis
-* liveness analysis
-* source code annotation

Copied: branches/rice/projects/autoParallelization/README (from rev 117, trunk/projects/autoParallelization/README)
===================================================================
--- branches/rice/projects/autoParallelization/README	                        (rev 0)
+++ branches/rice/projects/autoParallelization/README	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,4 @@
+A project to automatically insert OpenMP directives based on
+* dependence analysis
+* liveness analysis
+* source code annotation

Deleted: branches/rice/projects/autoParallelization/autoPar.C
===================================================================
--- trunk/projects/autoParallelization/autoPar.C	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/autoPar.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,254 +0,0 @@
-/*
- * Automatic Parallelization using OpenMP 
- *
- * Input: sequential C/C++ code
- * Output: parallelized C/C++ code using OpenMP
- *
- * Algorithm:
- *   for all loops
- *     x. Conduct loop normalization
- *     x. Call dependence analysis from Qing's loop transformations
- *     x. Conduct liveness analysis and variable classification
- *     x. Judge if the loop is parallelizable
- *     x. Attach OmpAttribute if it is
- *     x. Insert OpenMP pragma accordingly
- *
- * By Chunhua Liao
- * Nov 3, 2008
- */
-#include "rose.h"
-#include "OmpAttribute.h"
-#include "CommandOptions.h"
-#include <vector>
-#include <string>
-#include <iostream>
-
-//-- dependence graph headers-----
-#include <AstInterface_ROSE.h>
-#include <LoopTransformInterface.h>
-#include <AnnotCollect.h>
-#include <OperatorAnnotation.h>
-//#include <DepCompTransform.h>
-#include <LoopTreeDepComp.h>
-
-using namespace std;
-// new attribute support for 3.0 specification
-using namespace OmpSupport;
-using namespace SageInterface;
-
-int
-main (int argc, char *argv[])
-{
-  SgProject *project = frontend (argc, argv);
-  ROSE_ASSERT (project != NULL);
-
-#if 0  // We call the internal interface directly right now
-  // Transparently make up options necessary to control loop transformations
-  //  Only invoke dependence analysis, nothing further.
-  vector<string> argvList (argv, argv + argc);
-  argvList.push_back("-depAnalOnly");
-  argvList.push_back("-debugdep");
-  argvList.push_back("-debugloop");
-  CmdOptions::GetInstance()->SetOptions(argvList);
-#endif
-
-  // TODO refactoring to a function for dependence analysis
-  // Preparation for loop transformation interface
-  OperatorSideEffectAnnotation *funcInfo =  OperatorSideEffectAnnotation::get_inst();
-  funcInfo->register_annot();
-  ReadAnnotation::get_inst()->read();
-  AssumeNoAlias aliasInfo;
-
-  // For each source file in the project
-    SgFilePtrList & ptr_list = project->get_fileList();
-    for (SgFilePtrList::iterator iter = ptr_list.begin(); iter!=ptr_list.end();
-        iter++)
-   {
-     SgFile* sageFile = (*iter);
-     SgSourceFile * sfile = isSgSourceFile(sageFile);
-     ROSE_ASSERT(sfile);
-     SgGlobal *root = sfile->get_globalScope();
-     SgDeclarationStatementPtrList& declList = root->get_declarations ();
-     bool hasOpenMP= false; // flag to indicate if omp.h is needed
-
-    //For each function body in the file
-     for (SgDeclarationStatementPtrList::iterator p = declList.begin(); p != declList.end(); ++p) 
-     {
-        SgFunctionDeclaration *func = isSgFunctionDeclaration(*p);
-        if (func == 0)  continue;
-        SgFunctionDefinition *defn = func->get_definition();
-        if (defn == 0)  continue;
-        SgBasicBlock *body = defn->get_body();  
-
-        // For each loop (For-loop for now)
-        Rose_STL_Container<SgNode*> loops = NodeQuery::querySubTree(defn,V_SgForStatement); 
-        if (loops.size()==0) continue;
-        
-  // Invoke loop transformation, dependence analysis only
-   
-        // 1. Loop normalization changes the original code, 
-        // may not be desired for s2s translation
-        // Loop normalization, starting from the parent BB  is fine
-        // Bridge pattern:  interface -- implementation grow independently
-        // Implementation side: attach to AST function body
-        AstInterfaceImpl faImpl_0 = AstInterfaceImpl(body);
-        // Build AST abstraction side, a reference to the implementation 
-        AstInterface fa_0(&faImpl_0);
-        NormalizeForLoop(fa_0, AstNodePtrImpl(body));
-        
-        //TODO working on first loop, how to get all first level loops?
-        // Prepare AstInterface: implementation and head pointer
-        AstInterfaceImpl faImpl = AstInterfaceImpl(loops[0]);
-        AstInterface fa(&faImpl);
-        AstNodePtr head = AstNodePtrImpl(loops[0]);
-        //AstNodePtr head = AstNodePtrImpl(body);
-        fa.SetRoot(head);
-#if 0
-       // Call BuildAstTreeDepGraph::ProcessLoop directly?
-         
-#endif        
-        //2.  Call dependence analysis directly on a loop node
-        LoopTransformInterface la (fa,aliasInfo,funcInfo); 
-        LoopTreeDepCompCreate comp(la,head);
-
-        // Retrieve dependence graph here!
-        cout<<"Dump the dependence graph for the loop in question:"<<endl; 
-        comp.DumpDep();
-        //LoopTreeNodeDepMap depmap = comp.GetTreeNodeMap();
-       
-       // Get the loop hierarchy :grab just a top one for now
-       // TODO consider complex loop nests like loop {loop, loop} and loop{loop {loop}}
-       LoopTreeNode * loop_root = comp.GetLoopTreeRoot();
-       ROSE_ASSERT(loop_root!=NULL);
-       //loop_root->Dump();
-
-       LoopTreeTraverseSelectLoop loop_nodes(loop_root, LoopTreeTraverse::PreOrder);
-       LoopTreeNode * cur_loop = loop_nodes.Current();
-
-       // three-level loop: i,j,k
-       AstNodePtr ast_ptr;
-       if (cur_loop)
-       {  
-         //cur_loop->Dump();
-         //loop_nodes.Advance();
-         //loop_nodes.Current()->Dump();
-         //loop_nodes.Advance();
-         //loop_nodes.Current()->Dump();
-         ast_ptr = cur_loop->GetOrigStmt2();
-        // cout<<AstToString(ast_ptr)<<endl;
-       }
-       else
-       {
-         ROSE_ASSERT(false);  
-       }
-
-       ROSE_ASSERT(ast_ptr!=NULL);
-       SgNode* sg_node = AstNodePtr2Sage(ast_ptr);
-       ROSE_ASSERT(sg_node);
-      // cout<<"-------------Dump the loops in question------------"<<endl; 
-      //   cout<<sg_node->class_name()<<endl;
-
-       //3. Judge if loops are parallelizable
-       // Algorithm, for each depInfo, 
-       //   commonlevel >=0, depInfo is within a loop
-       // simplest one first: 1 level loop only, 
-       // iterate dependence edges, 
-       // check if there is loop carried dependence at all 
-       // (Carry level ==0 for top level common loops)
-       bool isParallelizable = true;
-
-       vector<DepInfo>  remainingDependences;
-
-        LoopTreeDepGraph * depgraph =  comp.GetDepGraph(); 
-        LoopTreeDepGraph::NodeIterator nodes = depgraph->GetNodeIterator();
-        for (; !nodes.ReachEnd(); ++ nodes)
-        {
-          LoopTreeDepGraph::Node* curnode = *nodes;
-          LoopTreeDepGraph::EdgeIterator edges = depgraph->GetNodeEdgeIterator(curnode, GraphAccess::EdgeOut);
-          if (!edges.ReachEnd())
-          {
-             for (; !edges.ReachEnd(); ++edges)
-             { 
-               LoopTreeDepGraph::Edge *e= *edges;
-              // cout<<"dependence edge: "<<e->toString()<<endl;
-               DepInfo info =e->GetInfo();
-             
-               // eliminate dependence relationship if
-               // the variables are thread-local: (within the scope of the loop's scope)
-               SgScopeStatement * currentscope= getScope(sg_node);  
-               SgScopeStatement* varscope =NULL;
-               SgNode* src_node = AstNodePtr2Sage(info.SrcRef());
-               if (src_node)
-               {
-                 SgVarRefExp* var_ref = isSgVarRefExp(src_node);
-                 if (var_ref)
-                 {  
-                   varscope= var_ref->get_symbol()->get_scope();
-                   if (isAncestor(currentscope,varscope))
-                     continue;
-                 } //end if(var_ref)
-               } // end if (src_node)
-
-                // skip non loop carried dependencies: 
-                // TODO scalar issue, wrong CarryLevel
-                // loop independent dependencies: need privatization can eliminate most of them
-               if (info.CarryLevel()!=0) 
-                 continue;
-                
-               remainingDependences.push_back(info); 
-             } //end iterator edges for a node
-          } // end if 
-        } // end of iterate dependence graph 
-
-      //TODO liveness analysis to classify variables and further eliminate dependences
-      
-      // Set to unparallelizable if it has dependences which can not eliminated
-      if (remainingDependences.size()>0) isParallelizable = false;
-
-       comp.DetachDepGraph();// release resources here
-      //4.  Attach OmpAttribute to the loop node if it is parallelizable 
-       if (isParallelizable)
-       {  
-          // TODO add variable classification to set private,shared variables 
-          OmpAttribute* omp_attribute = buildOmpAttribute(e_parallel_for,sg_node);
-          addOmpAttribute(omp_attribute,sg_node);
-          hasOpenMP = true;
-        } 
-        else
-        {
-          cout<<"\n Unparallelizable loop at line:"<<sg_node->get_file_info()->get_line()<<
-               " due to the following dependencies:"<<endl;
-          for (vector<DepInfo>::iterator iter= remainingDependences.begin();     
-               iter != remainingDependences.end(); iter ++ )
-          {
-            cout<<(*iter).toString()<<endl;
-          }
-
-        } // end if 
-
-        // 5. Generate and insert #pragma omp parallel for 
-        // This phase is deliberately separated from buildOmpAttribute()
-        OmpAttribute* att = getOmpAttribute(sg_node); 
-        if(att)
-        {  
-            cout<<"\n Parallelizing a loop at line:"
-              <<sg_node->get_file_info()->get_line()<<endl;
-            string pragma_str= att->toOpenMPString();
-            SgPragmaDeclaration * pragma = SageBuilder::buildPragmaDeclaration(pragma_str); 
-            SageInterface::insertStatementBefore(isSgStatement(sg_node), pragma);
-        } // end inserting #pragma   
-
-     } // end for-loop for declarations
-     // insert omp.h if OpenMP directives have been inserted into the current file 
-     if (hasOpenMP)
-       SageInterface::insertHeader("omp.h",false,root);
-   } //end for-loop of files
-
-  // Qing's loop normalization is not robust enough to pass all tests
-  //AstTests::runAllTests(project);
-  
-  //we only unparse it to avoid -I path/to/omp.h
-   project->unparse();
-  //return backend (project);
-  return 0;
-}

Copied: branches/rice/projects/autoParallelization/autoPar.C (from rev 117, trunk/projects/autoParallelization/autoPar.C)
===================================================================
--- branches/rice/projects/autoParallelization/autoPar.C	                        (rev 0)
+++ branches/rice/projects/autoParallelization/autoPar.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,254 @@
+/*
+ * Automatic Parallelization using OpenMP 
+ *
+ * Input: sequential C/C++ code
+ * Output: parallelized C/C++ code using OpenMP
+ *
+ * Algorithm:
+ *   for all loops
+ *     x. Conduct loop normalization
+ *     x. Call dependence analysis from Qing's loop transformations
+ *     x. Conduct liveness analysis and variable classification
+ *     x. Judge if the loop is parallelizable
+ *     x. Attach OmpAttribute if it is
+ *     x. Insert OpenMP pragma accordingly
+ *
+ * By Chunhua Liao
+ * Nov 3, 2008
+ */
+#include "rose.h"
+#include "OmpAttribute.h"
+#include "CommandOptions.h"
+#include <vector>
+#include <string>
+#include <iostream>
+
+//-- dependence graph headers-----
+#include <AstInterface_ROSE.h>
+#include <LoopTransformInterface.h>
+#include <AnnotCollect.h>
+#include <OperatorAnnotation.h>
+//#include <DepCompTransform.h>
+#include <LoopTreeDepComp.h>
+
+using namespace std;
+// new attribute support for 3.0 specification
+using namespace OmpSupport;
+using namespace SageInterface;
+
+int
+main (int argc, char *argv[])
+{
+  SgProject *project = frontend (argc, argv);
+  ROSE_ASSERT (project != NULL);
+
+#if 0  // We call the internal interface directly right now
+  // Transparently make up options necessary to control loop transformations
+  //  Only invoke dependence analysis, nothing further.
+  vector<string> argvList (argv, argv + argc);
+  argvList.push_back("-depAnalOnly");
+  argvList.push_back("-debugdep");
+  argvList.push_back("-debugloop");
+  CmdOptions::GetInstance()->SetOptions(argvList);
+#endif
+
+  // TODO refactoring to a function for dependence analysis
+  // Preparation for loop transformation interface
+  OperatorSideEffectAnnotation *funcInfo =  OperatorSideEffectAnnotation::get_inst();
+  funcInfo->register_annot();
+  ReadAnnotation::get_inst()->read();
+  AssumeNoAlias aliasInfo;
+
+  // For each source file in the project
+    SgFilePtrList & ptr_list = project->get_fileList();
+    for (SgFilePtrList::iterator iter = ptr_list.begin(); iter!=ptr_list.end();
+        iter++)
+   {
+     SgFile* sageFile = (*iter);
+     SgSourceFile * sfile = isSgSourceFile(sageFile);
+     ROSE_ASSERT(sfile);
+     SgGlobal *root = sfile->get_globalScope();
+     SgDeclarationStatementPtrList& declList = root->get_declarations ();
+     bool hasOpenMP= false; // flag to indicate if omp.h is needed
+
+    //For each function body in the file
+     for (SgDeclarationStatementPtrList::iterator p = declList.begin(); p != declList.end(); ++p) 
+     {
+        SgFunctionDeclaration *func = isSgFunctionDeclaration(*p);
+        if (func == 0)  continue;
+        SgFunctionDefinition *defn = func->get_definition();
+        if (defn == 0)  continue;
+        SgBasicBlock *body = defn->get_body();  
+
+        // For each loop (For-loop for now)
+        Rose_STL_Container<SgNode*> loops = NodeQuery::querySubTree(defn,V_SgForStatement); 
+        if (loops.size()==0) continue;
+        
+  // Invoke loop transformation, dependence analysis only
+   
+        // 1. Loop normalization changes the original code, 
+        // may not be desired for s2s translation
+        // Loop normalization, starting from the parent BB  is fine
+        // Bridge pattern:  interface -- implementation grow independently
+        // Implementation side: attach to AST function body
+        AstInterfaceImpl faImpl_0 = AstInterfaceImpl(body);
+        // Build AST abstraction side, a reference to the implementation 
+        AstInterface fa_0(&faImpl_0);
+        NormalizeForLoop(fa_0, AstNodePtrImpl(body));
+        
+        //TODO working on first loop, how to get all first level loops?
+        // Prepare AstInterface: implementation and head pointer
+        AstInterfaceImpl faImpl = AstInterfaceImpl(loops[0]);
+        AstInterface fa(&faImpl);
+        AstNodePtr head = AstNodePtrImpl(loops[0]);
+        //AstNodePtr head = AstNodePtrImpl(body);
+        fa.SetRoot(head);
+#if 0
+       // Call BuildAstTreeDepGraph::ProcessLoop directly?
+         
+#endif        
+        //2.  Call dependence analysis directly on a loop node
+        LoopTransformInterface la (fa,aliasInfo,funcInfo); 
+        LoopTreeDepCompCreate comp(la,head);
+
+        // Retrieve dependence graph here!
+        cout<<"Dump the dependence graph for the loop in question:"<<endl; 
+        comp.DumpDep();
+        //LoopTreeNodeDepMap depmap = comp.GetTreeNodeMap();
+       
+       // Get the loop hierarchy :grab just a top one for now
+       // TODO consider complex loop nests like loop {loop, loop} and loop{loop {loop}}
+       LoopTreeNode * loop_root = comp.GetLoopTreeRoot();
+       ROSE_ASSERT(loop_root!=NULL);
+       //loop_root->Dump();
+
+       LoopTreeTraverseSelectLoop loop_nodes(loop_root, LoopTreeTraverse::PreOrder);
+       LoopTreeNode * cur_loop = loop_nodes.Current();
+
+       // three-level loop: i,j,k
+       AstNodePtr ast_ptr;
+       if (cur_loop)
+       {  
+         //cur_loop->Dump();
+         //loop_nodes.Advance();
+         //loop_nodes.Current()->Dump();
+         //loop_nodes.Advance();
+         //loop_nodes.Current()->Dump();
+         ast_ptr = cur_loop->GetOrigStmt2();
+        // cout<<AstToString(ast_ptr)<<endl;
+       }
+       else
+       {
+         ROSE_ASSERT(false);  
+       }
+
+       ROSE_ASSERT(ast_ptr!=NULL);
+       SgNode* sg_node = AstNodePtr2Sage(ast_ptr);
+       ROSE_ASSERT(sg_node);
+      // cout<<"-------------Dump the loops in question------------"<<endl; 
+      //   cout<<sg_node->class_name()<<endl;
+
+       //3. Judge if loops are parallelizable
+       // Algorithm, for each depInfo, 
+       //   commonlevel >=0, depInfo is within a loop
+       // simplest one first: 1 level loop only, 
+       // iterate dependence edges, 
+       // check if there is loop carried dependence at all 
+       // (Carry level ==0 for top level common loops)
+       bool isParallelizable = true;
+
+       vector<DepInfo>  remainingDependences;
+
+        LoopTreeDepGraph * depgraph =  comp.GetDepGraph(); 
+        LoopTreeDepGraph::NodeIterator nodes = depgraph->GetNodeIterator();
+        for (; !nodes.ReachEnd(); ++ nodes)
+        {
+          LoopTreeDepGraph::Node* curnode = *nodes;
+          LoopTreeDepGraph::EdgeIterator edges = depgraph->GetNodeEdgeIterator(curnode, GraphAccess::EdgeOut);
+          if (!edges.ReachEnd())
+          {
+             for (; !edges.ReachEnd(); ++edges)
+             { 
+               LoopTreeDepGraph::Edge *e= *edges;
+              // cout<<"dependence edge: "<<e->toString()<<endl;
+               DepInfo info =e->GetInfo();
+             
+               // eliminate dependence relationship if
+               // the variables are thread-local: (within the scope of the loop's scope)
+               SgScopeStatement * currentscope= getScope(sg_node);  
+               SgScopeStatement* varscope =NULL;
+               SgNode* src_node = AstNodePtr2Sage(info.SrcRef());
+               if (src_node)
+               {
+                 SgVarRefExp* var_ref = isSgVarRefExp(src_node);
+                 if (var_ref)
+                 {  
+                   varscope= var_ref->get_symbol()->get_scope();
+                   if (isAncestor(currentscope,varscope))
+                     continue;
+                 } //end if(var_ref)
+               } // end if (src_node)
+
+                // skip non loop carried dependencies: 
+                // TODO scalar issue, wrong CarryLevel
+                // loop independent dependencies: need privatization can eliminate most of them
+               if (info.CarryLevel()!=0) 
+                 continue;
+                
+               remainingDependences.push_back(info); 
+             } //end iterator edges for a node
+          } // end if 
+        } // end of iterate dependence graph 
+
+      //TODO liveness analysis to classify variables and further eliminate dependences
+      
+      // Set to unparallelizable if it has dependences which can not eliminated
+      if (remainingDependences.size()>0) isParallelizable = false;
+
+       comp.DetachDepGraph();// release resources here
+      //4.  Attach OmpAttribute to the loop node if it is parallelizable 
+       if (isParallelizable)
+       {  
+          // TODO add variable classification to set private,shared variables 
+          OmpAttribute* omp_attribute = buildOmpAttribute(e_parallel_for,sg_node);
+          addOmpAttribute(omp_attribute,sg_node);
+          hasOpenMP = true;
+        } 
+        else
+        {
+          cout<<"\n Unparallelizable loop at line:"<<sg_node->get_file_info()->get_line()<<
+               " due to the following dependencies:"<<endl;
+          for (vector<DepInfo>::iterator iter= remainingDependences.begin();     
+               iter != remainingDependences.end(); iter ++ )
+          {
+            cout<<(*iter).toString()<<endl;
+          }
+
+        } // end if 
+
+        // 5. Generate and insert #pragma omp parallel for 
+        // This phase is deliberately separated from buildOmpAttribute()
+        OmpAttribute* att = getOmpAttribute(sg_node); 
+        if(att)
+        {  
+            cout<<"\n Parallelizing a loop at line:"
+              <<sg_node->get_file_info()->get_line()<<endl;
+            string pragma_str= att->toOpenMPString();
+            SgPragmaDeclaration * pragma = SageBuilder::buildPragmaDeclaration(pragma_str); 
+            SageInterface::insertStatementBefore(isSgStatement(sg_node), pragma);
+        } // end inserting #pragma   
+
+     } // end for-loop for declarations
+     // insert omp.h if OpenMP directives have been inserted into the current file 
+     if (hasOpenMP)
+       SageInterface::insertHeader("omp.h",false,root);
+   } //end for-loop of files
+
+  // Qing's loop normalization is not robust enough to pass all tests
+  //AstTests::runAllTests(project);
+  
+  //we only unparse it to avoid -I path/to/omp.h
+   project->unparse();
+  //return backend (project);
+  return 0;
+}

Deleted: branches/rice/projects/autoParallelization/makefile.external
===================================================================
--- trunk/projects/autoParallelization/makefile.external	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/makefile.external	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,42 +0,0 @@
-# A makefile if this project is compiled outside of the ROSE source tree
-#
-#ROSE_INS = /home/liao6/daily-test-rose/20080429_040001/install
-ROSE_INS = /home/liao/daily-test-rose/20081031_082744/install
-#BOOST_ROOT=/home/liao6/opt/boost_1_35_0
-BOOST_ROOT=/home/liao/opt/boost-1.35.0
-
-SRC_FILE=main.C
-
-#INPUT_CODE=doall.c
-#INPUT_CODE=inner_only.c
-#INPUT_CODE=matrixmultiply-kernel.c
-#INPUT_CODE=doall_l2.c
-#INPUT_CODE=both_levels.c
-#INPUT_CODE=pointers.cpp
-#INPUT_CODE=reduction.c
-#INPUT_CODE=shared.c
-#INPUT_CODE=output2.c
-#INPUT_CODE=output.c
-INPUT_CODE=output3.c
-#INPUT_CODE=private.c
-#INPUT_CODE=doall_vector.C
-#INPUT_CODE=jacobi_s.c
-#INPUT_CODE=test_1.C
-
-
-CPP_FLAG=-g3 -Wall
-
-.PHONY :clean test default
-all:clean test
-default: a.out test 
-OmpAttribute.o: OmpAttribute.C OmpAttribute.h
-	g++ -c $(CPP_FLAG)  $< -I $(BOOST_ROOT)/include/boost-1_35 -I $(ROSE_INS)/include -I/usr/include/libxml2
-main.o:$(SRC_FILE)
-	g++ -c $(CPP_FLAG) $^ -I $(BOOST_ROOT)/include/boost-1_35 -I $(ROSE_INS)/include -I/usr/include/libxml2 
-a.out:main.o OmpAttribute.o
-	g++ $(CPP_FLAG) $^ -I $(BOOST_ROOT)/include/boost-1_35 -I $(ROSE_INS)/include -I/usr/include/libxml2 -L$(ROSE_INS)/lib -lrose
-
-test: a.out
-	./a.out -c  -rose:verbose 0 -g3 $(INPUT_CODE) 
-clean:
-	rm -rf a.out *.o rose_*

Copied: branches/rice/projects/autoParallelization/makefile.external (from rev 117, trunk/projects/autoParallelization/makefile.external)
===================================================================
--- branches/rice/projects/autoParallelization/makefile.external	                        (rev 0)
+++ branches/rice/projects/autoParallelization/makefile.external	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,42 @@
+# A makefile if this project is compiled outside of the ROSE source tree
+#
+#ROSE_INS = /home/liao6/daily-test-rose/20080429_040001/install
+ROSE_INS = /home/liao/daily-test-rose/20081031_082744/install
+#BOOST_ROOT=/home/liao6/opt/boost_1_35_0
+BOOST_ROOT=/home/liao/opt/boost-1.35.0
+
+SRC_FILE=main.C
+
+#INPUT_CODE=doall.c
+#INPUT_CODE=inner_only.c
+#INPUT_CODE=matrixmultiply-kernel.c
+#INPUT_CODE=doall_l2.c
+#INPUT_CODE=both_levels.c
+#INPUT_CODE=pointers.cpp
+#INPUT_CODE=reduction.c
+#INPUT_CODE=shared.c
+#INPUT_CODE=output2.c
+#INPUT_CODE=output.c
+INPUT_CODE=output3.c
+#INPUT_CODE=private.c
+#INPUT_CODE=doall_vector.C
+#INPUT_CODE=jacobi_s.c
+#INPUT_CODE=test_1.C
+
+
+CPP_FLAG=-g3 -Wall
+
+.PHONY :clean test default
+all:clean test
+default: a.out test 
+OmpAttribute.o: OmpAttribute.C OmpAttribute.h
+	g++ -c $(CPP_FLAG)  $< -I $(BOOST_ROOT)/include/boost-1_35 -I $(ROSE_INS)/include -I/usr/include/libxml2
+main.o:$(SRC_FILE)
+	g++ -c $(CPP_FLAG) $^ -I $(BOOST_ROOT)/include/boost-1_35 -I $(ROSE_INS)/include -I/usr/include/libxml2 
+a.out:main.o OmpAttribute.o
+	g++ $(CPP_FLAG) $^ -I $(BOOST_ROOT)/include/boost-1_35 -I $(ROSE_INS)/include -I/usr/include/libxml2 -L$(ROSE_INS)/lib -lrose
+
+test: a.out
+	./a.out -c  -rose:verbose 0 -g3 $(INPUT_CODE) 
+clean:
+	rm -rf a.out *.o rose_*

Copied: branches/rice/projects/autoParallelization/tests (from rev 117, trunk/projects/autoParallelization/tests)

Deleted: branches/rice/projects/autoParallelization/tests/Makefile.am
===================================================================
--- trunk/projects/autoParallelization/tests/Makefile.am	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,68 +0,0 @@
-include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs
-
-# the code which can be parallelized or confirmed as not parallelizable now
-C_TESTCODES_REQUIRED_TO_PASS = \
-anti_dep.c \
-doall.c \
-scalar_privatization.c \
-true_dep.c \
-output_dep.c
-
-CXX_TESTCODES_REQUIRED_TO_PASS = 
-
-# the code which can not yet be parallelized now
-TESTCODE_CURRENTLY_FAILING = \
-doall_2.c \
-firstprivate.c \
-inner_only.c \
-jacobi_seq.c \
-matrixmultiply.c \
-output_dep2.c \
-output_dep3.c \
-pointer.c \
-private.c \
-reduction.c \
-shared.c \
-true_dep_2.c \
-true_l2.c \
-vectorize_1.c \
-doall_vector.C \
-vector_1.C \
-vector_2.C
-
-ALL_TESTCODES = \
-$(C_TESTCODES_REQUIRED_TO_PASS) \
-$(CXX_TESTCODES_REQUIRED_TO_PASS) \
-$(TESTCODE_CURRENTLY_FAILING)
-
-# ROSE_FLAGS = -rose:C_only -rose:verbose 2 --edg:restrict
-ROSE_FLAGS = --edg:no_warnings -w -rose:C -rose:verbose 0 --edg:restrict
-
-VALGRIND_OPTIONS = --tool=memcheck -v --num-callers=30 --leak-check=no --error-limit=no --show-reachable=yes
-# VALGRIND = /usr/apps/valgrind/new/bin/valgrind $(VALGRIND_OPTIONS)
-VALGRIND =
-
-C_TEST_Objects = ${C_TESTCODES_REQUIRED_TO_PASS:.c=.o}
-CXX_TEST_Objects = ${CXX_TESTCODES_REQUIRED_TO_PASS:.C=.o}
-
-$(C_TEST_Objects): ../autoPar $(@:.o=.c)
-	$(VALGRIND) ../autoPar $(ROSE_FLAGS) -c $(srcdir)/$(@:.o=.c)
-$(CXX_TEST_Objects): ../autoPar $(@:.o=.C)
-	$(VALGRIND) ../autoPar $(ROSE_FLAGS) -c $(srcdir)/$(@:.o=.C)
-
-check-local:
-	@echo "Test for ROSE automatic parallelization."
-	@$(MAKE) $(C_TEST_Objects)
-	@$(MAKE) $(CXX_TEST_Objects)
-	@echo "***********************************************************************************************************"
-	@echo "****** ROSE/projects/autoParallelization/tests: make check rule complete (terminated normally) ******"
-	@echo "***********************************************************************************************************"
-
-EXTRA_DIST = $(ALL_TESTCODES)
-
-clean-local:
-	rm -f *.o rose_*.[cC] 
-
-	
-
-

Copied: branches/rice/projects/autoParallelization/tests/Makefile.am (from rev 117, trunk/projects/autoParallelization/tests/Makefile.am)
===================================================================
--- branches/rice/projects/autoParallelization/tests/Makefile.am	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,68 @@
+include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs
+
+# the code which can be parallelized or confirmed as not parallelizable now
+C_TESTCODES_REQUIRED_TO_PASS = \
+anti_dep.c \
+doall.c \
+scalar_privatization.c \
+true_dep.c \
+output_dep.c
+
+CXX_TESTCODES_REQUIRED_TO_PASS = 
+
+# the code which can not yet be parallelized now
+TESTCODE_CURRENTLY_FAILING = \
+doall_2.c \
+firstprivate.c \
+inner_only.c \
+jacobi_seq.c \
+matrixmultiply.c \
+output_dep2.c \
+output_dep3.c \
+pointer.c \
+private.c \
+reduction.c \
+shared.c \
+true_dep_2.c \
+true_l2.c \
+vectorize_1.c \
+doall_vector.C \
+vector_1.C \
+vector_2.C
+
+ALL_TESTCODES = \
+$(C_TESTCODES_REQUIRED_TO_PASS) \
+$(CXX_TESTCODES_REQUIRED_TO_PASS) \
+$(TESTCODE_CURRENTLY_FAILING)
+
+# ROSE_FLAGS = -rose:C_only -rose:verbose 2 --edg:restrict
+ROSE_FLAGS = --edg:no_warnings -w -rose:C -rose:verbose 0 --edg:restrict
+
+VALGRIND_OPTIONS = --tool=memcheck -v --num-callers=30 --leak-check=no --error-limit=no --show-reachable=yes
+# VALGRIND = /usr/apps/valgrind/new/bin/valgrind $(VALGRIND_OPTIONS)
+VALGRIND =
+
+C_TEST_Objects = ${C_TESTCODES_REQUIRED_TO_PASS:.c=.o}
+CXX_TEST_Objects = ${CXX_TESTCODES_REQUIRED_TO_PASS:.C=.o}
+
+$(C_TEST_Objects): ../autoPar $(@:.o=.c)
+	$(VALGRIND) ../autoPar $(ROSE_FLAGS) -c $(srcdir)/$(@:.o=.c)
+$(CXX_TEST_Objects): ../autoPar $(@:.o=.C)
+	$(VALGRIND) ../autoPar $(ROSE_FLAGS) -c $(srcdir)/$(@:.o=.C)
+
+check-local:
+	@echo "Test for ROSE automatic parallelization."
+	@$(MAKE) $(C_TEST_Objects)
+	@$(MAKE) $(CXX_TEST_Objects)
+	@echo "***********************************************************************************************************"
+	@echo "****** ROSE/projects/autoParallelization/tests: make check rule complete (terminated normally) ******"
+	@echo "***********************************************************************************************************"
+
+EXTRA_DIST = $(ALL_TESTCODES)
+
+clean-local:
+	rm -f *.o rose_*.[cC] 
+
+	
+
+

Deleted: branches/rice/projects/autoParallelization/tests/anti_dep.c
===================================================================
--- trunk/projects/autoParallelization/tests/anti_dep.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/anti_dep.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,11 +0,0 @@
-/*
- * An anti-dependence example
- */
-void foo()
-{
-  int i;
-  int a[100];
-
-  for (i=0;i<99;i++)
-    a[i]=a[i+1]+1;
-}  

Copied: branches/rice/projects/autoParallelization/tests/anti_dep.c (from rev 117, trunk/projects/autoParallelization/tests/anti_dep.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/anti_dep.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/anti_dep.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,11 @@
+/*
+ * An anti-dependence example
+ */
+void foo()
+{
+  int i;
+  int a[100];
+
+  for (i=0;i<99;i++)
+    a[i]=a[i+1]+1;
+}  

Deleted: branches/rice/projects/autoParallelization/tests/doall.c
===================================================================
--- trunk/projects/autoParallelization/tests/doall.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/doall.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,27 +0,0 @@
-void foo()
-{
-  int i, a[100];
-  for (i=0;i<100;i++) 
-    a[i]=a[i]+1;
-}  
-/*  
- *  ..= a[i]+1 // read
- *  a[i] == // write
- *  non-loop carried anti-dependence : Write-after-Read
- *
- dep SgExprStatement:a[i] =((a[i]) + 1); 
-     SgExprStatement:a[i] =((a[i]) + 1); 
-
-     1*1 ANTI_DEP; commonlevel = 1 CarryLevel = 1  Is precise 
-  SgPntrArrRefExp:(a[i])@5:11->SgPntrArrRefExp:a[i]@5:9 == 0;||::
- 
-  dependence edge: 1*1 ANTI_DEP; commonlevel = 1 CarryLevel = 1  Is precise 
-
-distance matrix: common loops surrounding two statement: 
-* common level: how many levels are shared loops?
-* carry level: loop dependence carry level: start from 0
-
-  SgPntrArrRefExp:(a[i])@5:11->SgPntrArrRefExp:a[i]@5:9 == 0;||::
-
- *
- */

Copied: branches/rice/projects/autoParallelization/tests/doall.c (from rev 117, trunk/projects/autoParallelization/tests/doall.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/doall.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/doall.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,27 @@
+void foo()
+{
+  int i, a[100];
+  for (i=0;i<100;i++) 
+    a[i]=a[i]+1;
+}  
+/*  
+ *  ..= a[i]+1 // read
+ *  a[i] == // write
+ *  non-loop carried anti-dependence : Write-after-Read
+ *
+ dep SgExprStatement:a[i] =((a[i]) + 1); 
+     SgExprStatement:a[i] =((a[i]) + 1); 
+
+     1*1 ANTI_DEP; commonlevel = 1 CarryLevel = 1  Is precise 
+  SgPntrArrRefExp:(a[i])@5:11->SgPntrArrRefExp:a[i]@5:9 == 0;||::
+ 
+  dependence edge: 1*1 ANTI_DEP; commonlevel = 1 CarryLevel = 1  Is precise 
+
+distance matrix: common loops surrounding two statement: 
+* common level: how many levels are shared loops?
+* carry level: loop dependence carry level: start from 0
+
+  SgPntrArrRefExp:(a[i])@5:11->SgPntrArrRefExp:a[i]@5:9 == 0;||::
+
+ *
+ */

Deleted: branches/rice/projects/autoParallelization/tests/doall_2.c
===================================================================
--- trunk/projects/autoParallelization/tests/doall_2.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/doall_2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,22 +0,0 @@
-int i,j;
-int a[100][100];
-
-void foo()
-{
-  for (i=0;i<100;i++)
-    for (j=0;j<100;j++)
-      a[i][j]=a[i][j]+1;
-}
-/*
- * final dependence graph:
-dep SgExprStatement:(a[i])[j] =(((a[i])[j]) + 1); 
-    SgExprStatement:(a[i])[j] =(((a[i])[j]) + 1); 
-2*2 ANTI_DEP; commonlevel = 2  +precise  CarryLevel = 2 //level =0,1,2 no loop carried dependence!!
-  SgPntrArrRefExp:((a[i])[j])
-  SgPntrArrRefExp:(a[i])[j]== 0;* 0;:* 0;== 0;:::
-
-Two accesses: distance =0, non loop-carried
-  write after read for a[i]: anti-dependence
-
- */
-

Copied: branches/rice/projects/autoParallelization/tests/doall_2.c (from rev 117, trunk/projects/autoParallelization/tests/doall_2.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/doall_2.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/doall_2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,22 @@
+int i,j;
+int a[100][100];
+
+void foo()
+{
+  for (i=0;i<100;i++)
+    for (j=0;j<100;j++)
+      a[i][j]=a[i][j]+1;
+}
+/*
+ * final dependence graph:
+dep SgExprStatement:(a[i])[j] =(((a[i])[j]) + 1); 
+    SgExprStatement:(a[i])[j] =(((a[i])[j]) + 1); 
+2*2 ANTI_DEP; commonlevel = 2  +precise  CarryLevel = 2 //level =0,1,2 no loop carried dependence!!
+  SgPntrArrRefExp:((a[i])[j])
+  SgPntrArrRefExp:(a[i])[j]== 0;* 0;:* 0;== 0;:::
+
+Two accesses: distance =0, non loop-carried
+  write after read for a[i]: anti-dependence
+
+ */
+

Deleted: branches/rice/projects/autoParallelization/tests/doall_vector.C
===================================================================
--- trunk/projects/autoParallelization/tests/doall_vector.C	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/doall_vector.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,9 +0,0 @@
-#include <vector>
-void foo ()
-{
-  int i;
-  std::vector <int> v1(100);
-//  for (i=0; i< v1.size(); i++)
-  for (i=0; i<100; i++)
-    v1[i] = v1[i] +1; 
-}

Copied: branches/rice/projects/autoParallelization/tests/doall_vector.C (from rev 117, trunk/projects/autoParallelization/tests/doall_vector.C)
===================================================================
--- branches/rice/projects/autoParallelization/tests/doall_vector.C	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/doall_vector.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,9 @@
+#include <vector>
+void foo ()
+{
+  int i;
+  std::vector <int> v1(100);
+//  for (i=0; i< v1.size(); i++)
+  for (i=0; i<100; i++)
+    v1[i] = v1[i] +1; 
+}

Deleted: branches/rice/projects/autoParallelization/tests/firstprivate.c
===================================================================
--- trunk/projects/autoParallelization/tests/firstprivate.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/firstprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,21 +0,0 @@
-/*
- * dependence graph:
- */
-void foo()
-{
-  int i,x=1;
-  int a[100];
-  int b[100];
-// x should be recognized as a firstprivate variable during parallelization
-// Does it introduce any data dependencies ?
-// could be (as regular private variables )
-  for (i=0;i<100;i++) 
-  { 
-    b[i]=x+1;
-    // x=...
-    // ... =x
-  }  
-}  
-/*
- 
- */

Copied: branches/rice/projects/autoParallelization/tests/firstprivate.c (from rev 117, trunk/projects/autoParallelization/tests/firstprivate.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/firstprivate.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/firstprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,21 @@
+/*
+ * dependence graph:
+ */
+void foo()
+{
+  int i,x=1;
+  int a[100];
+  int b[100];
+// x should be recognized as a firstprivate variable during parallelization
+// Does it introduce any data dependencies ?
+// could be (as regular private variables )
+  for (i=0;i<100;i++) 
+  { 
+    b[i]=x+1;
+    // x=...
+    // ... =x
+  }  
+}  
+/*
+ 
+ */

Deleted: branches/rice/projects/autoParallelization/tests/inner_only.c
===================================================================
--- trunk/projects/autoParallelization/tests/inner_only.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/inner_only.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,21 +0,0 @@
-/* Only the inner loop can be parallelized
- */
-void foo()
-{
-  int n=100, m=100;
-  double b[n][m];
-  int i,j;
-  for (i=0;i<n;i++)
-    for (j=0;j<m;j++)
-      b[i][j]=b[i-1][j-1];
-}
-/*
-dep 
-SgExprStatement:(b[i])[j] =((b[i - 1])[j - 1]); 
-SgExprStatement:(b[i])[j] =((b[i - 1])[j - 1]); 
-
-2*2 TRUE_DEP; commonlevel = 2 CarryLevel = 0  Is precise 
-SgPntrArrRefExp:(b[i])[j]@8:14->SgPntrArrRefExp:((b[i - 1])[j - 1])@8:21 
-== -1; * 0;  ||
-* 0  ; == -1; ||::
-*/

Copied: branches/rice/projects/autoParallelization/tests/inner_only.c (from rev 117, trunk/projects/autoParallelization/tests/inner_only.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/inner_only.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/inner_only.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,21 @@
+/* Only the inner loop can be parallelized
+ */
+void foo()
+{
+  int n=100, m=100;
+  double b[n][m];
+  int i,j;
+  for (i=0;i<n;i++)
+    for (j=0;j<m;j++)
+      b[i][j]=b[i-1][j-1];
+}
+/*
+dep 
+SgExprStatement:(b[i])[j] =((b[i - 1])[j - 1]); 
+SgExprStatement:(b[i])[j] =((b[i - 1])[j - 1]); 
+
+2*2 TRUE_DEP; commonlevel = 2 CarryLevel = 0  Is precise 
+SgPntrArrRefExp:(b[i])[j]@8:14->SgPntrArrRefExp:((b[i - 1])[j - 1])@8:21 
+== -1; * 0;  ||
+* 0  ; == -1; ||::
+*/

Deleted: branches/rice/projects/autoParallelization/tests/jacobi_seq.c
===================================================================
--- trunk/projects/autoParallelization/tests/jacobi_seq.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/jacobi_seq.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,202 +0,0 @@
-/* An example code 
- *
- * */
-#include <stdio.h>
-#include <math.h>
-
-void driver (void);
-void initialize (void);
-void jacobi (void);
-void error_check (void);
-
-#define MSIZE 200
-int n, m, mits;
-double tol, relax = 1.0, alpha = 0.0543;
-double u[MSIZE][MSIZE], f[MSIZE][MSIZE], uold[MSIZE][MSIZE];
-double dx, dy;
-
-int
-main (void)
-{
-//  float toler;
-/*      printf("Input n,m (< %d) - grid dimension in x,y direction:\n",MSIZE); 
-      scanf ("%d",&n);
-      scanf ("%d",&m);
-      printf("Input tol - error tolerance for iterative solver\n"); 
-      scanf("%f",&toler);
-      tol=(double)toler;
-      printf("Input mits - Maximum iterations for solver\n"); 
-      scanf("%d",&mits);
-*/
-  n = MSIZE;
-  m = MSIZE;
-  tol = 0.0000000001;
-  mits = 1000;
-  driver ();
-
-  return 1;
-}
-
-/*************************************************************
-* Subroutine driver () 
-* This is where the arrays are allocated and initialzed. 
-*
-* Working varaibles/arrays 
-*     dx  - grid spacing in x direction 
-*     dy  - grid spacing in y direction 
-*************************************************************/
-
-void
-driver ()
-{
-
-  initialize ();
-
-  /* Solve Helmholtz equation */
-  jacobi ();
-
-  /* error_check (n,m,alpha,dx,dy,u,f) */
-  error_check ();
-}
-
-
-/*      subroutine initialize (n,m,alpha,dx,dy,u,f) 
-******************************************************
-* Initializes data 
-* Assumes exact solution is u(x,y) = (1-x^2)*(1-y^2)
-*
-******************************************************/
-
-void
-initialize ()
-{
-
-  int i, j, xx, yy;
-//  double PI = 3.1415926;
-
-  dx = 2.0 / (n - 1); // -->dx at 112:2
-  dy = 2.0 / (m - 1);  //-->dy at 113:2
-
-/* Initialize initial condition and RHS */
-
-//#pragma omp parallel for private(i,j,xx,yy)
-  for (i = 0; i < n; i++)
-    for (j = 0; j < m; j++)
-      {
-	xx = (int) (-1.0 + dx * (i - 1));	/* -1 < x < 1 */
-	yy = (int) (-1.0 + dy * (j - 1));	/* -1 < y < 1 */
-	u[i][j] = 0.0;
-	f[i][j] = -1.0 * alpha * (1.0 - xx * xx) * (1.0 - yy * yy)
-	  - 2.0 * (1.0 - xx * xx) - 2.0 * (1.0 - yy * yy);
-
-      }
-
-}
-
-/*      subroutine jacobi (n,m,dx,dy,alpha,omega,u,f,tol,maxit)
-******************************************************************
-* Subroutine HelmholtzJ
-* Solves poisson equation on rectangular grid assuming : 
-* (1) Uniform discretization in each direction, and 
-* (2) Dirichlect boundary conditions 
-* 
-* Jacobi method is used in this routine 
-*
-* Input : n,m   Number of grid points in the X/Y directions 
-*         dx,dy Grid spacing in the X/Y directions 
-*         alpha Helmholtz eqn. coefficient 
-*         omega Relaxation factor 
-*         f(n,m) Right hand side function 
-*         u(n,m) Dependent variable/Solution
-*         tol    Tolerance for iterative solver 
-*         maxit  Maximum number of iterations 
-*
-* Output : u(n,m) - Solution 
-*****************************************************************/
-
-void
-jacobi ()
-{
-  double omega;
-  int i, j, k;
-  double error, resid,  ax, ay, b;
-
-  omega = relax;
-/*
-* Initialize coefficients */
-
-  ax = 1.0 / (dx * dx);		/* X-direction coef */
-  ay = 1.0 / (dy * dy);		/* Y-direction coef */
-  b = -2.0 / (dx * dx) - 2.0 / (dy * dy) - alpha;	/* Central coeff */
-
-  error = 10.0 * tol;
-  k = 1;
-
-//  while ((k <= mits) && (error > tol))
-//  Qing's dependence analysis cannot handle while loops
-  for (k=1;k <= mits;k++)
-    {
-      error = 0.0;
-
-/* Copy new solution into old */
-//#pragma omp parallel
-      {
-//#pragma omp for private(i,j)
-	for (i = 0; i < n; i++)
-	  for (j = 0; j < m; j++)
-	    uold[i][j] = u[i][j];
-
-//#pragma omp for private(i,j,resid) reduction(+:error) nowait
-	for (i = 1; i < (n - 1); i++)
-	  for (j = 1; j < (m - 1); j++)
-	    {
-	      resid = (ax * (uold[i - 1][j] + uold[i + 1][j])
-		       + ay * (uold[i][j - 1] + uold[i][j + 1]) +
-		       b * uold[i][j] - f[i][j]) / b;
-
-	      u[i][j] = uold[i][j] - omega * resid;
-	      error = error + resid * resid;
-	    }
-      }
-/*  omp end parallel */
-
-/* Error check */
-
-    //  k = k + 1;
-
-      error = sqrt (error) / (n * m);
-
-    }				/*  End iteration loop */
-
-  printf ("Total Number of Iterations:%d\n", k);
-  printf ("Residual:%E\n", error);
-
-}
-
-
-void
-error_check ()
-{
-
-  int i, j;
-  double xx, yy, temp, error;
-
-  dx = 2.0 / (n - 1);
-  dy = 2.0 / (m - 1);
-  error = 0.0;
-
-//#pragma omp parallel for private(i,j,xx,yy,temp) reduction(+:error)
-  for (i = 0; i < n; i++)
-    for (j = 0; j < m; j++)
-      {
-	xx = -1.0 + dx * (i - 1);
-	yy = -1.0 + dy * (j - 1);
-	temp = u[i][j] - (1.0 - xx * xx) * (1.0 - yy * yy);
-	error = error + temp * temp;
-      }
-  error = sqrt (error) / (n * m);
-
-  printf ("Solution Error :%E \n", error);
-
-}
-

Copied: branches/rice/projects/autoParallelization/tests/jacobi_seq.c (from rev 117, trunk/projects/autoParallelization/tests/jacobi_seq.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/jacobi_seq.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/jacobi_seq.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,202 @@
+/* An example code 
+ *
+ * */
+#include <stdio.h>
+#include <math.h>
+
+void driver (void);
+void initialize (void);
+void jacobi (void);
+void error_check (void);
+
+#define MSIZE 200
+int n, m, mits;
+double tol, relax = 1.0, alpha = 0.0543;
+double u[MSIZE][MSIZE], f[MSIZE][MSIZE], uold[MSIZE][MSIZE];
+double dx, dy;
+
+int
+main (void)
+{
+//  float toler;
+/*      printf("Input n,m (< %d) - grid dimension in x,y direction:\n",MSIZE); 
+      scanf ("%d",&n);
+      scanf ("%d",&m);
+      printf("Input tol - error tolerance for iterative solver\n"); 
+      scanf("%f",&toler);
+      tol=(double)toler;
+      printf("Input mits - Maximum iterations for solver\n"); 
+      scanf("%d",&mits);
+*/
+  n = MSIZE;
+  m = MSIZE;
+  tol = 0.0000000001;
+  mits = 1000;
+  driver ();
+
+  return 1;
+}
+
+/*************************************************************
+* Subroutine driver () 
+* This is where the arrays are allocated and initialzed. 
+*
+* Working varaibles/arrays 
+*     dx  - grid spacing in x direction 
+*     dy  - grid spacing in y direction 
+*************************************************************/
+
+void
+driver ()
+{
+
+  initialize ();
+
+  /* Solve Helmholtz equation */
+  jacobi ();
+
+  /* error_check (n,m,alpha,dx,dy,u,f) */
+  error_check ();
+}
+
+
+/*      subroutine initialize (n,m,alpha,dx,dy,u,f) 
+******************************************************
+* Initializes data 
+* Assumes exact solution is u(x,y) = (1-x^2)*(1-y^2)
+*
+******************************************************/
+
+void
+initialize ()
+{
+
+  int i, j, xx, yy;
+//  double PI = 3.1415926;
+
+  dx = 2.0 / (n - 1); // -->dx at 112:2
+  dy = 2.0 / (m - 1);  //-->dy at 113:2
+
+/* Initialize initial condition and RHS */
+
+//#pragma omp parallel for private(i,j,xx,yy)
+  for (i = 0; i < n; i++)
+    for (j = 0; j < m; j++)
+      {
+	xx = (int) (-1.0 + dx * (i - 1));	/* -1 < x < 1 */
+	yy = (int) (-1.0 + dy * (j - 1));	/* -1 < y < 1 */
+	u[i][j] = 0.0;
+	f[i][j] = -1.0 * alpha * (1.0 - xx * xx) * (1.0 - yy * yy)
+	  - 2.0 * (1.0 - xx * xx) - 2.0 * (1.0 - yy * yy);
+
+      }
+
+}
+
+/*      subroutine jacobi (n,m,dx,dy,alpha,omega,u,f,tol,maxit)
+******************************************************************
+* Subroutine HelmholtzJ
+* Solves poisson equation on rectangular grid assuming : 
+* (1) Uniform discretization in each direction, and 
+* (2) Dirichlect boundary conditions 
+* 
+* Jacobi method is used in this routine 
+*
+* Input : n,m   Number of grid points in the X/Y directions 
+*         dx,dy Grid spacing in the X/Y directions 
+*         alpha Helmholtz eqn. coefficient 
+*         omega Relaxation factor 
+*         f(n,m) Right hand side function 
+*         u(n,m) Dependent variable/Solution
+*         tol    Tolerance for iterative solver 
+*         maxit  Maximum number of iterations 
+*
+* Output : u(n,m) - Solution 
+*****************************************************************/
+
+void
+jacobi ()
+{
+  double omega;
+  int i, j, k;
+  double error, resid,  ax, ay, b;
+
+  omega = relax;
+/*
+* Initialize coefficients */
+
+  ax = 1.0 / (dx * dx);		/* X-direction coef */
+  ay = 1.0 / (dy * dy);		/* Y-direction coef */
+  b = -2.0 / (dx * dx) - 2.0 / (dy * dy) - alpha;	/* Central coeff */
+
+  error = 10.0 * tol;
+  k = 1;
+
+//  while ((k <= mits) && (error > tol))
+//  Qing's dependence analysis cannot handle while loops
+  for (k=1;k <= mits;k++)
+    {
+      error = 0.0;
+
+/* Copy new solution into old */
+//#pragma omp parallel
+      {
+//#pragma omp for private(i,j)
+	for (i = 0; i < n; i++)
+	  for (j = 0; j < m; j++)
+	    uold[i][j] = u[i][j];
+
+//#pragma omp for private(i,j,resid) reduction(+:error) nowait
+	for (i = 1; i < (n - 1); i++)
+	  for (j = 1; j < (m - 1); j++)
+	    {
+	      resid = (ax * (uold[i - 1][j] + uold[i + 1][j])
+		       + ay * (uold[i][j - 1] + uold[i][j + 1]) +
+		       b * uold[i][j] - f[i][j]) / b;
+
+	      u[i][j] = uold[i][j] - omega * resid;
+	      error = error + resid * resid;
+	    }
+      }
+/*  omp end parallel */
+
+/* Error check */
+
+    //  k = k + 1;
+
+      error = sqrt (error) / (n * m);
+
+    }				/*  End iteration loop */
+
+  printf ("Total Number of Iterations:%d\n", k);
+  printf ("Residual:%E\n", error);
+
+}
+
+
+void
+error_check ()
+{
+
+  int i, j;
+  double xx, yy, temp, error;
+
+  dx = 2.0 / (n - 1);
+  dy = 2.0 / (m - 1);
+  error = 0.0;
+
+//#pragma omp parallel for private(i,j,xx,yy,temp) reduction(+:error)
+  for (i = 0; i < n; i++)
+    for (j = 0; j < m; j++)
+      {
+	xx = -1.0 + dx * (i - 1);
+	yy = -1.0 + dy * (j - 1);
+	temp = u[i][j] - (1.0 - xx * xx) * (1.0 - yy * yy);
+	error = error + temp * temp;
+      }
+  error = sqrt (error) / (n * m);
+
+  printf ("Solution Error :%E \n", error);
+
+}
+

Deleted: branches/rice/projects/autoParallelization/tests/matrixmultiply.c
===================================================================
--- trunk/projects/autoParallelization/tests/matrixmultiply.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/matrixmultiply.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,21 +0,0 @@
-/*
-Naive matrix-matrix multiplication(mmm)
-By C. Liao
-*/
-#define N 1000
-#define M 1000
-#define K 1000
-
-int i,j,k;
-double a[N][M],b[M][K],c[N][K];
-
-int mmm()
-{
-//#pragma omp parallel for private(i,j,k) shared(a,b,c)
-for (i = 0; i < N; i++)
-  for (j = 0; j < M; j++)
-    for (k = 0; k < K; k++)
-       c[i][j]= c[i][j]+a[i][k]*b[k][j];
-return 0;
-}
-

Copied: branches/rice/projects/autoParallelization/tests/matrixmultiply.c (from rev 117, trunk/projects/autoParallelization/tests/matrixmultiply.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/matrixmultiply.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/matrixmultiply.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,21 @@
+/*
+Naive matrix-matrix multiplication(mmm)
+By C. Liao
+*/
+#define N 1000
+#define M 1000
+#define K 1000
+
+int i,j,k;
+double a[N][M],b[M][K],c[N][K];
+
+int mmm()
+{
+//#pragma omp parallel for private(i,j,k) shared(a,b,c)
+for (i = 0; i < N; i++)
+  for (j = 0; j < M; j++)
+    for (k = 0; k < K; k++)
+       c[i][j]= c[i][j]+a[i][k]*b[k][j];
+return 0;
+}
+

Deleted: branches/rice/projects/autoParallelization/tests/output_dep.c
===================================================================
--- trunk/projects/autoParallelization/tests/output_dep.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/output_dep.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,19 +0,0 @@
-// an example of output dependence preventing parallelization
-// x: not live-in, yes live-out
-//    outer scope
-//    loop-carried output-dependence: x=... : accept values based on loop variable; or not. 
-//Solution: Can be parallelized using lastprivate(x)
-#include <stdio.h> 
-void foo()
-{
-  int i,x;
-
-  for (i=0;i<100;i++) 
-    x=i;
-  printf("x=%d",x);    
-}  
-/*  carryLevel should be 0?
- 
- * dep SgExprStatement:x = i; SgExprStatement:x = i; 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:x at 7:6->SgVarRefExp:x at 7:6 == 0;||::
-
- */

Copied: branches/rice/projects/autoParallelization/tests/output_dep.c (from rev 117, trunk/projects/autoParallelization/tests/output_dep.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/output_dep.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/output_dep.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,19 @@
+// an example of output dependence preventing parallelization
+// x: not live-in, yes live-out
+//    outer scope
+//    loop-carried output-dependence: x=... : accept values based on loop variable; or not. 
+//Solution: Can be parallelized using lastprivate(x)
+#include <stdio.h> 
+void foo()
+{
+  int i,x;
+
+  for (i=0;i<100;i++) 
+    x=i;
+  printf("x=%d",x);    
+}  
+/*  carryLevel should be 0?
+ 
+ * dep SgExprStatement:x = i; SgExprStatement:x = i; 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:x at 7:6->SgVarRefExp:x at 7:6 == 0;||::
+
+ */

Deleted: branches/rice/projects/autoParallelization/tests/output_dep2.c
===================================================================
--- trunk/projects/autoParallelization/tests/output_dep2.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/output_dep2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,35 +0,0 @@
-// an example of output dependence preventing parallelization
-// loop carried vs. non-loop carried output dependence!
-void foo()
-{
-  int i,x,y;
-
-  for (i=0;i<100;i++) 
-  {  
-    x=i;
-    y=i;
-    y=i+1;
-  }
-}  
-/*  
-output dependence   carryLevel should be 0?  carry level is wrong!!
-dep SgExprStatement:x = i; 
-    SgExprStatement:x = i; 
-    1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 
-    SgVarRefExp:x at 8:6->SgVarRefExp:x at 8:6 == 0;||::
-
-output dependence   carryLevel should be 0?  carry level is wrong!!
-dep SgExprStatement:y = i; SgExprStatement:y = i; 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:y at 9:6->SgVarRefExp:y at 9:6 == 0;||::
-
-output dependence   carryLevel should be 0?  carry level is wrong!!
-dep SgExprStatement:y =(i + 1); SgExprStatement:y =(i + 1); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:y at 10:6->SgVarRefExp:y at 10:6 == 0;||::
-
-//--------------
-output dependence: non-loop carried, level =1 is correct
-dep SgExprStatement:y = i; SgExprStatement:y =(i + 1); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:y at 9:6->SgVarRefExp:y at 10:6 == 0;||::
-
- output dependence: Carry level =0 means loop carried, also look at line number: 10>9 
-dep SgExprStatement:y =(i + 1); SgExprStatement:y = i; 1*1 SCALAR_BACK_DEP; commonlevel = 1 CarryLevel = 0 SgVarRefExp:y at 10:6->SgVarRefExp:y at 9:6 <= -1;||::
- 
-
- */

Copied: branches/rice/projects/autoParallelization/tests/output_dep2.c (from rev 117, trunk/projects/autoParallelization/tests/output_dep2.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/output_dep2.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/output_dep2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,35 @@
+// an example of output dependence preventing parallelization
+// loop carried vs. non-loop carried output dependence!
+void foo()
+{
+  int i,x,y;
+
+  for (i=0;i<100;i++) 
+  {  
+    x=i;
+    y=i;
+    y=i+1;
+  }
+}  
+/*  
+output dependence   carryLevel should be 0?  carry level is wrong!!
+dep SgExprStatement:x = i; 
+    SgExprStatement:x = i; 
+    1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 
+    SgVarRefExp:x at 8:6->SgVarRefExp:x at 8:6 == 0;||::
+
+output dependence   carryLevel should be 0?  carry level is wrong!!
+dep SgExprStatement:y = i; SgExprStatement:y = i; 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:y at 9:6->SgVarRefExp:y at 9:6 == 0;||::
+
+output dependence   carryLevel should be 0?  carry level is wrong!!
+dep SgExprStatement:y =(i + 1); SgExprStatement:y =(i + 1); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:y at 10:6->SgVarRefExp:y at 10:6 == 0;||::
+
+//--------------
+output dependence: non-loop carried, level =1 is correct
+dep SgExprStatement:y = i; SgExprStatement:y =(i + 1); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:y at 9:6->SgVarRefExp:y at 10:6 == 0;||::
+
+ output dependence: Carry level =0 means loop carried, also look at line number: 10>9 
+dep SgExprStatement:y =(i + 1); SgExprStatement:y = i; 1*1 SCALAR_BACK_DEP; commonlevel = 1 CarryLevel = 0 SgVarRefExp:y at 10:6->SgVarRefExp:y at 9:6 <= -1;||::
+ 
+
+ */

Deleted: branches/rice/projects/autoParallelization/tests/output_dep3.c
===================================================================
--- trunk/projects/autoParallelization/tests/output_dep3.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/output_dep3.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,45 +0,0 @@
-// an example of output dependence preventing parallelization
-// two level loops, check carry level value
-#include <stdio.h> 
-void foo()
-{
-  int i,j,x,y;
-
-  for (i=0;i<100;i++) 
-    for (j=0;j<100;j++) 
-    {    
-      x=i;
-      y = x;
-      y=i+j;
-      y= y+1;
-    }
-  printf("x=%d",x);    
-}  
-
-/*
- 
- -------------Dump the dependence graph for the first loop in a function body!------------
-dep SgExprStatement:x = i; SgExprStatement:x = i; 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:x at 11:8->SgVarRefExp:x at 11:8 == 0;* 0;||* 0;== 0;||::
-
-dep SgExprStatement:x = i; SgExprStatement:y = x; 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:x at 11:8[write]->SgVarRefExp:x at 12:11[read] == 0;* 0;||* 0;== 0;||::
-
- dep SgExprStatement:y = x; SgExprStatement:y = x; 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 12:9->SgVarRefExp:y at 12:9 == 0;* 0;||* 0;== 0;||::
-//   y =x ; x = i
- dep SgExprStatement:y = x; SgExprStatement:x = i; 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:x at 12:11->SgVarRefExp:x at 11:8 == 0;* 0;||* 0;<= -1;||::
- dep SgExprStatement:y = x; SgExprStatement:y =(i + j); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 12:9->SgVarRefExp:y at 13:8 == 0;* 0;||* 0;== 0;||::
- dep SgExprStatement:y = x; SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 12:9->SgVarRefExp:y at 14:8 == 0;* 0;||* 0;== 0;||::
- dep SgExprStatement:y = x; SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 12:9->SgVarRefExp:y at 14:10 == 0;* 0;||* 0;== 0;||::
- dep SgExprStatement:y =(i + j); SgExprStatement:y =(i + j); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 13:8->SgVarRefExp:y at 13:8 == 0;* 0;||* 0;== 0;||::
- dep SgExprStatement:y =(i + j); SgExprStatement:y = x; 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 13:8->SgVarRefExp:y at 12:9 == 0;* 0;||* 0;<= -1;||::
- dep SgExprStatement:y =(i + j); SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 13:8->SgVarRefExp:y at 14:8 == 0;* 0;||* 0;== 0;||::
- dep SgExprStatement:y =(i + j); SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 13:8->SgVarRefExp:y at 14:10 == 0;* 0;||* 0;== 0;||::
- dep SgExprStatement:y =(y + 1); SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 14:8->SgVarRefExp:y at 14:8 == 0;* 0;||* 0;== 0;||::
- dep SgExprStatement:y =(y + 1); SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 14:10->SgVarRefExp:y at 14:8 == 0;* 0;||* 0;== 0;||::
- dep SgExprStatement:y =(y + 1); SgExprStatement:y =(y + 1); 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:8->SgVarRefExp:y at 14:10 == 0;* 0;||* 0;<= -1;||::
- dep SgExprStatement:y =(y + 1); SgExprStatement:y =(i + j); 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:8->SgVarRefExp:y at 13:8 == 0;* 0;||* 0;<= -1;||::
- dep SgExprStatement:y =(y + 1); SgExprStatement:y =(i + j); 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:10->SgVarRefExp:y at 13:8 == 0;* 0;||* 0;<= -1;||::
-
- dep SgExprStatement:y =(y + 1); SgExprStatement:y = x; 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:8->SgVarRefExp:y at 12:9 == 0;* 0;||* 0;<= -1;||::
- dep SgExprStatement:y =(y + 1); SgExprStatement:y = x; 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:10->SgVarRefExp:y at 12:9 == 0;* 0;||* 0;<= -1;||::
-
- */

Copied: branches/rice/projects/autoParallelization/tests/output_dep3.c (from rev 117, trunk/projects/autoParallelization/tests/output_dep3.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/output_dep3.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/output_dep3.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,45 @@
+// an example of output dependence preventing parallelization
+// two level loops, check carry level value
+#include <stdio.h> 
+void foo()
+{
+  int i,j,x,y;
+
+  for (i=0;i<100;i++) 
+    for (j=0;j<100;j++) 
+    {    
+      x=i;
+      y = x;
+      y=i+j;
+      y= y+1;
+    }
+  printf("x=%d",x);    
+}  
+
+/*
+ 
+ -------------Dump the dependence graph for the first loop in a function body!------------
+dep SgExprStatement:x = i; SgExprStatement:x = i; 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:x at 11:8->SgVarRefExp:x at 11:8 == 0;* 0;||* 0;== 0;||::
+
+dep SgExprStatement:x = i; SgExprStatement:y = x; 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:x at 11:8[write]->SgVarRefExp:x at 12:11[read] == 0;* 0;||* 0;== 0;||::
+
+ dep SgExprStatement:y = x; SgExprStatement:y = x; 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 12:9->SgVarRefExp:y at 12:9 == 0;* 0;||* 0;== 0;||::
+//   y =x ; x = i
+ dep SgExprStatement:y = x; SgExprStatement:x = i; 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:x at 12:11->SgVarRefExp:x at 11:8 == 0;* 0;||* 0;<= -1;||::
+ dep SgExprStatement:y = x; SgExprStatement:y =(i + j); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 12:9->SgVarRefExp:y at 13:8 == 0;* 0;||* 0;== 0;||::
+ dep SgExprStatement:y = x; SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 12:9->SgVarRefExp:y at 14:8 == 0;* 0;||* 0;== 0;||::
+ dep SgExprStatement:y = x; SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 12:9->SgVarRefExp:y at 14:10 == 0;* 0;||* 0;== 0;||::
+ dep SgExprStatement:y =(i + j); SgExprStatement:y =(i + j); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 13:8->SgVarRefExp:y at 13:8 == 0;* 0;||* 0;== 0;||::
+ dep SgExprStatement:y =(i + j); SgExprStatement:y = x; 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 13:8->SgVarRefExp:y at 12:9 == 0;* 0;||* 0;<= -1;||::
+ dep SgExprStatement:y =(i + j); SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 13:8->SgVarRefExp:y at 14:8 == 0;* 0;||* 0;== 0;||::
+ dep SgExprStatement:y =(i + j); SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 13:8->SgVarRefExp:y at 14:10 == 0;* 0;||* 0;== 0;||::
+ dep SgExprStatement:y =(y + 1); SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 14:8->SgVarRefExp:y at 14:8 == 0;* 0;||* 0;== 0;||::
+ dep SgExprStatement:y =(y + 1); SgExprStatement:y =(y + 1); 2*2 SCALAR_DEP; commonlevel = 2 CarryLevel = 2 SgVarRefExp:y at 14:10->SgVarRefExp:y at 14:8 == 0;* 0;||* 0;== 0;||::
+ dep SgExprStatement:y =(y + 1); SgExprStatement:y =(y + 1); 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:8->SgVarRefExp:y at 14:10 == 0;* 0;||* 0;<= -1;||::
+ dep SgExprStatement:y =(y + 1); SgExprStatement:y =(i + j); 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:8->SgVarRefExp:y at 13:8 == 0;* 0;||* 0;<= -1;||::
+ dep SgExprStatement:y =(y + 1); SgExprStatement:y =(i + j); 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:10->SgVarRefExp:y at 13:8 == 0;* 0;||* 0;<= -1;||::
+
+ dep SgExprStatement:y =(y + 1); SgExprStatement:y = x; 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:8->SgVarRefExp:y at 12:9 == 0;* 0;||* 0;<= -1;||::
+ dep SgExprStatement:y =(y + 1); SgExprStatement:y = x; 2*2 SCALAR_BACK_DEP; commonlevel = 2 CarryLevel = 1 SgVarRefExp:y at 14:10->SgVarRefExp:y at 12:9 == 0;* 0;||* 0;<= -1;||::
+
+ */

Deleted: branches/rice/projects/autoParallelization/tests/pointer.c
===================================================================
--- trunk/projects/autoParallelization/tests/pointer.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/pointer.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,7 +0,0 @@
-/* Pointers as array
- * */
-void ser(int *a, int *b, int *c)
-{
-  for (int i=0; i<9900; i++)
-    a[i] = a[i] + b[i] * c[i];
-}

Copied: branches/rice/projects/autoParallelization/tests/pointer.c (from rev 117, trunk/projects/autoParallelization/tests/pointer.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/pointer.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/pointer.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,7 @@
+/* Pointers as array
+ * */
+void ser(int *a, int *b, int *c)
+{
+  for (int i=0; i<9900; i++)
+    a[i] = a[i] + b[i] * c[i];
+}

Deleted: branches/rice/projects/autoParallelization/tests/private.c
===================================================================
--- trunk/projects/autoParallelization/tests/private.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/private.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,28 +0,0 @@
-/*
- * dependence graph:
- */
-void foo()
-{
-  int i,x;
-  int a[100];
-  int b[100];
-// x should be recognized as a private variable during parallelization
-// yet it introduces a set of dependencies 
-  for (i=0;i<100;i++) 
-  { 
-    x= a[i];
-    b[i]=x+1;
-  }  
-}  
-/*
- * 
-output dependence:  should be loop carried (level=0), but reported as non-loop carried?
-dep SgExprStatement:x =(a[i]); SgExprStatement:x =(a[i]); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:x at 13:6->SgVarRefExp:x at 13:6 == 0;||::
-
-true dependence: non-loop carried
-dep SgExprStatement:x =(a[i]); SgExprStatement:b[i] =(x + 1); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:x at 13:6->SgVarRefExp:x at 14:10 == 0;||::
-
-anti-dependence: loop -carried
-dep SgExprStatement:b[i] =(x + 1); SgExprStatement:x =(a[i]); 1*1 SCALAR_BACK_DEP; commonlevel = 1 CarryLevel = 0 SgVarRefExp:x at 14:10->SgVarRefExp:x at 13:6 <= -1;||::
-
- */

Copied: branches/rice/projects/autoParallelization/tests/private.c (from rev 117, trunk/projects/autoParallelization/tests/private.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/private.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/private.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,28 @@
+/*
+ * dependence graph:
+ */
+void foo()
+{
+  int i,x;
+  int a[100];
+  int b[100];
+// x should be recognized as a private variable during parallelization
+// yet it introduces a set of dependencies 
+  for (i=0;i<100;i++) 
+  { 
+    x= a[i];
+    b[i]=x+1;
+  }  
+}  
+/*
+ * 
+output dependence:  should be loop carried (level=0), but reported as non-loop carried?
+dep SgExprStatement:x =(a[i]); SgExprStatement:x =(a[i]); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:x at 13:6->SgVarRefExp:x at 13:6 == 0;||::
+
+true dependence: non-loop carried
+dep SgExprStatement:x =(a[i]); SgExprStatement:b[i] =(x + 1); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:x at 13:6->SgVarRefExp:x at 14:10 == 0;||::
+
+anti-dependence: loop -carried
+dep SgExprStatement:b[i] =(x + 1); SgExprStatement:x =(a[i]); 1*1 SCALAR_BACK_DEP; commonlevel = 1 CarryLevel = 0 SgVarRefExp:x at 14:10->SgVarRefExp:x at 13:6 <= -1;||::
+
+ */

Deleted: branches/rice/projects/autoParallelization/tests/reduction.c
===================================================================
--- trunk/projects/autoParallelization/tests/reduction.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/reduction.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,20 +0,0 @@
-int a[100], sum;
-void foo()
-{
-  int i;
-  for (i=0;i<100;i++)
-  {
-    sum = a[i]+ sum;    
-  }
-}
-/*
-loop carried output dependence 
-dep SgExprStatement:sum =((a[i]) + sum); SgExprStatement:sum =((a[i]) + sum); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:sum at 7:9->SgVarRefExp:sum at 7:9 == 0;||::
-
-non-loop carried  anti dependence, 
-dep SgExprStatement:sum =((a[i]) + sum); SgExprStatement:sum =((a[i]) + sum); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:sum at 7:17->SgVarRefExp:sum at 7:9 == 0;||::
-
-Loop carried  anti dependence
-dep SgExprStatement:sum =((a[i]) + sum); SgExprStatement:sum =((a[i]) + sum); 1*1 SCALAR_BACK_DEP; commonlevel = 1 CarryLevel = 0 SgVarRefExp:sum at 7:9->SgVarRefExp:sum at 7:17 <= -1;||::
-
- */

Copied: branches/rice/projects/autoParallelization/tests/reduction.c (from rev 117, trunk/projects/autoParallelization/tests/reduction.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/reduction.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/reduction.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,20 @@
+int a[100], sum;
+void foo()
+{
+  int i;
+  for (i=0;i<100;i++)
+  {
+    sum = a[i]+ sum;    
+  }
+}
+/*
+loop carried output dependence 
+dep SgExprStatement:sum =((a[i]) + sum); SgExprStatement:sum =((a[i]) + sum); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:sum at 7:9->SgVarRefExp:sum at 7:9 == 0;||::
+
+non-loop carried  anti dependence, 
+dep SgExprStatement:sum =((a[i]) + sum); SgExprStatement:sum =((a[i]) + sum); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:sum at 7:17->SgVarRefExp:sum at 7:9 == 0;||::
+
+Loop carried  anti dependence
+dep SgExprStatement:sum =((a[i]) + sum); SgExprStatement:sum =((a[i]) + sum); 1*1 SCALAR_BACK_DEP; commonlevel = 1 CarryLevel = 0 SgVarRefExp:sum at 7:9->SgVarRefExp:sum at 7:17 <= -1;||::
+
+ */

Deleted: branches/rice/projects/autoParallelization/tests/scalar_privatization.c
===================================================================
--- trunk/projects/autoParallelization/tests/scalar_privatization.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/scalar_privatization.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,30 +0,0 @@
-/* a local variable to transfer temp value
- * It introduces "fake" data dependence since the variable is local to each iteration
- * */
-int a[100],b[100];
-void foo()
-{
-  int i;
-  for (i=0;i<100;i++)
-  {
-    int tmp;
-    tmp =a[i]+i;
-    b[i] = tmp;
-  }
-}
-/*
- *-------------Dump the dependence graph for the first loop in a function body!------------
-// Output dependence
-// Loop-carried ,why CarryLevel =1????
-dep SgExprStatement:tmp =((a[i]) + i); SgExprStatement:tmp =((a[i]) + i); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:tmp at 11:9->SgVarRefExp:tmp at 11:9 == 0;||::
-
-//True dependence for both 
-//a) loop independent (within an iteration) and
-//b) loop carried (across iterations) : This is sure thing if a) holds
-dep SgExprStatement:tmp =((a[i]) + i); SgExprStatement:b[i] = tmp; 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:tmp at 11:9->SgVarRefExp:tmp at 12:12 == 0;||::
-
-//Anti dependence
-//Loop carried(BACK_DEP)  scalar
-dep SgExprStatement:b[i] = tmp; SgExprStatement:tmp =((a[i]) + i); 1*1 SCALAR_BACK_DEP; commonlevel = 1 CarryLevel = 0 SgVarRefExp:tmp at 12:12->SgVarRefExp:tmp at 11:9 <= -1;||::
-
- */

Copied: branches/rice/projects/autoParallelization/tests/scalar_privatization.c (from rev 117, trunk/projects/autoParallelization/tests/scalar_privatization.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/scalar_privatization.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/scalar_privatization.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,30 @@
+/* a local variable to transfer temp value
+ * It introduces "fake" data dependence since the variable is local to each iteration
+ * */
+int a[100],b[100];
+void foo()
+{
+  int i;
+  for (i=0;i<100;i++)
+  {
+    int tmp;
+    tmp =a[i]+i;
+    b[i] = tmp;
+  }
+}
+/*
+ *-------------Dump the dependence graph for the first loop in a function body!------------
+// Output dependence
+// Loop-carried ,why CarryLevel =1????
+dep SgExprStatement:tmp =((a[i]) + i); SgExprStatement:tmp =((a[i]) + i); 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:tmp at 11:9->SgVarRefExp:tmp at 11:9 == 0;||::
+
+//True dependence for both 
+//a) loop independent (within an iteration) and
+//b) loop carried (across iterations) : This is sure thing if a) holds
+dep SgExprStatement:tmp =((a[i]) + i); SgExprStatement:b[i] = tmp; 1*1 SCALAR_DEP; commonlevel = 1 CarryLevel = 1 SgVarRefExp:tmp at 11:9->SgVarRefExp:tmp at 12:12 == 0;||::
+
+//Anti dependence
+//Loop carried(BACK_DEP)  scalar
+dep SgExprStatement:b[i] = tmp; SgExprStatement:tmp =((a[i]) + i); 1*1 SCALAR_BACK_DEP; commonlevel = 1 CarryLevel = 0 SgVarRefExp:tmp at 12:12->SgVarRefExp:tmp at 11:9 <= -1;||::
+
+ */

Deleted: branches/rice/projects/autoParallelization/tests/shared.c
===================================================================
--- trunk/projects/autoParallelization/tests/shared.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/shared.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,16 +0,0 @@
-/*
- * dependence graph:
- */
-void foo()
-{
-  int i,x;
-  int a[100];
-  for (i=0;i<100;i++) 
-  { 
-    a[i]=a[i]+1; 
-  }  
-}  
-/*
-  non loop carried anti dependence for array accesses  : level =1 > 0 
-dep SgExprStatement:a[i] =((a[i]) + 1); SgExprStatement:a[i] =((a[i]) + 1); 1*1 ANTI_DEP; commonlevel = 1 CarryLevel = 1  Is precise SgPntrArrRefExp:(a[i])@10:11->SgPntrArrRefExp:a[i]@10:9 == 0;||::
- */

Copied: branches/rice/projects/autoParallelization/tests/shared.c (from rev 117, trunk/projects/autoParallelization/tests/shared.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/shared.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/shared.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,16 @@
+/*
+ * dependence graph:
+ */
+void foo()
+{
+  int i,x;
+  int a[100];
+  for (i=0;i<100;i++) 
+  { 
+    a[i]=a[i]+1; 
+  }  
+}  
+/*
+  non loop carried anti dependence for array accesses  : level =1 > 0 
+dep SgExprStatement:a[i] =((a[i]) + 1); SgExprStatement:a[i] =((a[i]) + 1); 1*1 ANTI_DEP; commonlevel = 1 CarryLevel = 1  Is precise SgPntrArrRefExp:(a[i])@10:11->SgPntrArrRefExp:a[i]@10:9 == 0;||::
+ */

Deleted: branches/rice/projects/autoParallelization/tests/true_dep.c
===================================================================
--- trunk/projects/autoParallelization/tests/true_dep.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/true_dep.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,8 +0,0 @@
-void foo()
-{
-  int i;
-  int a[100];
-
-  for (i=1;i<100;i++)
-    a[i]=a[i-1]+1;
-}  

Copied: branches/rice/projects/autoParallelization/tests/true_dep.c (from rev 117, trunk/projects/autoParallelization/tests/true_dep.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/true_dep.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/true_dep.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,8 @@
+void foo()
+{
+  int i;
+  int a[100];
+
+  for (i=1;i<100;i++)
+    a[i]=a[i-1]+1;
+}  

Deleted: branches/rice/projects/autoParallelization/tests/true_dep_2.c
===================================================================
--- trunk/projects/autoParallelization/tests/true_dep_2.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/true_dep_2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,27 +0,0 @@
-// An example of loop carried true-dependence at both levels
-void foo()
-{
-  int n=100, m=100;
-  double a[n][m];
-  int i,j;
-  for (i=1;i<n;i++)
-    for (j=1;j<m;j++)
-      a[i][j]=a[i][j-1]+a[i-1][j];
-}
-/*
-dep SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) +((a[i - 1])[j])); 
-    SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) +((a[i - 1])[j])); 
-    2*2 TRUE_DEP; commonlevel = 2 CarryLevel = 1  
-    Is precise 
-    SgPntrArrRefExp:(a[i])[j]@9:14->SgPntrArrRefExp:((a[i])[j - 1])@9:19 
-     == 0; *   0;||
-     *  0; == -1;||::
-
-dep SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) +((a[i - 1])[j])); 
-    SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) +((a[i - 1])[j])); 
-    2*2 TRUE_DEP; commonlevel = 2 CarryLevel = 0  
-    Is precise 
-    SgPntrArrRefExp:(a[i])[j]@9:14->SgPntrArrRefExp:((a[i - 1])[j])@9:31 
-    == -1;  * 0;||
-    *  0 ; == 0;||::
-*/

Copied: branches/rice/projects/autoParallelization/tests/true_dep_2.c (from rev 117, trunk/projects/autoParallelization/tests/true_dep_2.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/true_dep_2.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/true_dep_2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,27 @@
+// An example of loop carried true-dependence at both levels
+void foo()
+{
+  int n=100, m=100;
+  double a[n][m];
+  int i,j;
+  for (i=1;i<n;i++)
+    for (j=1;j<m;j++)
+      a[i][j]=a[i][j-1]+a[i-1][j];
+}
+/*
+dep SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) +((a[i - 1])[j])); 
+    SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) +((a[i - 1])[j])); 
+    2*2 TRUE_DEP; commonlevel = 2 CarryLevel = 1  
+    Is precise 
+    SgPntrArrRefExp:(a[i])[j]@9:14->SgPntrArrRefExp:((a[i])[j - 1])@9:19 
+     == 0; *   0;||
+     *  0; == -1;||::
+
+dep SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) +((a[i - 1])[j])); 
+    SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) +((a[i - 1])[j])); 
+    2*2 TRUE_DEP; commonlevel = 2 CarryLevel = 0  
+    Is precise 
+    SgPntrArrRefExp:(a[i])[j]@9:14->SgPntrArrRefExp:((a[i - 1])[j])@9:31 
+    == -1;  * 0;||
+    *  0 ; == 0;||::
+*/

Deleted: branches/rice/projects/autoParallelization/tests/true_l2.c
===================================================================
--- trunk/projects/autoParallelization/tests/true_l2.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/true_l2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,19 +0,0 @@
-/*
- * Outer loop: no dependence: 
- * Inner loop: loop-carried dependence
- *
- * final dependence graph:
- * dep SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) + 1); 
- *      SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) + 1); 
- * 2*2TRUE_DEP; commonlevel = 2  +precise CarryLevel = 1
- *     SgPntrArrRefExp:(a[i])[j]
- *     SgPntrArrRefExp:((a[i])[j - 1])  == 0;* 0;||* 0;== -1;||::
- */
-int i,j;
-int a[100][100];
-void foo()
-{
-  for (i=1;i<100;i++)
-    for (j=1;j<100;j++)
-      a[i][j]=a[i][j-1]+1;
-}

Copied: branches/rice/projects/autoParallelization/tests/true_l2.c (from rev 117, trunk/projects/autoParallelization/tests/true_l2.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/true_l2.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/true_l2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,19 @@
+/*
+ * Outer loop: no dependence: 
+ * Inner loop: loop-carried dependence
+ *
+ * final dependence graph:
+ * dep SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) + 1); 
+ *      SgExprStatement:(a[i])[j] =(((a[i])[j - 1]) + 1); 
+ * 2*2TRUE_DEP; commonlevel = 2  +precise CarryLevel = 1
+ *     SgPntrArrRefExp:(a[i])[j]
+ *     SgPntrArrRefExp:((a[i])[j - 1])  == 0;* 0;||* 0;== -1;||::
+ */
+int i,j;
+int a[100][100];
+void foo()
+{
+  for (i=1;i<100;i++)
+    for (j=1;j<100;j++)
+      a[i][j]=a[i][j-1]+1;
+}

Deleted: branches/rice/projects/autoParallelization/tests/vector_1.C
===================================================================
--- trunk/projects/autoParallelization/tests/vector_1.C	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/vector_1.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,15 +0,0 @@
-// vector constructors
-// semantics
-// implementation: 
-#include <vector>
-#include <iostream>
-
-using namespace std;
-
-int main (void)
-{
-  int j= 268435456;
-  //int j= 500000000;
-  vector <float> v1(j,56.00);  //stmt 2.
-  return 0;
-}

Copied: branches/rice/projects/autoParallelization/tests/vector_1.C (from rev 117, trunk/projects/autoParallelization/tests/vector_1.C)
===================================================================
--- branches/rice/projects/autoParallelization/tests/vector_1.C	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/vector_1.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,15 @@
+// vector constructors
+// semantics
+// implementation: 
+#include <vector>
+#include <iostream>
+
+using namespace std;
+
+int main (void)
+{
+  int j= 268435456;
+  //int j= 500000000;
+  vector <float> v1(j,56.00);  //stmt 2.
+  return 0;
+}

Deleted: branches/rice/projects/autoParallelization/tests/vector_2.C
===================================================================
--- trunk/projects/autoParallelization/tests/vector_2.C	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/vector_2.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,18 +0,0 @@
-// vector constructors
-// semantics
-// implementation: 
-#include <vector>
-#include <iostream>
-
-using namespace std;
-
-int main (void)
-{
-  vector <int> v1; // minimum exe time
-  cout<<"Capacity is:"<<v1.capacity()<<endl;
-  cout<<"Max size is:"<<v1.max_size()<<endl;
-  // is:            1073741823
-  //vector <int> v1(500000000,56);  //stmt 2.
-   vector <int> v2(673741823); // the same execution time as stmt 2!
-  return 0;
-}

Copied: branches/rice/projects/autoParallelization/tests/vector_2.C (from rev 117, trunk/projects/autoParallelization/tests/vector_2.C)
===================================================================
--- branches/rice/projects/autoParallelization/tests/vector_2.C	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/vector_2.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,18 @@
+// vector constructors
+// semantics
+// implementation: 
+#include <vector>
+#include <iostream>
+
+using namespace std;
+
+int main (void)
+{
+  vector <int> v1; // minimum exe time
+  cout<<"Capacity is:"<<v1.capacity()<<endl;
+  cout<<"Max size is:"<<v1.max_size()<<endl;
+  // is:            1073741823
+  //vector <int> v1(500000000,56);  //stmt 2.
+   vector <int> v2(673741823); // the same execution time as stmt 2!
+  return 0;
+}

Deleted: branches/rice/projects/autoParallelization/tests/vectorize_1.c
===================================================================
--- trunk/projects/autoParallelization/tests/vectorize_1.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/autoParallelization/tests/vectorize_1.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,9 +0,0 @@
-/* Vectorization example
- * */
-float a[256], b[256], c[256];
-int i;
-foo ()
-{
-  for (i = 0; i < 256; i++)
-    a[i] = b[i] + c[i];
-}

Copied: branches/rice/projects/autoParallelization/tests/vectorize_1.c (from rev 117, trunk/projects/autoParallelization/tests/vectorize_1.c)
===================================================================
--- branches/rice/projects/autoParallelization/tests/vectorize_1.c	                        (rev 0)
+++ branches/rice/projects/autoParallelization/tests/vectorize_1.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,9 @@
+/* Vectorization example
+ * */
+float a[256], b[256], c[256];
+int i;
+foo ()
+{
+  for (i = 0; i < 256; i++)
+    a[i] = b[i] + c[i];
+}

Modified: branches/rice/projects/binCompass/binCompassMain.cpp
===================================================================
--- branches/rice/projects/binCompass/binCompassMain.cpp	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/binCompass/binCompassMain.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -165,10 +165,11 @@
   SgBinaryFile* binaryFile = isSgBinaryFile(project->get_fileList()[0]);
   SgAsmFile* file = binaryFile != NULL ? binaryFile->get_binaryFile() : NULL;
 
-  const SgAsmInterpretationPtrList& interps = file->get_interpretations();
-  ROSE_ASSERT (interps.size() == 1);
-  SgAsmInterpretation* interp = interps[0];
-
+  //  const SgAsmInterpretationPtrList& interps = file->get_interpretations();
+  //ROSE_ASSERT (interps.size() == 1);
+  //SgAsmInterpretation* interp = interps[0];
+  SgAsmInterpretation* interp = SageInterface::getMainInterpretation(file);
+                                
   if (containsArgument(argc, argv, "-printTree")) {
     fprintf(stderr, "Printing AST... _binary_tree.dot\n");
     string filename="_binary_tree.dot";

Modified: branches/rice/projects/binaryVisualization/vizzBinary.C
===================================================================
--- branches/rice/projects/binaryVisualization/vizzBinary.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/binaryVisualization/vizzBinary.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -845,9 +845,9 @@
   SgAsmFile* file = binFile != NULL ? binFile->get_binaryFile() : NULL;
 
 
-  const SgAsmInterpretationPtrList& interps = file->get_interpretations();
-  ROSE_ASSERT (interps.size() == 1);
-  SgAsmInterpretation* interp = interps[0];
+  SgAsmInterpretation* interp = SageInterface::getMainInterpretation(file);
+  //  ROSE_ASSERT (interps.size() == 1);
+  //  SgAsmInterpretation* interp = interps[0];
 
   string fname = StringUtility::stripPathFromFileName(name);
 

Modified: branches/rice/projects/compass/extensions/checkers/nameConsistency/checkNameImpl.C
===================================================================
--- branches/rice/projects/compass/extensions/checkers/nameConsistency/checkNameImpl.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/extensions/checkers/nameConsistency/checkNameImpl.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -890,7 +890,7 @@
    {
 
      ROSE_ASSERT(currentInfo != NULL);
-#ifdef USE_ROSE_BOOST_WAVE_SUPPORT 
+//#ifdef USE_ROSE_BOOST_WAVE_SUPPORT 
     	  PreprocessingInfo::r_macro_def* macro_def = currentInfo->get_macro_def();
 
 	  std::string macroName = macro_def->macro_name.get_value().c_str();
@@ -912,7 +912,7 @@
 
 	       }
 	  }
-#endif
+//#endif
    }
 
 

Copied: branches/rice/projects/compass/extensions/checkers/pointerComparison (from rev 117, trunk/projects/compass/extensions/checkers/pointerComparison)

Deleted: branches/rice/projects/compass/extensions/checkers/pointerComparison/compass_parameters
===================================================================
--- trunk/projects/compass/extensions/checkers/pointerComparison/compass_parameters	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/compass_parameters	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,4 +0,0 @@
-# This is a comment
-#
-# This is commented out but shows the way parameters are specified.
-# LineLengthChecker.maximumLineLength=80

Copied: branches/rice/projects/compass/extensions/checkers/pointerComparison/compass_parameters (from rev 117, trunk/projects/compass/extensions/checkers/pointerComparison/compass_parameters)
===================================================================
--- branches/rice/projects/compass/extensions/checkers/pointerComparison/compass_parameters	                        (rev 0)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/compass_parameters	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,4 @@
+# This is a comment
+#
+# This is commented out but shows the way parameters are specified.
+# LineLengthChecker.maximumLineLength=80

Deleted: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.C
===================================================================
--- trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparison.C	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,110 +0,0 @@
-// -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*-
-// vim: expandtab:shiftwidth=2:tabstop=2
-
-// Pointer Comparison Analysis
-// Author: Chunhua Liao
-// Date: 30-October-2008
-
-#include "compass.h"
-
-extern const Compass::Checker* const pointerComparisonChecker;
-
-namespace CompassAnalyses
-   { 
-     namespace PointerComparison
-        { 
-        /*! \brief Pointer Comparison: Add your description here 
-         */
-
-       // Specification of Checker Output Implementation
-          class CheckerOutput: public Compass::OutputViolationBase
-             { 
-               public:
-                    CheckerOutput(SgNode* node);
-             };
-
-       // Specification of Checker Traversal Implementation
-
-          class Traversal
-             : public Compass::AstSimpleProcessingWithRunFunction 
-             {
-                    Compass::OutputObject* output;
-            // Checker specific parameters should be allocated here.
-
-               public:
-                    Traversal(Compass::Parameters inputParameters, Compass::OutputObject* output);
-
-                 // Change the implementation of this function if you are using inherited attributes.
-                    void *initialInheritedAttribute() const { return NULL; }
-
-                 // The implementation of the run function has to match the traversal being called.
-                 // If you use inherited attributes, use the following definition:
-                 // void run(SgNode* n){ this->traverse(n, initialInheritedAttribute()); }
-                    void run(SgNode* n){ this->traverse(n, preorder); }
-
-                 // Change this function if you are using a different type of traversal, e.g.
-                 // void *evaluateInheritedAttribute(SgNode *, void *);
-                 // for AstTopDownProcessing.
-                    void visit(SgNode* n);
-             };
-        }
-   }
-
-CompassAnalyses::PointerComparison::
-CheckerOutput::CheckerOutput ( SgNode* node )
-   : OutputViolationBase(node,::pointerComparisonChecker->checkerName,::pointerComparisonChecker->shortDescription)
-   {}
-
-CompassAnalyses::PointerComparison::Traversal::
-Traversal(Compass::Parameters inputParameters, Compass::OutputObject* output)
-   : output(output)
-   {
-  // Initalize checker specific parameters here, for example: 
-  // YourParameter = Compass::parseInteger(inputParameters["PointerComparison.YourParameter"]);
-
-
-   }
-
-void
-CompassAnalyses::PointerComparison::Traversal::
-visit(SgNode* node)
-   { 
-  // Implement your traversal here.  
-    SgBinaryOp* bin_op = isSgBinaryOp(node); 
-     if (bin_op)
-     {
-       if (isSgGreaterThanOp(node)||
-          isSgGreaterOrEqualOp(node)||
-          isSgLessThanOp(node)||
-          isSgLessOrEqualOp(node))
-        {
-          SgType* lhs_type = bin_op->get_lhs_operand()->get_type(); 
-          SgType* rhs_type = bin_op->get_rhs_operand()->get_type(); 
-          if (isSgPointerType(lhs_type)||isSgPointerType(rhs_type))
-            output->addOutput(new CheckerOutput(bin_op));
-        } 
-      }// end if bin_op
-   } //End of the visit function.
-
-// Checker main run function and metadata
-
-static void run(Compass::Parameters params, Compass::OutputObject* output) {
-  CompassAnalyses::PointerComparison::Traversal(params, output).run(Compass::projectPrerequisite.getProject());
-}
-
-// Remove this function if your checker is not an AST traversal
-static Compass::AstSimpleProcessingWithRunFunction* createTraversal(Compass::Parameters params, Compass::OutputObject* output) {
-  return new CompassAnalyses::PointerComparison::Traversal(params, output);
-}
-
-extern const Compass::Checker* const pointerComparisonChecker =
-  new Compass::CheckerUsingAstSimpleProcessing(
-        "PointerComparison",
-     // Descriptions should not include the newline character "\n".
-        "Warning: Error-prone pointer comparison using <,<=,>,or >=",
-        "Test if relational operations such as <,<=,>,>= are used to compare data of pointer types. Pointer comparisons depend on memory locations of data, which are not consistent across different executions or platforms and can cause bugs which are very difficult to find.",
-        Compass::C | Compass::Cpp,
-        Compass::PrerequisiteList(1, &Compass::projectPrerequisite),
-        run,
-        createTraversal);
-   

Copied: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.C (from rev 117, trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparison.C)
===================================================================
--- branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.C	                        (rev 0)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,110 @@
+// -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*-
+// vim: expandtab:shiftwidth=2:tabstop=2
+
+// Pointer Comparison Analysis
+// Author: Chunhua Liao
+// Date: 30-October-2008
+
+#include "compass.h"
+
+extern const Compass::Checker* const pointerComparisonChecker;
+
+namespace CompassAnalyses
+   { 
+     namespace PointerComparison
+        { 
+        /*! \brief Pointer Comparison: Add your description here 
+         */
+
+       // Specification of Checker Output Implementation
+          class CheckerOutput: public Compass::OutputViolationBase
+             { 
+               public:
+                    CheckerOutput(SgNode* node);
+             };
+
+       // Specification of Checker Traversal Implementation
+
+          class Traversal
+             : public Compass::AstSimpleProcessingWithRunFunction 
+             {
+                    Compass::OutputObject* output;
+            // Checker specific parameters should be allocated here.
+
+               public:
+                    Traversal(Compass::Parameters inputParameters, Compass::OutputObject* output);
+
+                 // Change the implementation of this function if you are using inherited attributes.
+                    void *initialInheritedAttribute() const { return NULL; }
+
+                 // The implementation of the run function has to match the traversal being called.
+                 // If you use inherited attributes, use the following definition:
+                 // void run(SgNode* n){ this->traverse(n, initialInheritedAttribute()); }
+                    void run(SgNode* n){ this->traverse(n, preorder); }
+
+                 // Change this function if you are using a different type of traversal, e.g.
+                 // void *evaluateInheritedAttribute(SgNode *, void *);
+                 // for AstTopDownProcessing.
+                    void visit(SgNode* n);
+             };
+        }
+   }
+
+CompassAnalyses::PointerComparison::
+CheckerOutput::CheckerOutput ( SgNode* node )
+   : OutputViolationBase(node,::pointerComparisonChecker->checkerName,::pointerComparisonChecker->shortDescription)
+   {}
+
+CompassAnalyses::PointerComparison::Traversal::
+Traversal(Compass::Parameters inputParameters, Compass::OutputObject* output)
+   : output(output)
+   {
+  // Initalize checker specific parameters here, for example: 
+  // YourParameter = Compass::parseInteger(inputParameters["PointerComparison.YourParameter"]);
+
+
+   }
+
+void
+CompassAnalyses::PointerComparison::Traversal::
+visit(SgNode* node)
+   { 
+  // Implement your traversal here.  
+    SgBinaryOp* bin_op = isSgBinaryOp(node); 
+     if (bin_op)
+     {
+       if (isSgGreaterThanOp(node)||
+          isSgGreaterOrEqualOp(node)||
+          isSgLessThanOp(node)||
+          isSgLessOrEqualOp(node))
+        {
+          SgType* lhs_type = bin_op->get_lhs_operand()->get_type(); 
+          SgType* rhs_type = bin_op->get_rhs_operand()->get_type(); 
+          if (isSgPointerType(lhs_type)||isSgPointerType(rhs_type))
+            output->addOutput(new CheckerOutput(bin_op));
+        } 
+      }// end if bin_op
+   } //End of the visit function.
+
+// Checker main run function and metadata
+
+static void run(Compass::Parameters params, Compass::OutputObject* output) {
+  CompassAnalyses::PointerComparison::Traversal(params, output).run(Compass::projectPrerequisite.getProject());
+}
+
+// Remove this function if your checker is not an AST traversal
+static Compass::AstSimpleProcessingWithRunFunction* createTraversal(Compass::Parameters params, Compass::OutputObject* output) {
+  return new CompassAnalyses::PointerComparison::Traversal(params, output);
+}
+
+extern const Compass::Checker* const pointerComparisonChecker =
+  new Compass::CheckerUsingAstSimpleProcessing(
+        "PointerComparison",
+     // Descriptions should not include the newline character "\n".
+        "Warning: Error-prone pointer comparison using <,<=,>,or >=",
+        "Test if relational operations such as <,<=,>,>= are used to compare data of pointer types. Pointer comparisons depend on memory locations of data, which are not consistent across different executions or platforms and can cause bugs which are very difficult to find.",
+        Compass::C | Compass::Cpp,
+        Compass::PrerequisiteList(1, &Compass::projectPrerequisite),
+        run,
+        createTraversal);
+   

Deleted: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.compass.external.makefile
===================================================================
--- trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparison.compass.external.makefile	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.compass.external.makefile	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,34 +0,0 @@
-# Set Variables ROSE_INSTALL to your ROSE_INSTALL installation and
-# COMPASS_SUPPORT to your compassSupport directory like this:
-#ROSE_INSTALL=ROSE-INSTALL-DIRECTORY
-#COMPASS_PROJECT=COMPASS-PROJECT-DIRECTORY
-#COMPASS_SUPPORT=${COMPASS_PROJECT}/src/compassSupport
-
-CHECKER_NAME = pointerComparisonTest
-
-LINKER_FLAGS = -L$(ROSE_INSTALL)/lib -Wl,-rpath $(ROSE_INSTALL)/lib -lrose $(RT_LIBS) -L`pwd` -Wl,-rpath `pwd` -lcompass
-
-all: prerequisites.h instantiate_prerequisites.h pointerComparisonTest
-
-prerequisites.h: $(COMPASS_PROJECT)/extensions/prerequisites
-	find $(COMPASS_PROJECT)/extensions/prerequisites -name "*.h" | awk -F/ '{print "#include \"" $$NF "\""}' > $@
-
-instantiate_prerequisites.h: $(COMPASS_PROJECT)/extensions/prerequisites
-	cat $(COMPASS_PROJECT)/extensions/prerequisites/*.h | grep "^extern" | sed -e 's at extern[\t\ ]*@Compass::@g' | awk '{print $$1 " Compass::" $$2}' > $@
-
-
-libcompass.so: $(COMPASS_PROJECT)/src/compassSupport/compass.h $(COMPASS_PROJECT)/src/compassSupport/compass.C prerequisites.h instantiate_prerequisites.h
-	g++ -fPIC -Wall -shared -o $@ $(COMPASS_PROJECT)/src/compassSupport/compass.C -I$(ROSE_INSTALL)/include -I$(COMPASS_PROJECT)/src/compassSupport -I$(COMPASS_PROJECT)/extensions/prerequisites -I.
-
-# GMY: The order of source files during compilation is important due to the use
-# of extern. The checker source code must follow the main source or else the
-# executable is likely to seg. fault.
-pointerComparisonTest: pointerComparison.C pointerComparisonMain.C libcompass.so $(COMPASS_PROJECT)/src/compassSupport/compassTestMain.C
-	g++ -fPIC -Wall -o $@ pointerComparisonMain.C pointerComparison.C -I$(COMPASS_PROJECT)/src/compassSupport -I$(ROSE_INSTALL)/include -I$(COMPASS_PROJECT)/extensions/prerequisites -I. $(LINKER_FLAGS)
-
-test: pointerComparisonTest pointerComparisonTest1.C
-	./pointerComparisonTest pointerComparisonTest1.C
-
-clean:
-	rm -f libcompass.so "pointerComparisonTest"
-

Copied: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.compass.external.makefile (from rev 117, trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparison.compass.external.makefile)
===================================================================
--- branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.compass.external.makefile	                        (rev 0)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.compass.external.makefile	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,34 @@
+# Set Variables ROSE_INSTALL to your ROSE_INSTALL installation and
+# COMPASS_SUPPORT to your compassSupport directory like this:
+#ROSE_INSTALL=ROSE-INSTALL-DIRECTORY
+#COMPASS_PROJECT=COMPASS-PROJECT-DIRECTORY
+#COMPASS_SUPPORT=${COMPASS_PROJECT}/src/compassSupport
+
+CHECKER_NAME = pointerComparisonTest
+
+LINKER_FLAGS = -L$(ROSE_INSTALL)/lib -Wl,-rpath $(ROSE_INSTALL)/lib -lrose $(RT_LIBS) -L`pwd` -Wl,-rpath `pwd` -lcompass
+
+all: prerequisites.h instantiate_prerequisites.h pointerComparisonTest
+
+prerequisites.h: $(COMPASS_PROJECT)/extensions/prerequisites
+	find $(COMPASS_PROJECT)/extensions/prerequisites -name "*.h" | awk -F/ '{print "#include \"" $$NF "\""}' > $@
+
+instantiate_prerequisites.h: $(COMPASS_PROJECT)/extensions/prerequisites
+	cat $(COMPASS_PROJECT)/extensions/prerequisites/*.h | grep "^extern" | sed -e 's at extern[\t\ ]*@Compass::@g' | awk '{print $$1 " Compass::" $$2}' > $@
+
+
+libcompass.so: $(COMPASS_PROJECT)/src/compassSupport/compass.h $(COMPASS_PROJECT)/src/compassSupport/compass.C prerequisites.h instantiate_prerequisites.h
+	g++ -fPIC -Wall -shared -o $@ $(COMPASS_PROJECT)/src/compassSupport/compass.C -I$(ROSE_INSTALL)/include -I$(COMPASS_PROJECT)/src/compassSupport -I$(COMPASS_PROJECT)/extensions/prerequisites -I.
+
+# GMY: The order of source files during compilation is important due to the use
+# of extern. The checker source code must follow the main source or else the
+# executable is likely to seg. fault.
+pointerComparisonTest: pointerComparison.C pointerComparisonMain.C libcompass.so $(COMPASS_PROJECT)/src/compassSupport/compassTestMain.C
+	g++ -fPIC -Wall -o $@ pointerComparisonMain.C pointerComparison.C -I$(COMPASS_PROJECT)/src/compassSupport -I$(ROSE_INSTALL)/include -I$(COMPASS_PROJECT)/extensions/prerequisites -I. $(LINKER_FLAGS)
+
+test: pointerComparisonTest pointerComparisonTest1.C
+	./pointerComparisonTest pointerComparisonTest1.C
+
+clean:
+	rm -f libcompass.so "pointerComparisonTest"
+

Deleted: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.inc
===================================================================
--- trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparison.inc	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.inc	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,8 +0,0 @@
-# This is an automatically generated file
-# This example shows how to automake checkers that use boost
-# if ROSE_USE_BOOST_WAVE
-#
-#  LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) compassSupport/libCompass.la
-#  $(compass_detector_libs) -lboost_regex- at BOOST_LIB_SUFFIX@ $(LDADD)
-#
-# endif

Copied: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.inc (from rev 117, trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparison.inc)
===================================================================
--- branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.inc	                        (rev 0)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparison.inc	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,8 @@
+# This is an automatically generated file
+# This example shows how to automake checkers that use boost
+# if ROSE_USE_BOOST_WAVE
+#
+#  LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) compassSupport/libCompass.la
+#  $(compass_detector_libs) -lboost_regex- at BOOST_LIB_SUFFIX@ $(LDADD)
+#
+# endif

Deleted: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonDocs.tex
===================================================================
--- trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparisonDocs.tex	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonDocs.tex	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,56 +0,0 @@
-% 9.5.07
-% This is a sample documentation for Compass in the tex format.
-% We restrict the use of tex to the following subset of commands:
-%
-% \section, \subsection, \subsubsection, \paragraph
-% \begin{enumerate} (no-nesting), \begin{quote}, \item
-% {\tt ... }, {\bf ...}, {\it ... }
-% \htmladdnormallink{}{}
-% \begin{verbatim}...\end{verbatim} is reserved for code segments
-% ...''
-%
-
-\section{Pointer Comparison}
-\label{PointerComparison::overview}
-
-This checker tries to find comparison operations involving
-pointers. These comparison results are determined by the memory locations of
-the objects pointed to in the program's address space. Using $==$ is usually
-safe. But using $<$, $<=$,$>$, and $>=$ is error-prone given the
-uncertainty of memory locations of objects across executions and platforms. 
-
-\subsection{Parameter Requirements}
-
-%Write the Parameter specification here.
-There is not parameter requirement.
-
-\subsection{Implementation}
-
-%Details of the implementation go here.
-The checker finds relational operators such as $<$ , $<=$,$>$, and $>=$
-and sends out warnings if at least one of their operands is of pointer types.
-
-\subsection{Non-Compliant Code Example}
-
-% write your non-compliant code subsection
-Here is the original code piece which inspired this checker. 
-It assumes in the ROSE AST, a parent scope node resides in a memory location of smaller
-address compared to the address of its descendent scope node. 
-This assumption is wrong given the difference of memory management across
-platforms or even executions. A right solution is to walk the AST tree to
-find out their relationship.
-\begin{verbatim}
-
-SgScopeStatement * scope1, * scope2; 
-// ....
-if (scope1<scope2)
-  //
-else
-  //
-
-\end{verbatim}
-
-\subsection{References}
-No reference.
-% Write some references
-% ex. \htmladdnormallink{ISO/IEC 9899-1999:TC2}{https://www.securecoding.cert.org/confluence/display/seccode/AA.+C+References} Forward, Section 6.9.1, Function definitions''

Copied: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonDocs.tex (from rev 117, trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparisonDocs.tex)
===================================================================
--- branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonDocs.tex	                        (rev 0)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonDocs.tex	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,56 @@
+% 9.5.07
+% This is a sample documentation for Compass in the tex format.
+% We restrict the use of tex to the following subset of commands:
+%
+% \section, \subsection, \subsubsection, \paragraph
+% \begin{enumerate} (no-nesting), \begin{quote}, \item
+% {\tt ... }, {\bf ...}, {\it ... }
+% \htmladdnormallink{}{}
+% \begin{verbatim}...\end{verbatim} is reserved for code segments
+% ...''
+%
+
+\section{Pointer Comparison}
+\label{PointerComparison::overview}
+
+This checker tries to find comparison operations involving
+pointers. These comparison results are determined by the memory locations of
+the objects pointed to in the program's address space. Using $==$ is usually
+safe. But using $<$, $<=$,$>$, and $>=$ is error-prone given the
+uncertainty of memory locations of objects across executions and platforms. 
+
+\subsection{Parameter Requirements}
+
+%Write the Parameter specification here.
+There is not parameter requirement.
+
+\subsection{Implementation}
+
+%Details of the implementation go here.
+The checker finds relational operators such as $<$ , $<=$,$>$, and $>=$
+and sends out warnings if at least one of their operands is of pointer types.
+
+\subsection{Non-Compliant Code Example}
+
+% write your non-compliant code subsection
+Here is the original code piece which inspired this checker. 
+It assumes in the ROSE AST, a parent scope node resides in a memory location of smaller
+address compared to the address of its descendent scope node. 
+This assumption is wrong given the difference of memory management across
+platforms or even executions. A right solution is to walk the AST tree to
+find out their relationship.
+\begin{verbatim}
+
+SgScopeStatement * scope1, * scope2; 
+// ....
+if (scope1<scope2)
+  //
+else
+  //
+
+\end{verbatim}
+
+\subsection{References}
+No reference.
+% Write some references
+% ex. \htmladdnormallink{ISO/IEC 9899-1999:TC2}{https://www.securecoding.cert.org/confluence/display/seccode/AA.+C+References} Forward, Section 6.9.1, Function definitions''

Deleted: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonMain.C
===================================================================
--- trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparisonMain.C	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonMain.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,10 +0,0 @@
-//
-// Do not modify this file
-//
-
-#include "compass.h"
-extern const Compass::Checker* const pointerComparisonChecker;
-extern const Compass::Checker* const myChecker = pointerComparisonChecker;
-
-#include "compass.C"
-#include "compassTestMain.C"

Copied: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonMain.C (from rev 117, trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparisonMain.C)
===================================================================
--- branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonMain.C	                        (rev 0)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonMain.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,10 @@
+//
+// Do not modify this file
+//
+
+#include "compass.h"
+extern const Compass::Checker* const pointerComparisonChecker;
+extern const Compass::Checker* const myChecker = pointerComparisonChecker;
+
+#include "compass.C"
+#include "compassTestMain.C"

Deleted: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonTest1.C
===================================================================
--- trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparisonTest1.C	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonTest1.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,23 +0,0 @@
-//Test code using pointer comparison
-typedef struct gun{
-   char name [256];
-   int magzing_size;
-   float calibre;
-} gun_t; 
-
-int main()
-{
-  gun_t gun1,gun2;
-  gun_t *gun1_p, *gun2_p;
-
-  gun1_p = & gun1;
-  gun2_p = & gun2;
-
-  if (gun1_p<gun2_p)
-  {
-    return 0;
-  }
-  else
-    return 1;
-}
-

Copied: branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonTest1.C (from rev 117, trunk/projects/compass/extensions/checkers/pointerComparison/pointerComparisonTest1.C)
===================================================================
--- branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonTest1.C	                        (rev 0)
+++ branches/rice/projects/compass/extensions/checkers/pointerComparison/pointerComparisonTest1.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,23 @@
+//Test code using pointer comparison
+typedef struct gun{
+   char name [256];
+   int magzing_size;
+   float calibre;
+} gun_t; 
+
+int main()
+{
+  gun_t gun1,gun2;
+  gun_t *gun1_p, *gun2_p;
+
+  gun1_p = & gun1;
+  gun2_p = & gun2;
+
+  if (gun1_p<gun2_p)
+  {
+    return 0;
+  }
+  else
+    return 1;
+}
+

Modified: branches/rice/projects/compass/extensions/prerequisites/BinDataFlowPrerequisite.h
===================================================================
--- branches/rice/projects/compass/extensions/prerequisites/BinDataFlowPrerequisite.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/extensions/prerequisites/BinDataFlowPrerequisite.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -30,9 +30,8 @@
       graph = new RoseBin_DotGraph(info);
       ROSE_ASSERT(graph);
 
-      const SgAsmInterpretationPtrList& interps = file->get_interpretations();
-      ROSE_ASSERT (interps.size() == 1);
-      dfanalysis = new RoseBin_DataFlowAnalysis(interps[0]->get_global_block(), forward, new RoseObj(), info);
+      SgAsmInterpretation* interp = SageInterface::getMainInterpretation(file);
+      dfanalysis = new RoseBin_DataFlowAnalysis(interp->get_global_block(), forward, new RoseObj(), info);
       dfanalysis->init(interprocedural, edges);
       dfanalysis->run(graph, dfgFileName, mergedEdges);
 

Modified: branches/rice/projects/compass/src/compassSupport/compass.C
===================================================================
--- branches/rice/projects/compass/src/compassSupport/compass.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/src/compassSupport/compass.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -3,6 +3,9 @@
 #endif
 
 #include "compass.h"
+
+//for exists
+#include "boost/filesystem/operations.hpp"
 #include <rose.h>
 #include <sstream>
 #include <fstream>
@@ -306,8 +309,19 @@
 
 std::ifstream* Compass::openFile(std::string filename)
 {
+
+ 
+  if( boost::filesystem::exists(filename) == false )  
+  {
+//    std::cerr << "Error: Please specify which checkers you want to run in " << filename << std::endl;
+    std::cerr << "Error: Filename " << filename << " does not exists. " << std::endl;
+    abort();
+
+  }
   std::ifstream* streamPtr = new std::ifstream(filename.c_str());
+
   ROSE_ASSERT(streamPtr != NULL);
+  ROSE_ASSERT(streamPtr->good());
 
   return streamPtr;
 
@@ -367,6 +381,10 @@
   if (getenv("COMPASS_PARAMETERS")) {
     filename = getenv("COMPASS_PARAMETERS");
   }
+  else 
+  {
+    std::cout<<"Warning: environment variable COMPASS_PARAMETERS is not set, trying to use compass_parameters of the current path"<<std::endl;
+  }
   return filename;
 }
 

Modified: branches/rice/projects/compass/src/compass_scripts/compass_template_generator/compass.C
===================================================================
--- branches/rice/projects/compass/src/compass_scripts/compass_template_generator/compass.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/src/compass_scripts/compass_template_generator/compass.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -3,6 +3,9 @@
 #endif
 
 #include "compass.h"
+
+//for exists
+#include "boost/filesystem/operations.hpp"
 #include <rose.h>
 #include <sstream>
 #include <fstream>
@@ -306,8 +309,19 @@
 
 std::ifstream* Compass::openFile(std::string filename)
 {
+
+ 
+  if( boost::filesystem::exists(filename) == false )  
+  {
+//    std::cerr << "Error: Please specify which checkers you want to run in " << filename << std::endl;
+    std::cerr << "Error: Filename " << filename << " does not exists. " << std::endl;
+    abort();
+
+  }
   std::ifstream* streamPtr = new std::ifstream(filename.c_str());
+
   ROSE_ASSERT(streamPtr != NULL);
+  ROSE_ASSERT(streamPtr->good());
 
   return streamPtr;
 
@@ -367,6 +381,10 @@
   if (getenv("COMPASS_PARAMETERS")) {
     filename = getenv("COMPASS_PARAMETERS");
   }
+  else 
+  {
+    std::cout<<"Warning: environment variable COMPASS_PARAMETERS is not set, trying to use compass_parameters of the current path"<<std::endl;
+  }
   return filename;
 }
 

Modified: branches/rice/projects/compass/tools/compass/CHECKER_LIST
===================================================================
--- branches/rice/projects/compass/tools/compass/CHECKER_LIST	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/tools/compass/CHECKER_LIST	2008-11-11 22:06:33 UTC (rev 119)
@@ -83,6 +83,7 @@
 operatorOverloading
 otherArgument
 placeConstantOnTheLhs
+pointerComparison
 preferAlgorithms
 preferFseekToRewind
 preferSetvbufToSetbuf

Modified: branches/rice/projects/compass/tools/compass/RULE_SELECTION.in
===================================================================
--- branches/rice/projects/compass/tools/compass/RULE_SELECTION.in	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/tools/compass/RULE_SELECTION.in	2008-11-11 22:06:33 UTC (rev 119)
@@ -80,6 +80,7 @@
 +:OperatorOverloading
 +:OtherArgument
 +:PlaceConstantOnTheLhs
++:PointerComparison
 +:PreferAlgorithms
 +:PreferFseekToRewind
 +:PreferSetvbufToSetbuf

Modified: branches/rice/projects/compass/tools/compass/buildCheckers.C
===================================================================
--- branches/rice/projects/compass/tools/compass/buildCheckers.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/tools/compass/buildCheckers.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -144,6 +144,7 @@
 BUILD_ONE_CHECKER(operatorOverloading)
 BUILD_ONE_CHECKER(otherArgument)
 BUILD_ONE_CHECKER(placeConstantOnTheLhs)
+BUILD_ONE_CHECKER(pointerComparison)
 BUILD_ONE_CHECKER(preferAlgorithms)
 BUILD_ONE_CHECKER(preferFseekToRewind)
 BUILD_ONE_CHECKER(preferSetvbufToSetbuf)

Modified: branches/rice/projects/compass/tools/compass/checkers.h
===================================================================
--- branches/rice/projects/compass/tools/compass/checkers.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/tools/compass/checkers.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -79,6 +79,7 @@
 extern const Compass::Checker* const operatorOverloadingChecker;
 extern const Compass::Checker* const otherArgumentChecker;
 extern const Compass::Checker* const placeConstantOnTheLhsChecker;
+extern const Compass::Checker* const pointerComparisonChecker;
 extern const Compass::Checker* const preferAlgorithmsChecker;
 extern const Compass::Checker* const preferFseekToRewindChecker;
 extern const Compass::Checker* const preferSetvbufToSetbufChecker;

Modified: branches/rice/projects/compass/tools/compass/doc/Makefile.am
===================================================================
--- branches/rice/projects/compass/tools/compass/doc/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/tools/compass/doc/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -39,10 +39,11 @@
 	ToolGear_gui_compass_01.pdf \
 	ToolGear_gui_compass_01.png \
 	usingCompass.tex \
+	compass_categories.tex \
 	usingCompassVerifier.tex
 
 clean-local:
 	find . -type l -maxdepth 1 -exec rm {} \;
 	rm -f *.log *.out *.aux *.toc
 
-CLEANFILES = compassCheckerDocs.tex
+CLEANFILES = compassCheckerDocs.tex compass.pdf 

Modified: branches/rice/projects/compass/tools/compass/doc/compass.tex.in
===================================================================
--- branches/rice/projects/compass/tools/compass/doc/compass.tex.in	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/tools/compass/doc/compass.tex.in	2008-11-11 22:06:33 UTC (rev 119)
@@ -182,13 +182,15 @@
 
 \input{usingCompassVerifier}
 
+\newpage
 
+\input{compass_categories}
 
 
 % Put the list of detector documentation here
 \newpage
 
-\chapter{Compass Checkers}
+\chapter{List of Compass Checkers}
 
 \input{compassCheckerDocs}
 

Copied: branches/rice/projects/compass/tools/compass/doc/compass_categories.tex (from rev 117, trunk/projects/compass/tools/compass/doc/compass_categories.tex)
===================================================================
--- branches/rice/projects/compass/tools/compass/doc/compass_categories.tex	                        (rev 0)
+++ branches/rice/projects/compass/tools/compass/doc/compass_categories.tex	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,162 @@
+\chapter{Categories of Compass Checkers}
+All available Compass checkers can be roughly categorized as follows:
+
+\section{Common Styles}
+\begin{itemize}
+\item forLoopConstructionControlStmt: for () loop must only include statements that control the loop or related to the loop control
+\item inductionVariableUpdate: Do not alter a control variable more than once in a loop
+\item uninitializedDefinition: Always initial variables at their initial declaration
+\item unaryMinus: Do not use unary minus on unsigned types
+\item noGoto: Do not use goto
+\item nonAssociativeRelationalOperators: Do not associate relational
+operators (e.g. $a==b==c$)
+\item magicNumber: Avoid using integer or floating point literals outside of initializer expressions.
+\item nameAllParameters: Every function parameters should has a name in a function declaration
+\item oneLinePerDeclaration: Do not declare more than one variable in a single declaration statement. 
+\item placeConstantOnTheLhs: Always put constant on the left side for comparison expressions
+\item functionDefinitionPrototype: Every function should have a function prototype
+\end{itemize}
+
+\section{C styles}
+\begin{itemize}
+\item allocateAndFreeMemoryInTheSameModuleAtTheSameLevelOfAbstraction: malloc()/ free() in a same piece of code to avoid mismatch
+\item discardAssignment: assignment operator should be used as a stand-alone expression statement.
+\item setPointersToNull: Always set pointers to NULL after they have been freed by free()
+\end{itemize}
+
+\section{C++ styles}
+\begin{itemize}
+\item assignmentOperatorCheckSelf: check self-assignment in assignment operator
+\item assignmentReturnConstThis:  operator= return type
+\item booleanIsHas: functions returning boolean should have names like isXXX or hasXXX
+\item constCast: should never cast the constness away
+\item constructorDestructorCallsVirtualFunction : Don't directly/indirectly call virtual functions from constructors or destructors: pure virtual function become undefined behaviors
+\item copyConstructorConstArg: copy constructors should use const reference as an argument
+\item cppCallsSetjmpLongjmp: should not use C style setjmp() and long jmp() in C++ code
+\item dataMemberAccess: Good classes should not have both public and non-public data members. 
+\item defaultConstructor: Each class should have a user defined default constructor
+\item doNotUseCstyleCasts: Do not use C-style casts in C++ code
+\item dynamicCast: Downcast should be done using a dynamic cast
+\item enumDeclarationNamespaceClassScope: enum types should be declared within a class or namespace. 
+\item explicitCopy: A class should have a user-defined copy constructor and a copy operator, unless annotated to use default ones
+\item forLoopCppIndexVariableDeclaration: C++ loop index variable should be declared in for (...)
+\item friendDeclarationModifier: Avoid using friend declarations
+\item internalDataSharing: Class member functions should not expose data member handles
+\item voidStar: Public methods should not use void* for arguments or return types. 
+\item noExceptions: Avoid using C++ exceptions
+\item nonmemberFunctionInterfaceNamespace: Keep classes and their non-member interfaces (friend functions) within the same namespace
+\item multiplePublicInheritance: Avoid multiple public inheritance
+\item noTemplateUsage: Do not use C++ templates
+\item protectVirtualMethods: Do not expose virtual methods as public interface
+\item singleParameterConstructorExplicitModifier: Single parameter constructor used as converting constructor should have the 'explicit' modifier
+\end{itemize}
+
+\section{Correctness}
+\begin{itemize}
+\item cycleDetection: control flow graph of code should not contain cycles
+\item defaultCase: Each switch statement should have a default case
+\item doNotCallPutenvWithAutoVar: Do not use an auto/local variable as the parameter of putenv()
+\item noExitInMpiCode: No exit() from within a parallel code portion (MPI)
+\item sizeOfPointer: Do not computing sizeof(pointer) when you want to get the size of object pointed to. 
+\item newDelete: Detect several common mistakes when using new, delete: deleting array using delete, not delete[]; deleting NULL pointers; deleting uninitialized pointers
+\item mallocReturnValueUsedInIfStmt: Always check the return value for malloc() and new
+\item nullDeref: Several checkers for NULL pointers: checking a pointer's validity before dereferencing it; Do not reference unitialized variables
+\item floatingPointExactComparison: Avoid exact comparisons between a variable to a floating point value
+\item floatForLoopCounter:  floating point variables should not be used as loop counters
+\end{itemize}
+
+\section{Security}
+\begin{itemize}
+\item allowedFunctions: security analysis, limit the use to a set of allowed functions
+\item forbiddenFunctions: Avoid using a set of dangerous functions
+\item avoidUsingTheSameHandlerForMultipleSignals: dedicated handler for each signal
+\item constStringLiterals: protect string literals using const qualification
+\item doNotDeleteThis: Do not delete 'this' pointer
+\item functionCallAllocatesMultipleResources: Avoid allocating multiple resources within a single statement(e.g. a function call)
+\item rightShiftMask: Always use a shift mask for $>>$ to avoid buffer overflow
+\end{itemize}
+
+\section{Portability}
+\begin{itemize}
+\item charStarForString: C strings must be used instead of STL strings
+\item fopenFormatParameter: Format parameter of fopen() should not contain non-portable value
+\item noAsmStmtsOps: warn the use of embedded assembly code
+\end{itemize}
+
+\section{Clarity}
+\begin{itemize}
+\item explicitTestForNonBooleanValue: Non-boolean values should be compared to explicit values of the same type. 
+\item localizedVariables: Variable declaration should be close to its first use.
+\item functionDocumentation: Every function should have documentation/comments
+\item variableNameEqualsDatabaseName: Member functions accessing local variables that get assigned. The result of the function call should have a name equal to the first argument
+\item ternaryOperator: Prefer explicit conditional statements to ternary operator a?x:y
+\end{itemize}
+
+\section{Complexity}
+\begin{itemize}
+\item computationalFunctions: check functions exceeding max allowed computation operations
+\item cyclomaticComplexity: a function should not exceed a complexity threshold
+\item deepNesting: functions should not exceed a threshold for scopes inside its body. (too complex)
+\item locPerFunction: A function should not contain code exceeding a line count threshold
+\end{itemize}
+
+\section{Consistency}
+\begin{itemize}
+\item lowerRangeLimit: Always use inclusive lower limits and exclusive upper limits
+\item upperRangeLimit: same as lower range limit: always using inclusive lower limits and exclusive upper limit
+\item otherArgument: Always name the parameter as 'other', 'that', or lower case of the class name, for copy constructors
+\end{itemize}
+
+\section{Better choices}
+\begin{itemize}
+\item stringTokenToIntegerConverter: Prefer strtol()/strtoll() to atoi()/atol()/atoll() for better error handling
+\item preferFseekToRewind: Prefer fseek() to rewind() since fseek() has return code
+\item preferSetvbufToSetbuf: Prefer setvbuf() to setbuf() for better error checking
+\item preferAlgorithms: Warning hand writing loops when equivalent STL algorithms exist
+\end{itemize}
+
+\section{Dangerous choices}
+\begin{itemize}
+\item commaOperator: avoid using this confusing language features (,)
+\item noSecondTermSideEffects: No side effects for second (and beyond)
+logical operator in expressions with combined \&\$ and ||. 
+\item noSideEffectInSizeof: Should not have side effects in sizeof(). 
+\item noVariadicFunctions: Do not use variadic functions: functions with varying parameter lists
+\item noVfork: Do not use vfork()
+\item operatorOverloading: Avoid operator overloading for \&\&, ||, or , . 
+\item pointerComparison: Avoid error-prone pointer comparison using
+$<$,$>$, $<=$,and $>=$
+\item noRand: Do not use the rand() function, 
+\item byteByByteStructureComparison: avoid byte-to-byte comparison between structures, they maybe padded.
+\item nonVirtualRedefinition: Do not redefine an inherited non-virtual functions in a class hierarchy.
+\item noOverloadAmpersand: Operator \& should not be overloaded
+\end{itemize}
+
+\section{Performance/Effectiveness}
+\begin{itemize}
+\item controlVariableTestAgainstFunction: Warning about loop control by comparing to a function call
+\item emptyInsteadOfSize: Using container.empty() instead of container.size()==0  
+\item pushBack: Warning the use of container.insert()/resize() which can be
+replaced by push\_back() or push\_front()
+\item nonStandardTypeRefArgs: Always pass objects by references, C++
+\item nonStandardTypeRefReturns: Always return objects by references, C++ 
+\end{itemize}
+
+\section{Misc or Undocumented}
+\begin{itemize}
+\item duffsDevice: Detect Duffs Device(a switch statement containing a loop that contains one of the switch's case or default labels.)
+\item explicitCharSign: ??
+\item fileReadOnlyAccess: Readonly access to fopen(), used internally for Compass Verifier
+\item time\_tDirectManipulation: Do not directly manipulate time\_t values. Use difftime()
+\item nameConsistency: 
+\item possiblyReplicatedVariables: 
+\item staticConstructorInitialization: 
+\item subExpressionEvaluationOrder: 
+\item typeTypedef: 
+\item binaryBufferOverflow
+\item binaryInterruptAnalysis
+\item binPrintAsmFunctions
+\item binPrintAsmInstruction
+\item asynchronousSignalHandler
+\item bufferOverflowFunctions
+\end{itemize}

Modified: branches/rice/projects/compass/tools/compass/doc/usingCompass.tex
===================================================================
--- branches/rice/projects/compass/tools/compass/doc/usingCompass.tex	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/compass/tools/compass/doc/usingCompass.tex	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,14 +1,50 @@
 \chapter{Using Compass}
+Compass is currently distributed as part of ROSE, and represents one
+of many tools that can be built using the ROSE open compiler infrastructure.
+The source code of Compass resides in the {\tt ROSE/projects/compass}.
+The compass project is currently divided into three subdirectories representing
+the compass infrastructure, extensions (checkers), and individual compass-like
+tools. As part of building ROSE Compass will be automatically built in the 
+compass directory. 
 
+\section{Installation}
+Please follow
+\htmladdnormallink{ROSE Installation
+Guide}{http://www.rosecompiler.org/ROSE_InstallationInstructions.pdf} to
+configure, make, and make install ROSE. The Compass executable file
+(compassMain) will be available from YOUR\_ROSE\_INSTALL\_PATH/bin. compassMain needs to know where to find its own configuration information from two
+files:
+\begin{itemize}
+\item compass\_parameters: configuration information for compass checkers.
+A default parameter file is generated in your ROSE build tree:
+buildrose/projects/compass/tools/compass/compass\_parameters. You can
+save a copy to your home directory for customization. 
+\item RULE\_SELECTION: This file lists which checkers to be used. A sample
+file is provided in the ROSE source tree:
+source/projects/compass/tools/compass/RULE\_SELECTION.in. You can save
+it as RULE\_SELECTION in your home directory and flip the $+$ or $-$ sign
+before each checker to turn on or off them when running compassMain. This
+file is specified as Compass.RuleSelection=/home/youraccount/RULE\_SELECTION
+inside of the compass\_parameters file.
+\end{itemize}
+
+After preparing compassMain's configuration files, you can set environment variables as follows (assuming using bash
+and you configured ROSE using --prefix=/home/youraccount/opt/roseLatest):
+
+\begin{verbatim}
+PATH=/home/youraccount/opt/roseLatest/bin:$PATH
+export PATH
+
+LD_LIBRARY_PATH=/home/youraccount/opt/roseLatest/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH
+
+export COMPASS_PARAMETERS=/home/youraccount/compass_parameters
+\end{verbatim}
+
+
 \section{Running Compass}
 
-    Compass is currently distributed as part of ROSE, and represents one
-of many tools that can be built using the ROSE open compiler infrastructure.
-Compass resides in the {\tt ROSE/projects/compass}.
-The compass project is currently divided into three subdirectories representing
-the compass instrastructure, extensions (checkers), and individual compass-like
-tools. As part of building ROSE Compass will be automatically built in the 
-compass directory.  Running compass is a matter if typing {\tt compassMain} 
+Once properly installed and configured, running compass is a matter if typing {\tt compassMain} 
 and handing in a number of options. The {\tt compassMain} program acts just 
 like a compiler so it is appropriate to hand it the same options required to 
 compile your source file (e.g {\tt -I} directory paths and a source file.  
@@ -18,6 +54,19 @@
 include/exclude options for path and file names as these will permit the 
 output from header files to be tailored.
 
+For example, to test a checker which warns about error-prone pointer
+comparison. You can modify RULE\_SELECTION to only turn on
+PointerComparison. A test input code (pointerComparisonTest1.C) is provided
+in sourcetree/projects/compass/extensions/checkers/pointerComparison. 
+\begin{verbatim}
+# command line to run compassMain on a source file
+compassMain pointerComparisonTest1.C
+# output of the command
+ Running Prerequisite SgProject
+Running checker PointerComparison
+PointerComparison: pointerComparisonTest1.C:16.7-19: 
+Warning: Error-prone pointer comparison using <,<=,>,or >=
+\end{verbatim}
 
 \section{Output from Compass}
 
@@ -273,7 +322,7 @@
 \begin{verbatim}
 " Vim compiler file
 " Compiler:     ROSE Compass 0.9.2a
-" Maintainer:   Chunhua Liao <liao6 at llnl.gov>
+" Maintainer:   Chunhua Liao <youraccount at llnl.gov>
 " Last Change:  2008 Apr. 3
 "
 if exists("current_compiler")
@@ -316,124 +365,7 @@
 \label{Compass_VIM7_Screenshot}
 \end{figure}
 
-%-------------------------------
-\clearpage
-\section{How To Write A New Checker}
 
-\subsection{Creating A Skeleton}
-
-Compass has scripts for creating a skeleton for a new Compass
-checker. This skeleton can be easily adapted to write all checkers.
-
-Follow these steps to generate a checker skeleton:
-\begin{enumerate}
-   \item Enter a directory where you want the directory of your checker to be created
-   \item Execute {\tt ROSE\_SRC\_DIR/projects/compass/src/compass\_scripts/gen\_checker.sh $<$name of your checker$>$}
-\end{enumerate}
-
-The results of executing gen\_checker.sh script is that a new directory name 
-``multipleCasesOnSameLine''
-(name of your checker in camel case) is created with the following files:
-
-\begin{verbatim}
-compass.C           multipleCasesOnSameLine.C
-compass.h           multipleCasesOnSameLineDocs.tex
-compass_parameters  multipleCasesOnSameLine.h
-compassTestMain.C   multipleCasesOnSameLine.inc
-Makefile            multipleCasesOnSameLineMain.C
-Makefile.am         multipleCasesOnSameLineTest1.C
-\end{verbatim}
-
-Some of these files (compass.[Ch], compass\_parameters, and compassTestMain.C)
-are copied from the compass\_template\_generator directory; while others are
-generated (multiple*, Makefile, Makefile.am)
-
-It is suggested that you keep the following in mind when using gen\_checker.sh:
-\begin{itemize}
-\item
-   It is advised that you do not invoke the script gen\_checker with words
-   like checker, detector, tester, etc. Adding these verbs at the command
-   line means that these words are added as suffixes into the
-   directory-name. Which will make it redundant, as the compass project is
-   about writing style-checkers!
-\item
-   Some of the files have read-only permissions and are intended only for
-   such use. Please do not change the permissions of these files.
-%\item
-%Advanced: The file `multipleCasesOnSameLine.inc' is used to pass in custom LDADD lines
-%to the Make environment on a per checker basis. The LDADD line specified in
-%this file will be added verbatim to the compass makefile.
-
-\end{itemize}
-
-\subsection{Integrating New Checkers Into Compass Tool}
-\label{howToIntegrateNewCheckers}
-
-The process for integrating a new checker into Compass has been automated. 
-These directions are meant for checkers generated using gen\_checker.sh. 
-The process is similar for all compass-like tools that are built using the 
-common instrastructure.
-
-The steps to integrate a new checker is
-\begin{enumerate}
-   \item Add $<$name of your checker$>$ to CHECKER\_LIST
-   \item Enter ROSE\_BUILD\_DIR/projects/compass/tools/compass
-   \item Execute 'make regenerate'
-   \item After running 'make regenerate' in the build tree then you may run make as usual.
-   \item %Before executing compassMain or any Make rule that uses compassMain, 
-	Examine the RULE\_SELECTION file and confirm it
-	reflects your most recent additional checker(s) choice of execution at
-	run-time; the default setting is ``on''. Please refer to section 
-	~\ref{ruleselection}.
-\end{enumerate}
-
-The file `CHECKER\_LIST' can use the `\#' comment delimiter at the beginning of
-any checker name to remove that checker from compilation. The hash mark may
-only appear at the beginning of the line. The compass\_submission\_setup.sh
-script must be run again with the ``regenerate'' option if any checkers are
-commented out. 
-{\bf Note that no space is permitted between the `\#' and the name
-of the checker.}
-
-Additionally, a blank checker may be automatically integrated into the current
-compass tool as a method to test for build system errors. To execute this test
-,type:
-%
-\begin{verbatim}
-make testNewChecker
-\end{verbatim}
-%
-from any compass tool directory. This test will create a blank checker from
-the template attempt to install the checker then uninstall it thus leaving the
-tool in its previous state.
-
-%Many automatically generated files required for the build of Compass are 
-%generated in the build tree. Rules for the generation of these files are found
-%in the automake Makefile.am file in the Compass source tree directory 
-%projects/compass. These file include:
-%
-%\begin{itemize}
-%\item {\bf CHECKER\_LIST\_WITHOUT\_COMMENTS}: a version of CHECKER\_LIST
-%	that expands in two columns those checkers built as part of Compass
-%	in camel case starting with a lower-case letter and an upper-case
-%	letter respectively.
-%
-%\item {\bf checkers.h}: An automatically generated file needed by compassMain.C that 
-%	contains a list of \#include directives for each checker header .h file.
-%
-%\item {\bf buildCheckers.C}: An automatically generated source file needed by 
-%	compassMain.C to build the Compass checker traversals.
-%
-%\item {\bf compass\_parameters}: The concatenation of individual checker parameter files to be used with compassMain.
-%
-%\item {\bf testNewChecker}: creates a blank checker from the template and
-%	attempts to automatically install it into the current compass tool then
-%	uninstall it again. This label is used to test the build system.
-%
-%\end{itemize}
-
-
-
 \section{Including/Excluding Checkers in the Compass Build Process}
 \label{CompassBuildProcess}
 
@@ -446,21 +378,20 @@
 list of checkers was secure, but for a static list of trusted checkers this is 
 possible.
 
-In order to integrate a checker into Compass the user must:
-\begin{itemize}
-   \item Add the name of the checkers directory in the CHECKER\_LIST in the compass
-      source directory
-   \item Run {\tt make regenerate} in the Compass build directory
-\end{itemize} 
-If a user or developer intends to integrate a new checker into the Compass 
-source tree refer to section \ref{howToIntegrateNewCheckers}.
+The file ROSE\_SOURCE\_DIR/projects/compass/tools/compass/CHECKER\_LIST is used to control which checkers are selected to
+be compiled into compassMain. It can use the `\#' comment delimiter at the beginning of
+any checker name to remove that checker from compilation. The hash mark may
+only appear at the beginning of the line. The compass\_submission\_setup.sh
+script must be run again with the ``regenerate'' option if any checkers are
+commented out. 
+{\bf Note that no space is permitted between the `\#' and the name
+of the checker.}
 
 Usually the CHECKER\_LIST is only modified when a user or developer wants to 
 add a new checker or select a subset of trusted checkers.  Checkers can be
 commented out using a {\tt \#}, no space is allowed between the {\tt \#} 
 and the checker name.
 
-
 \section{Including/Excluding Checkers During Compass Execution}
 \label{ruleselection}
 
@@ -478,13 +409,13 @@
 specific checkers by editing a single file (RULE\_SELECTION).  The name of this
 file is specified in the {\tt compass\_parameters} file, this name may be changed.
 The directories searched are: current directory, user home directory, and Compass
-source tree (respectively).
+source tree (respectively). \fixme{The current implementation may not
+support all of the mentioned search paths.}
 
 \begin{verbatim}
-   Compass.RuleSelection=RULE_SELECTION
+   Compass.RuleSelection=/path/to/your/RULE_SELECTION
 \end{verbatim}
 
-
 In order to select a checker to run the user must:
 \begin{itemize}
    \item Add a line '-:$<$name of checker$>$' in a file called RULE\_SELECTION. 
@@ -542,8 +473,128 @@
 \end{itemize}
 To run these tests type {\tt make check} at any level on the Compass directory
 hierarchy of the build tree.
+%-------------------------------
+\clearpage
+\section{How To Write A New Checker}
 
+\subsection{Creating A Skeleton}
 
+Compass has scripts for creating a skeleton for a new Compass
+checker. This skeleton can be easily adapted to write all checkers.
+
+Follow these steps to generate a checker skeleton:
+\begin{enumerate}
+   \item Enter a directory where you want the directory of your checker to
+   be created: For example,
+   rosesourcetree/projects/compass/extensions/checkers.
+   \item Execute {\tt
+   ROSE\_SRC\_DIR/projects/compass/src/compass\_scripts/gen\_checker.sh
+   $<$name of your checker$>$} (the name of your checker can have space and
+   the script will automatically concatenate them to camel case, e.g: 
+   "multiple case on same line")
+\end{enumerate}
+
+The results of executing gen\_checker.sh script is that a new directory name 
+``multipleCasesOnSameLine''
+(name of your checker in camel case) is created with the following files:
+\begin{itemize}
+\item compass\_parameters : internal parameters for this checker 
+\item multipleCasesOnSameLine.C : main source file 
+\item multipleCasesOnSameLine.compass.external.makefile : makefile if this
+checker is to be built outside of the ROSE source tree.
+\item multipleCasesOnSameLineDocs.tex : documentation 
+\item multipleCasesOnSameLine.inc : Makefile include file
+\item multipleCasesOnSameLine.h : header
+\item multipleCasesOnSameLineMain.C : main driver
+\item multipleCasesOnSameLineTest1.C : test input code
+\end{itemize}
+
+Some of these files (compass\_parameters)
+are copied from the compass\_template\_generator directory; while others are
+generated (multiple*, *.makefile)
+
+It is suggested that you keep the following in mind when using gen\_checker.sh:
+\begin{itemize}
+\item
+   It is advised that you do not invoke the script gen\_checker with words
+   like checker, detector, tester, etc. Adding these verbs at the command
+   line means that these words are added as suffixes into the
+   directory-name. Which will make it redundant, as the compass project is
+   about writing style-checkers!
+\item
+   Some of the files\fixme{What are the readonly files exactly?} have read-only permissions and are intended only for
+   such use. Please do not change the permissions of these files.
+%\item
+%Advanced: The file `multipleCasesOnSameLine.inc' is used to pass in custom LDADD lines
+%to the Make environment on a per checker basis. The LDADD line specified in
+%this file will be added verbatim to the compass makefile.
+
+\end{itemize}
+
+\subsection{Integrating New Checkers Into Compass Tool}
+\label{howToIntegrateNewCheckers}
+
+The process for integrating a new checker into Compass has been automated. 
+These directions are meant for checkers generated using gen\_checker.sh. 
+The process is similar for all compass-like tools that are built using the 
+common infrastructure.
+
+The steps to integrate a new checker is (note that both of the source tree and
+build tree of ROSE are involved):
+\begin{enumerate}
+   \item Add $<$camel case of your checker name $>$ to
+   ROSE\_SOURCE\_DIR/projects/compass/tools/compass/CHECKER\_LIST
+   \item Enter ROSE\_BUILD\_DIR/projects/compass/tools/compass
+   \item Execute 'make regenerate'
+   \item After running 'make regenerate' in the build tree then you may run make as usual.
+   \item Examine the ROSE\_SOURCE\_DIR/projects/compass/tools/compass/RULE\_SELECTION.in file and confirm it
+	reflects your most recent additional checker(s) choice of execution at
+	run-time; the default setting is ``on''. Please refer to section 
+	~\ref{ruleselection}.
+\end{enumerate}
+
+% Typing make testNewChecker manually will cause later make check fail
+% Not recommended to use, Liao, 10/31/2008
+%Additionally, a blank checker may be automatically integrated into the current
+%compass tool as a method to test for build system errors. To execute this test
+%,type:
+%
+%\begin{verbatim}
+%make testNewChecker
+%\end{verbatim}
+%
+%from any compass tool directory. This test will create a blank checker from
+%the template attempt to install the checker then uninstall it thus leaving the
+%tool in its previous state.
+
+%Many automatically generated files required for the build of Compass are 
+%generated in the build tree. Rules for the generation of these files are found
+%in the automake Makefile.am file in the Compass source tree directory 
+%projects/compass. These file include:
+%
+%\begin{itemize}
+%\item {\bf CHECKER\_LIST\_WITHOUT\_COMMENTS}: a version of CHECKER\_LIST
+%	that expands in two columns those checkers built as part of Compass
+%	in camel case starting with a lower-case letter and an upper-case
+%	letter respectively.
+%
+%\item {\bf checkers.h}: An automatically generated file needed by compassMain.C that 
+%	contains a list of \#include directives for each checker header .h file.
+%
+%\item {\bf buildCheckers.C}: An automatically generated source file needed by 
+%	compassMain.C to build the Compass checker traversals.
+%
+%\item {\bf compass\_parameters}: The concatenation of individual checker parameter files to be used with compassMain.
+%
+%\item {\bf testNewChecker}: creates a blank checker from the template and
+%	attempts to automatically install it into the current compass tool then
+%	uninstall it again. This label is used to test the build system.
+%
+%\end{itemize}
+
+
+
+
 \section{Extending the Compass Infrastructure}
 
 Compass, as well as being a tool for software analysis, is also a capable

Modified: branches/rice/projects/palette/rose.P
===================================================================
--- branches/rice/projects/palette/rose.P	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/projects/palette/rose.P	2008-11-11 22:06:33 UTC (rev 119)
@@ -903,7 +903,7 @@
 :- prim(node, 1,
 [rule([+('SgNode*')], [cond("isSgNode($0)")
 ])
-,rule([-('SgNode*')], [iterMemoryPools($0, ['SgNode','SgSupport','SgModifier','SgModifierNodes','SgConstVolatileModifier','SgStorageModifier','SgAccessModifier','SgFunctionModifier','SgUPC_AccessModifier','SgSpecialFunctionModifier','SgElaboratedTypeModifier','SgLinkageModifier','SgBaseClassModifier','SgTypeModifier','SgDeclarationModifier','SgName','SgSymbolTable','SgInitializedName','SgAttribute','SgPragma','SgBitAttribute','SgFuncDecl_attr','SgClassDecl_attr','Sg_File_Info','SgFile','SgSourceFile','SgBinaryFile','SgProject','SgOptions','SgUnparse_Info','SgBaseClass','SgTypedefSeq','SgTemplateParameter','SgTemplateArgument','SgDirectory','SgFileList','SgDirectoryList','SgFunctionParameterTypeList','SgQualifiedName','SgTemplateArgumentList','SgTemplateParameterList','SgGraph','SgDirectedGraph','SgGraphNode','SgDirectedGraphNode','SgGraphEdge','SgDirectedGraphEdge','SgNameGroup','SgCommonBlockObject','SgDimensionObject','SgFormatItem','SgFormatItemList','SgDataStatementGroup','SgDataStatementObject','SgDataStatementValue','SgType','SgTypeUnknown','SgTypeChar','SgTypeSignedChar','SgTypeUnsignedChar','SgTypeShort','SgTypeSignedShort','SgTypeUnsignedShort','SgTypeInt','SgTypeSignedInt','SgTypeUnsignedInt','SgTypeLong','SgTypeSignedLong','SgTypeUnsignedLong','SgTypeVoid','SgTypeGlobalVoid','SgTypeWchar','SgTypeFloat','SgTypeDouble','SgTypeLongLong','SgTypeUnsignedLongLong','SgTypeLongDouble','SgTypeString','SgTypeBool','SgPointerType','SgPointerMemberType','SgReferenceType','SgNamedType','SgClassType','SgEnumType','SgTypedefType','SgModifierType','SgFunctionType','SgMemberFunctionType','SgPartialFunctionType','SgPartialFunctionModifierType','SgArrayType','SgTypeEllipse','SgTemplateType','SgQualifiedNameType','SgTypeComplex','SgTypeImaginary','SgTypeDefault','SgLocatedNode','SgStatement','SgScopeStatement','SgGlobal','SgBasicBlock','SgIfStmt','SgForStatement','SgFunctionDefinition','SgClassDefinition','SgTemplateInstantiationDefn','SgWhileStmt','SgDoWhileStmt','SgSwitchStatement','SgCatchOptionStmt','SgNames!
 paceDefi
nitionStatement','SgBlockDataStatement','SgAssociateStatement','SgFortranDo','SgFortranNonblockedDo','SgForAllStatement','SgUpcForAllStatement','SgFunctionTypeTable','SgDeclarationStatement','SgFunctionParameterList','SgVariableDeclaration','SgVariableDefinition','SgClinkageDeclarationStatement','SgClinkageStartStatement','SgClinkageEndStatement','SgEnumDeclaration','SgAsmStmt','SgAttributeSpecificationStatement','SgFormatStatement','SgTemplateDeclaration','SgTemplateInstantiationDirectiveStatement','SgUseStatement','SgParameterStatement','SgNamespaceDeclarationStatement','SgEquivalenceStatement','SgInterfaceStatement','SgNamespaceAliasDeclarationStatement','SgCommonBlock','SgTypedefDeclaration','SgStatementFunctionStatement','SgCtorInitializerList','SgPragmaDeclaration','SgUsingDirectiveStatement','SgClassDeclaration','SgTemplateInstantiationDecl','SgDerivedTypeStatement','SgModuleStatement','SgImplicitStatement','SgUsingDeclarationStatement','SgNamelistStatement','SgImportStatement','SgFunctionDeclaration','SgMemberFunctionDeclaration','SgTemplateInstantiationMemberFunctionDecl','SgTemplateInstantiationFunctionDecl','SgProgramHeaderStatement','SgProcedureHeaderStatement','SgEntryStatement','SgContainsStatement','SgC_PreprocessorDirectiveStatement','SgIncludeDirectiveStatement','SgDefineDirectiveStatement','SgUndefDirectiveStatement','SgIfdefDirectiveStatement','SgIfndefDirectiveStatement','SgIfDirectiveStatement','SgDeadIfDirectiveStatement','SgElseDirectiveStatement','SgElseifDirectiveStatement','SgEndifDirectiveStatement','SgLineDirectiveStatement','SgWarningDirectiveStatement','SgErrorDirectiveStatement','SgEmptyDirectiveStatement','SgFortranIncludeLine','SgExprStatement','SgLabelStatement','SgCaseOptionStmt','SgTryStmt','SgDefaultOptionStmt','SgBreakStmt','SgContinueStmt','SgReturnStmt','SgGotoStatement','SgSpawnStmt','SgNullStatement','SgVariantStatement','SgForInitStatement','SgCatchStatementSeq','SgStopOrPauseStatement','SgIOStatement','SgPrintStatement','SgReadStatement','SgWriteStatement','SgO!
 penState
ment','SgCloseStatement','SgInquireStatement','SgFlushStatement','SgBackspaceStatement','SgRewindStatement','SgEndfileStatement','SgWaitStatement','SgWhereStatement','SgElseWhereStatement','SgNullifyStatement','SgArithmeticIfStatement','SgAssignStatement','SgComputedGotoStatement','SgAssignedGotoStatement','SgAllocateStatement','SgDeallocateStatement','SgUpcNotifyStatement','SgUpcWaitStatement','SgUpcBarrierStatement','SgUpcFenceStatement','SgSequenceStatement','SgExpression','SgUnaryOp','SgExpressionRoot','SgMinusOp','SgUnaryAddOp','SgNotOp','SgPointerDerefExp','SgAddressOfOp','SgMinusMinusOp','SgPlusPlusOp','SgBitComplementOp','SgCastExp','SgThrowOp','SgUserDefinedUnaryOp','SgBinaryOp','SgArrowExp','SgDotExp','SgDotStarOp','SgArrowStarOp','SgEqualityOp','SgLessThanOp','SgGreaterThanOp','SgNotEqualOp','SgLessOrEqualOp','SgGreaterOrEqualOp','SgAddOp','SgSubtractOp','SgMultiplyOp','SgDivideOp','SgIntegerDivideOp','SgModOp','SgAndOp','SgOrOp','SgBitXorOp','SgBitAndOp','SgBitOrOp','SgCommaOpExp','SgLshiftOp','SgRshiftOp','SgPntrArrRefExp','SgScopeOp','SgAssignOp','SgPlusAssignOp','SgMinusAssignOp','SgAndAssignOp','SgIorAssignOp','SgMultAssignOp','SgDivAssignOp','SgModAssignOp','SgXorAssignOp','SgLshiftAssignOp','SgRshiftAssignOp','SgExponentiationOp','SgConcatenationOp','SgUserDefinedBinaryOp','SgExprListExp','SgVarRefExp','SgClassNameRefExp','SgFunctionRefExp','SgMemberFunctionRefExp','SgValueExp','SgBoolValExp','SgStringVal','SgShortVal','SgCharVal','SgUnsignedCharVal','SgWcharVal','SgUnsignedShortVal','SgIntVal','SgEnumVal','SgUnsignedIntVal','SgLongIntVal','SgLongLongIntVal','SgUnsignedLongLongIntVal','SgUnsignedLongVal','SgFloatVal','SgDoubleVal','SgLongDoubleVal','SgComplexVal','SgUpcThreads','SgUpcMythread','SgFunctionCallExp','SgSizeOfOp','SgUpcLocalsizeofExpression','SgUpcBlocksizeofExpression','SgUpcElemsizeofExpression','SgTypeIdOp','SgConditionalExp','SgNewExp','SgDeleteExp','SgThisExp','SgRefExp','SgInitializer','SgAggregateInitializer','SgConstructorInitializer','SgAssignInitializer','SgDesign!
 atedInit
ializer','SgVarArgStartOp','SgVarArgOp','SgVarArgEndOp','SgVarArgCopyOp','SgVarArgStartOneOperandOp','SgNullExpression','SgVariantExpression','SgSubscriptExpression','SgColonShapeExp','SgAsteriskShapeExp','SgImpliedDo','SgIOItemExpression','SgStatementExpression','SgAsmOp','SgLabelRefExp','SgActualArgumentExpression','SgUnknownArrayOrFunctionReference','SgLocatedNodeSupport','SgInterfaceBody','SgRenamePair','SgToken','SgSymbol','SgVariableSymbol','SgFunctionSymbol','SgMemberFunctionSymbol','SgRenameSymbol','SgFunctionTypeSymbol','SgClassSymbol','SgTemplateSymbol','SgEnumSymbol','SgEnumFieldSymbol','SgTypedefSymbol','SgLabelSymbol','SgDefaultSymbol','SgNamespaceSymbol','SgIntrinsicSymbol','SgModuleSymbol','SgInterfaceSymbol','SgCommonSymbol','SgAliasSymbol','SgAsmNode','SgAsmStatement','SgAsmDeclaration','SgAsmDataStructureDeclaration','SgAsmFunctionDeclaration','SgAsmFieldDeclaration','SgAsmBlock','SgAsmInstruction','SgAsmx86Instruction','SgAsmArmInstruction','SgAsmPowerpcInstruction','SgAsmExpression','SgAsmValueExpression','SgAsmByteValueExpression','SgAsmWordValueExpression','SgAsmDoubleWordValueExpression','SgAsmQuadWordValueExpression','SgAsmSingleFloatValueExpression','SgAsmDoubleFloatValueExpression','SgAsmVectorValueExpression','SgAsmBinaryExpression','SgAsmBinaryAdd','SgAsmBinarySubtract','SgAsmBinaryMultiply','SgAsmBinaryDivide','SgAsmBinaryMod','SgAsmBinaryAddPreupdate','SgAsmBinarySubtractPreupdate','SgAsmBinaryAddPostupdate','SgAsmBinarySubtractPostupdate','SgAsmBinaryLsl','SgAsmBinaryLsr','SgAsmBinaryAsr','SgAsmBinaryRor','SgAsmUnaryExpression','SgAsmUnaryPlus','SgAsmUnaryMinus','SgAsmUnaryRrx','SgAsmUnaryArmSpecialRegisterList','SgAsmMemoryReferenceExpression','SgAsmRegisterReferenceExpression','SgAsmx86RegisterReferenceExpression','SgAsmArmRegisterReferenceExpression','SgAsmPowerpcRegisterReferenceExpression','SgAsmControlFlagsExpression','SgAsmCommonSubExpression','SgAsmExprListExp','SgAsmFile','SgAsmInterpretation','SgAsmOperandList','SgAsmType','SgAsmTypeByte','SgAsmTypeWord','SgAsmTyp!
 eDoubleW
ord','SgAsmTypeQuadWord','SgAsmTypeDoubleQuadWord','SgAsmType80bitFloat','SgAsmType128bitFloat','SgAsmTypeSingleFloat','SgAsmTypeDoubleFloat','SgAsmTypeVector','SgAsmExecutableFileFormat','SgAsmGenericDLL','SgAsmPEDLL','SgAsmGenericFormat','SgAsmGenericDLLList','SgAsmGenericFile','SgAsmGenericSection','SgAsmGenericHeader','SgAsmPEFileHeader','SgAsmLEFileHeader','SgAsmNEFileHeader','SgAsmDOSFileHeader','SgAsmElfFileHeader','SgAsmElfSection','SgAsmElfSymbolSection','SgAsmElfRelaSection','SgAsmElfDynamicSection','SgAsmElfStringSection','SgAsmElfSectionTable','SgAsmElfSegmentTable','SgAsmPESection','SgAsmPEImportSection','SgAsmPEStringSection','SgAsmPESectionTable','SgAsmPEExtendedDOSHeader','SgAsmCoffSymbolTable','SgAsmNESection','SgAsmNESectionTable','SgAsmNEExtendedDOSHeader','SgAsmNENameTable','SgAsmNEModuleTable','SgAsmNEStringTable','SgAsmNEEntryTable','SgAsmNERelocTable','SgAsmLESection','SgAsmLESectionTable','SgAsmLENameTable','SgAsmLEPageTable','SgAsmLEEntryTable','SgAsmLERelocTable','SgAsmGenericSymbol','SgAsmCoffSymbol','SgAsmElfSymbol','SgAsmGenericStrtab','SgAsmElfStrtab','SgAsmCoffStrtab','SgAsmGenericSymbolList','SgAsmGenericSectionList','SgAsmGenericHeaderList','SgAsmGenericString','SgAsmBasicString','SgAsmStoredString','SgAsmElfSectionTableEntry','SgAsmElfSegmentTableEntry','SgAsmElfSymbolList','SgAsmElfRelaEntry','SgAsmElfRelaEntryList','SgAsmElfDynamicEntry','SgAsmElfDynamicEntryList','SgAsmElfSegmentTableEntryList','SgAsmStringStorage','SgAsmPEImportDirectory','SgAsmPEImportHintName','SgAsmPESectionTableEntry','SgAsmPERVASizePair','SgAsmCoffSymbolList','SgAsmPERVASizePairList','SgAsmPEDLLList','SgAsmPEImportHintNameList','SgAsmNEEntryPoint','SgAsmNERelocEntry','SgAsmNESectionTableEntry','SgAsmLEPageTableEntry','SgAsmLEEntryPoint','SgAsmLESectionTableEntry']), makeGround($0, 'SgNode*'), rescan])
+,rule([-('SgNode*')], [iterMemoryPools($0, ['SgNode','SgSupport','SgModifier','SgModifierNodes','SgConstVolatileModifier','SgStorageModifier','SgAccessModifier','SgFunctionModifier','SgUPC_AccessModifier','SgSpecialFunctionModifier','SgElaboratedTypeModifier','SgLinkageModifier','SgBaseClassModifier','SgTypeModifier','SgDeclarationModifier','SgName','SgSymbolTable','SgInitializedName','SgAttribute','SgPragma','SgBitAttribute','SgFuncDecl_attr','SgClassDecl_attr','Sg_File_Info','SgFile','SgSourceFile','SgBinaryFile','SgProject','SgOptions','SgUnparse_Info','SgBaseClass','SgTypedefSeq','SgTemplateParameter','SgTemplateArgument','SgDirectory','SgFileList','SgDirectoryList','SgFunctionParameterTypeList','SgQualifiedName','SgTemplateArgumentList','SgTemplateParameterList','SgGraph','SgDirectedGraph','SgGraphNode','SgDirectedGraphNode','SgGraphEdge','SgDirectedGraphEdge','SgNameGroup','SgCommonBlockObject','SgDimensionObject','SgFormatItem','SgFormatItemList','SgDataStatementGroup','SgDataStatementObject','SgDataStatementValue','SgType','SgTypeUnknown','SgTypeChar','SgTypeSignedChar','SgTypeUnsignedChar','SgTypeShort','SgTypeSignedShort','SgTypeUnsignedShort','SgTypeInt','SgTypeSignedInt','SgTypeUnsignedInt','SgTypeLong','SgTypeSignedLong','SgTypeUnsignedLong','SgTypeVoid','SgTypeGlobalVoid','SgTypeWchar','SgTypeFloat','SgTypeDouble','SgTypeLongLong','SgTypeUnsignedLongLong','SgTypeLongDouble','SgTypeString','SgTypeBool','SgPointerType','SgPointerMemberType','SgReferenceType','SgNamedType','SgClassType','SgEnumType','SgTypedefType','SgModifierType','SgFunctionType','SgMemberFunctionType','SgPartialFunctionType','SgPartialFunctionModifierType','SgArrayType','SgTypeEllipse','SgTemplateType','SgQualifiedNameType','SgTypeComplex','SgTypeImaginary','SgTypeDefault','SgLocatedNode','SgStatement','SgScopeStatement','SgGlobal','SgBasicBlock','SgIfStmt','SgForStatement','SgFunctionDefinition','SgClassDefinition','SgTemplateInstantiationDefn','SgWhileStmt','SgDoWhileStmt','SgSwitchStatement','SgCatchOptionStmt','SgNames!
 paceDefi
nitionStatement','SgBlockDataStatement','SgAssociateStatement','SgFortranDo','SgFortranNonblockedDo','SgForAllStatement','SgUpcForAllStatement','SgFunctionTypeTable','SgDeclarationStatement','SgFunctionParameterList','SgVariableDeclaration','SgVariableDefinition','SgClinkageDeclarationStatement','SgClinkageStartStatement','SgClinkageEndStatement','SgEnumDeclaration','SgAsmStmt','SgAttributeSpecificationStatement','SgFormatStatement','SgTemplateDeclaration','SgTemplateInstantiationDirectiveStatement','SgUseStatement','SgParameterStatement','SgNamespaceDeclarationStatement','SgEquivalenceStatement','SgInterfaceStatement','SgNamespaceAliasDeclarationStatement','SgCommonBlock','SgTypedefDeclaration','SgStatementFunctionStatement','SgCtorInitializerList','SgPragmaDeclaration','SgUsingDirectiveStatement','SgClassDeclaration','SgTemplateInstantiationDecl','SgDerivedTypeStatement','SgModuleStatement','SgImplicitStatement','SgUsingDeclarationStatement','SgNamelistStatement','SgImportStatement','SgFunctionDeclaration','SgMemberFunctionDeclaration','SgTemplateInstantiationMemberFunctionDecl','SgTemplateInstantiationFunctionDecl','SgProgramHeaderStatement','SgProcedureHeaderStatement','SgEntryStatement','SgContainsStatement','SgC_PreprocessorDirectiveStatement','SgIncludeDirectiveStatement','SgDefineDirectiveStatement','SgUndefDirectiveStatement','SgIfdefDirectiveStatement','SgIfndefDirectiveStatement','SgIfDirectiveStatement','SgDeadIfDirectiveStatement','SgElseDirectiveStatement','SgElseifDirectiveStatement','SgEndifDirectiveStatement','SgLineDirectiveStatement','SgWarningDirectiveStatement','SgErrorDirectiveStatement','SgEmptyDirectiveStatement','SgFortranIncludeLine','SgExprStatement','SgLabelStatement','SgCaseOptionStmt','SgTryStmt','SgDefaultOptionStmt','SgBreakStmt','SgContinueStmt','SgReturnStmt','SgGotoStatement','SgSpawnStmt','SgNullStatement','SgVariantStatement','SgForInitStatement','SgCatchStatementSeq','SgStopOrPauseStatement','SgIOStatement','SgPrintStatement','SgReadStatement','SgWriteStatement','SgO!
 penState
ment','SgCloseStatement','SgInquireStatement','SgFlushStatement','SgBackspaceStatement','SgRewindStatement','SgEndfileStatement','SgWaitStatement','SgWhereStatement','SgElseWhereStatement','SgNullifyStatement','SgArithmeticIfStatement','SgAssignStatement','SgComputedGotoStatement','SgAssignedGotoStatement','SgAllocateStatement','SgDeallocateStatement','SgUpcNotifyStatement','SgUpcWaitStatement','SgUpcBarrierStatement','SgUpcFenceStatement','SgSequenceStatement','SgExpression','SgUnaryOp','SgExpressionRoot','SgMinusOp','SgUnaryAddOp','SgNotOp','SgPointerDerefExp','SgAddressOfOp','SgMinusMinusOp','SgPlusPlusOp','SgBitComplementOp','SgCastExp','SgThrowOp','SgUserDefinedUnaryOp','SgBinaryOp','SgArrowExp','SgDotExp','SgDotStarOp','SgArrowStarOp','SgEqualityOp','SgLessThanOp','SgGreaterThanOp','SgNotEqualOp','SgLessOrEqualOp','SgGreaterOrEqualOp','SgAddOp','SgSubtractOp','SgMultiplyOp','SgDivideOp','SgIntegerDivideOp','SgModOp','SgAndOp','SgOrOp','SgBitXorOp','SgBitAndOp','SgBitOrOp','SgCommaOpExp','SgLshiftOp','SgRshiftOp','SgPntrArrRefExp','SgScopeOp','SgAssignOp','SgPlusAssignOp','SgMinusAssignOp','SgAndAssignOp','SgIorAssignOp','SgMultAssignOp','SgDivAssignOp','SgModAssignOp','SgXorAssignOp','SgLshiftAssignOp','SgRshiftAssignOp','SgExponentiationOp','SgConcatenationOp','SgUserDefinedBinaryOp','SgExprListExp','SgVarRefExp','SgClassNameRefExp','SgFunctionRefExp','SgMemberFunctionRefExp','SgValueExp','SgBoolValExp','SgStringVal','SgShortVal','SgCharVal','SgUnsignedCharVal','SgWcharVal','SgUnsignedShortVal','SgIntVal','SgEnumVal','SgUnsignedIntVal','SgLongIntVal','SgLongLongIntVal','SgUnsignedLongLongIntVal','SgUnsignedLongVal','SgFloatVal','SgDoubleVal','SgLongDoubleVal','SgComplexVal','SgUpcThreads','SgUpcMythread','SgFunctionCallExp','SgSizeOfOp','SgUpcLocalsizeofExpression','SgUpcBlocksizeofExpression','SgUpcElemsizeofExpression','SgTypeIdOp','SgConditionalExp','SgNewExp','SgDeleteExp','SgThisExp','SgRefExp','SgInitializer','SgAggregateInitializer','SgConstructorInitializer','SgAssignInitializer','SgDesign!
 atedInit
ializer','SgVarArgStartOp','SgVarArgOp','SgVarArgEndOp','SgVarArgCopyOp','SgVarArgStartOneOperandOp','SgNullExpression','SgVariantExpression','SgSubscriptExpression','SgColonShapeExp','SgAsteriskShapeExp','SgImpliedDo','SgIOItemExpression','SgStatementExpression','SgAsmOp','SgLabelRefExp','SgActualArgumentExpression','SgUnknownArrayOrFunctionReference','SgLocatedNodeSupport','SgInterfaceBody','SgRenamePair','SgToken','SgSymbol','SgVariableSymbol','SgFunctionSymbol','SgMemberFunctionSymbol','SgRenameSymbol','SgFunctionTypeSymbol','SgClassSymbol','SgTemplateSymbol','SgEnumSymbol','SgEnumFieldSymbol','SgTypedefSymbol','SgLabelSymbol','SgDefaultSymbol','SgNamespaceSymbol','SgIntrinsicSymbol','SgModuleSymbol','SgInterfaceSymbol','SgCommonSymbol','SgAliasSymbol','SgAsmNode','SgAsmStatement','SgAsmDeclaration','SgAsmDataStructureDeclaration','SgAsmFunctionDeclaration','SgAsmFieldDeclaration','SgAsmBlock','SgAsmInstruction','SgAsmx86Instruction','SgAsmArmInstruction','SgAsmPowerpcInstruction','SgAsmExpression','SgAsmValueExpression','SgAsmByteValueExpression','SgAsmWordValueExpression','SgAsmDoubleWordValueExpression','SgAsmQuadWordValueExpression','SgAsmSingleFloatValueExpression','SgAsmDoubleFloatValueExpression','SgAsmVectorValueExpression','SgAsmBinaryExpression','SgAsmBinaryAdd','SgAsmBinarySubtract','SgAsmBinaryMultiply','SgAsmBinaryDivide','SgAsmBinaryMod','SgAsmBinaryAddPreupdate','SgAsmBinarySubtractPreupdate','SgAsmBinaryAddPostupdate','SgAsmBinarySubtractPostupdate','SgAsmBinaryLsl','SgAsmBinaryLsr','SgAsmBinaryAsr','SgAsmBinaryRor','SgAsmUnaryExpression','SgAsmUnaryPlus','SgAsmUnaryMinus','SgAsmUnaryRrx','SgAsmUnaryArmSpecialRegisterList','SgAsmMemoryReferenceExpression','SgAsmRegisterReferenceExpression','SgAsmx86RegisterReferenceExpression','SgAsmArmRegisterReferenceExpression','SgAsmPowerpcRegisterReferenceExpression','SgAsmControlFlagsExpression','SgAsmCommonSubExpression','SgAsmExprListExp','SgAsmFile','SgAsmInterpretation','SgAsmOperandList','SgAsmType','SgAsmTypeByte','SgAsmTypeWord','SgAsmTyp!
 eDoubleW
ord','SgAsmTypeQuadWord','SgAsmTypeDoubleQuadWord','SgAsmType80bitFloat','SgAsmType128bitFloat','SgAsmTypeSingleFloat','SgAsmTypeDoubleFloat','SgAsmTypeVector','SgAsmExecutableFileFormat','SgAsmGenericDLL','SgAsmPEDLL','SgAsmGenericFormat','SgAsmGenericDLLList','SgAsmGenericFile','SgAsmGenericSection','SgAsmGenericHeader','SgAsmPEFileHeader','SgAsmLEFileHeader','SgAsmNEFileHeader','SgAsmDOSFileHeader','SgAsmElfFileHeader','SgAsmElfSection','SgAsmElfSymbolSection','SgAsmElfRelaSection','SgAsmElfDynamicSection','SgAsmElfStringSection','SgAsmElfSectionTable','SgAsmElfSegmentTable','SgAsmPESection','SgAsmPEImportSection','SgAsmPEExportSection','SgAsmPEStringSection','SgAsmPESectionTable','SgAsmPEExtendedDOSHeader','SgAsmCoffSymbolTable','SgAsmNESection','SgAsmNESectionTable','SgAsmNEExtendedDOSHeader','SgAsmNENameTable','SgAsmNEModuleTable','SgAsmNEStringTable','SgAsmNEEntryTable','SgAsmNERelocTable','SgAsmLESection','SgAsmLESectionTable','SgAsmLENameTable','SgAsmLEPageTable','SgAsmLEEntryTable','SgAsmLERelocTable','SgAsmGenericSymbol','SgAsmCoffSymbol','SgAsmElfSymbol','SgAsmGenericStrtab','SgAsmElfStrtab','SgAsmCoffStrtab','SgAsmGenericSymbolList','SgAsmGenericSectionList','SgAsmGenericHeaderList','SgAsmGenericString','SgAsmBasicString','SgAsmStoredString','SgAsmElfSectionTableEntry','SgAsmElfSegmentTableEntry','SgAsmElfSymbolList','SgAsmElfRelaEntry','SgAsmElfRelaEntryList','SgAsmPEExportEntry','SgAsmPEExportEntryList','SgAsmElfDynamicEntry','SgAsmElfDynamicEntryList','SgAsmElfSegmentTableEntryList','SgAsmStringStorage','SgAsmPEImportDirectory','SgAsmPEImportHintName','SgAsmPESectionTableEntry','SgAsmPEExportDirectory','SgAsmPERVASizePair','SgAsmCoffSymbolList','SgAsmPERVASizePairList','SgAsmPEDLLList','SgAsmPEImportHintNameList','SgAsmNEEntryPoint','SgAsmNERelocEntry','SgAsmNESectionTableEntry','SgAsmLEPageTableEntry','SgAsmLEEntryPoint','SgAsmLESectionTableEntry']), makeGround($0, 'SgNode*'), rescan])
 ]).
 :- prim(supportNode, 1,
 [rule([+('SgNode*')], [cond("isSgSupport($0)")

Modified: branches/rice/rose.docs.in
===================================================================
--- branches/rice/rose.docs.in	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/rose.docs.in	2008-11-11 22:06:33 UTC (rev 119)
@@ -80,9 +80,7 @@
      about the ROSE project. Built in 2005, it has been slow to evolve since we wanted to 
      keep a low profile as long as possible while we focused on robustness issues within
      the ROSE project and infrastructure. \n
-     <a href="http://www.llnl.gov/casc/rose"> External LLNL ROSE Web Pages </a> \n
-     The LLNL ROSE internal web site is at:
-     <a href="http://cmg-1/casc/rose"> Internal LLNL ROSE Web Pages </a> \n
+     <a href="http://www.llnl.gov/casc/rose"> ROSE Web Site </a> \n
 
 \subsection dummyA ROSE User Manual Documentation
      The ROSE User Manual can be found at (link to LaTeX document): \n
@@ -114,42 +112,26 @@
 
 \subsection dummyD ROSE Email List
 
-    The ROSE project maintains a mailing list (casc-rose *at* llnl *dot* gov).
-    The email list is only used to get help and announce internal and external releases.
-    Anyone who would like to be on the email list can send email to dquinlan *at* llnl *dot* gov.
-    Those with access to LLNL internal web pages may check who is on the email list at the \n
-     <a href="http://cmg-r.llnl.gov/casc/computing/mailing_lists/casc-rose.html"> ROSE Email List </a> \n
+    The ROSE project supports three email lists, information about this is loacted in 
+    the ROSE Installation Guide and the ROSE User Manual (developers appendix).
 
 \subsection RosePublications ROSE Publications
 
     ROSE is a research project which emphasises publication about the new technologies
     that we are developing, every often as part of external collaborations.  Publications
-    specific to the ROSE project can be found at: \n
-    \ref ProjectPublications
+    specific to the ROSE project can be found at the main ROSE web page.
 
 \section DownLoadInstructions ROSE Download Instructions
 
-    \b ROSE will be released on the web late \b Summer \b 2006.
+    ROSE is an open source project. The ROSE project is publically release via the
+    outreach.scidac.gov web site (which hosts the main ROSE web page).
 
-    ROSE is an open source project. The ROSE project is however not yet presently 
-    distributed on the web.  A increasing 
-    number of groups world-wide have been given external access to ROSE
-    as part of an incremental approach to an initial external release.  In each case the 
-    propriatary EDG source can only be distributed to those research groups having a free 
-    research license (or a commerical license in a few cases).  The full source code to
-    ROSE \b will be made available as an \b open \b source \b project.  The code that
-    connects EDG to
-    ROSE can \b only be made available in binary form to those without the free EDG research
-    license.  ROSE by itself does not depend on EDG directly, only indirectly as one 
-    of a number of front-ends. \n
-    \ref ProjectDownLoadPage
+\if debuggingDocumentation
 
 \section RoseRelatedWork Related Work & Background Material
 
     For more information about related work and background material \ref ProjectRelatedWorkPage.
 
-\if debuggingDocumentation
-
    There are two levels of documentation: user level and developer level. 
       -# The user level documentation documents only the interfaces that are 
          important to the use of ROSE to build translators and express 

Modified: branches/rice/src/ROSETTA/Grammar/BinaryInstruction.code
===================================================================
--- branches/rice/src/ROSETTA/Grammar/BinaryInstruction.code	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/Grammar/BinaryInstruction.code	2008-11-11 22:06:33 UTC (rev 119)
@@ -375,8 +375,8 @@
 
      public:
        // DQ (8/21/2008): We need something to be in global scope (or not nested here) so that a few references in Node.code can be made.
-       // typedef uint64_t addr_t;    // address and size (file and memory)
           typedef rose_addr_t addr_t; // address and size (file and memory)
+	  typedef rose_rva_t rva_t;   // relative virtual address
 
        // DQ (8/21/2008): Moved this from Node.code to make it local since we can't reference the nested addr_t directly from glogal scope.
        // typedef Rose_STL_Container<addr_t> SgAddressList;
@@ -695,6 +695,8 @@
           static void host_to_le(unsigned h, uint16_t *n);
           static void host_to_le(unsigned h, uint32_t *n);
           static void host_to_le(addr_t h, uint64_t *n);
+	  static void host_to_le(rva_t h, uint32_t *n);
+	  static void host_to_le(rva_t h, uint64_t *n);
           static void host_to_le(int h, int8_t *n);
           static void host_to_le(int h, int16_t *n);
           static void host_to_le(int h, int32_t *n);
@@ -714,6 +716,8 @@
           static void host_to_be(unsigned h, uint16_t *n);
           static void host_to_be(unsigned h, uint32_t *n);
           static void host_to_be(addr_t h, uint64_t *n);
+	  static void host_to_be(rva_t h, uint32_t *n);
+	  static void host_to_be(rva_t h, uint64_t *n);
           static void host_to_be(int h, int8_t *n);
           static void host_to_be(int h, int16_t *n);
           static void host_to_be(int h, int32_t *n);
@@ -734,6 +738,7 @@
           static void host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, unsigned h, uint16_t *np);
           static void host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, unsigned h, uint32_t *np);
           static void host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, addr_t h, uint64_t *np);
+	  static void host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, rva_t h, uint64_t *np);
           static void host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int h, int8_t *np);
           static void host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int h, int16_t *np);
           static void host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int h, int32_t *np);
@@ -867,6 +872,7 @@
           void remove_section(SgAsmGenericSection*); 	      /* Remove section from the file */
 
        /* Section lookup functions (plural) */
+	  SgAsmGenericSectionPtrList get_mapped_sections();
 	  SgAsmGenericSectionPtrList get_sections_by_id(int id);
 	  SgAsmGenericSectionPtrList get_sections_by_name(std::string, char sep=0);
 	  SgAsmGenericSectionPtrList get_sections_by_offset(addr_t offset, addr_t size);
@@ -897,63 +903,80 @@
 HEADER_GENERIC_HEADER_END
 
 HEADER_GENERIC_FILE_START
-     public:
-          SgAsmGenericFile(std::string file_name);
+	public:
+		SgAsmGenericFile(std::string file_name);
+		virtual ~SgAsmGenericFile();				/* Destructor deletes children and unmaps/closes file */
+		void unparse(const std::string &filename);		/* Unparse the file -- mirror image of parsing */
+		void dump(FILE*);                                   	/* Print some debugging info */
 
-          virtual ~SgAsmGenericFile();                                /* Destructor deletes children and munmaps and closes file */
-          void unparse(const std::string &filename);		/* Unparse the file -- mirror image of parsing */
-          void dump(FILE*);                                   /* Print some debugging info */
+		/* File contents */
+		rose_addr_t get_current_size();				/* Current size based on defined sections */
+		rose_addr_t get_orig_size() const;              	/* Original size based on actual file size */
+		const SgFileContentList& content() {			/* Entire file contents */
+			return p_data;
+		}
+		SgFileContentList content(addr_t offset, addr_t size);	/* Partial file contents */
 
-       /* File contents */
-	  rose_addr_t get_current_size();			/* Current size based on defined sections */
-	  rose_addr_t get_orig_size() const;                    /* Original size based on actual file size */
-          const SgFileContentList& content() { return p_data; }     	/* Entire file contents */
-          SgFileContentList content(addr_t offset, addr_t size);	/* Partial file contents */
+		/* Section lookup functions (plural) */
+		SgAsmGenericSectionPtrList get_mapped_sections();
+		SgAsmGenericSectionPtrList get_sections(bool include_holes=true);
+		SgAsmGenericSectionPtrList get_sections_by_id(int id);
+		SgAsmGenericSectionPtrList get_sections_by_name(std::string, char sep='\0');
+		SgAsmGenericSectionPtrList get_sections_by_offset(addr_t offset, addr_t size);
+		SgAsmGenericSectionPtrList get_sections_by_rva(addr_t rva);
+		SgAsmGenericSectionPtrList get_sections_by_va(addr_t va);
 
-       /* Section lookup functions (plural) */
-	  SgAsmGenericSectionPtrList get_sections();
-	  SgAsmGenericSectionPtrList get_sections_by_id(int id);
-	  SgAsmGenericSectionPtrList get_sections_by_name(std::string, char sep='\0');
-	  SgAsmGenericSectionPtrList get_sections_by_offset(addr_t offset, addr_t size);
-	  SgAsmGenericSectionPtrList get_sections_by_rva(addr_t rva);
-	  SgAsmGenericSectionPtrList get_sections_by_va(addr_t va);
+		/* Section lookup functions (singular) */
+		SgAsmGenericSection *get_section_by_id(int id, size_t *nfound=0);
+		SgAsmGenericSection *get_section_by_name(const std::string&, char sep=0, size_t *nfound=0);
+		SgAsmGenericSection *get_section_by_offset(addr_t offset, addr_t size, size_t *nfound=0);
+		SgAsmGenericSection *get_section_by_rva(addr_t rva, size_t *nfound=0);
+		SgAsmGenericSection *get_section_by_va(addr_t va, size_t *nfound=0);
+		SgAsmGenericSection *get_best_section_by_va(addr_t va, size_t *nfound=0);
+		static SgAsmGenericSection *best_section_by_va(const SgAsmGenericSectionPtrList &sections, addr_t va);
 
-       /* Section lookup functions (singular) */
-	  SgAsmGenericSection *get_section_by_id(int id, size_t *nfound=0);
-	  SgAsmGenericSection *get_section_by_name(const std::string&, char sep=0, size_t *nfound=0);
-	  SgAsmGenericSection *get_section_by_offset(addr_t offset, addr_t size, size_t *nfound=0);
-          SgAsmGenericSection *get_section_by_rva(addr_t rva, size_t *nfound=0);
-	  SgAsmGenericSection *get_section_by_va(addr_t va, size_t *nfound=0);
-	  SgAsmGenericSection *get_best_section_by_va(addr_t va, size_t *nfound=0);
-	  static SgAsmGenericSection *best_section_by_va(const SgAsmGenericSectionPtrList &sections, addr_t va);
+		/* Section modification functions */
+		enum AddressSpace {					/* Bit flags for address spaces for shift_extend() */
+			ADDRSP_MEMORY = 0x0001,
+			ADDRSP_FILE   = 0x0002,
+			ADDRSP_ALL    = 0x0003,
+		};
+		enum Elasticity {					/* Elasticity argument for shift_extend() */
+			ELASTIC_NONE  = 0,				/* Nothing is elastic; other parts of space are shifted */
+			ELASTIC_UNREF = 1,				/* Unreferenced address space is elastic */
+			ELASTIC_HOLE  = 2,				/* Unreferenced and "hole" sections are elastic */
+		};
+		void shift_extend(SgAsmGenericSection *s, addr_t sa, addr_t sn)
+			{shift_extend(s, sa, sn, ADDRSP_ALL, ELASTIC_UNREF);}
+		void shift_extend(SgAsmGenericSection*, addr_t sa, addr_t sn, AddressSpace, Elasticity);
 
-	/* Section modification functions */
-	  void shift_extend(SgAsmGenericSection*, addr_t sa, addr_t sn, bool filespace, bool elastic_holes);
+		/* Holes (unreferenced regions in the file) */	
+		void congeal();                                     	/* Identify and freeze all unreferenced regions */
+		addr_t get_next_section_offset(addr_t offset);      	/* Find file offset for next section */
+		void add_hole(SgAsmGenericSection*);		      	/* Add section to list of holes */
+		void remove_hole(SgAsmGenericSection*);             	/* Remove section from list of holes */
+		void fill_holes();                                  	/* Find holes in file and create sections to fill them */
+		void unfill_holes();                                	/* Undoes what fill_holes() did */
 
-       /* Holes (unreferenced regions in the file) */	
-	  void congeal();                                     /* Identify and freeze all unreferenced regions after parsing */
-          addr_t get_next_section_offset(addr_t offset);      /* Find file offset for next section */
-	  void add_hole(SgAsmGenericSection*);		      /* Add section to list of holes */
-	  void remove_hole(SgAsmGenericSection*);             /* Remove section from list of holes */
-          void fill_holes();                                  /* Find holes in file and create sections to fill them */
-          void unfill_holes();                                /* Undoes what fill_holes() did, returning hole sections to unused pool */
+		/* Functions for file headers (a kind of section) */
+		void add_header(SgAsmGenericHeader*);               	/* Add a new file header to the list of headers */
+		void remove_header(SgAsmGenericHeader*);            	/* Remove file header from the file */
+		SgAsmGenericHeader *get_header(SgAsmGenericFormat::ExecFamily);/* Returns the specified header or exception */
+		const char *format_name();                          	/* Return a string describing the file format */
 
-       /* Functions for file headers (a kind of section) */
-          void add_header(SgAsmGenericHeader*);               /* Add a new file header to the list of headers for this file */
-          void remove_header(SgAsmGenericHeader*);            /* Remove file header from the file */
+		const SgAsmGenericFormat::fileDetails &get_sb() {
+			return p_sb;
+		}
+		void set_sb(const SgAsmGenericFormat::fileDetails &sb) {
+			printf("set_sb() not implemented!\n");
+			ROSE_ASSERT(false);
+		}
 
-          SgAsmGenericHeader *get_header(SgAsmGenericFormat::ExecFamily);                 /* Returns the specified header (exception if more than one) */
-          const char *format_name();                          /* Return a string describing the file format */
+		// DQ (8/26/2008): Added support for alternative section selection for use in disassembler.
+		SgAsmGenericSection* get_best_possible_section_by_va(addr_t va);
 
-          const SgAsmGenericFormat::fileDetails & get_sb() { return p_sb; }
-          void set_sb ( const SgAsmGenericFormat::fileDetails & sb ) { printf ("set_sb() not implemented! \n"); ROSE_ASSERT(false); }
-
-       // DQ (8/26/2008): Added support for alternative section selection for use in disassembler.
-          SgAsmGenericSection* get_best_possible_section_by_va(addr_t va);
-
-     private:
-          void ctor(std::string file_name);
-
+	private:
+		void ctor(std::string file_name);
 HEADER_GENERIC_FILE_END
 
 HEADER_GENERIC_FORMAT_START
@@ -1153,93 +1176,76 @@
 // ***********************************************
 
 HEADER_ELF_HEADER_START
+	public:
+		/* File format of an ELF header. Byte order of members depends on e_ident value. This code comes directly from
+		 * "System V Application Binary Interface, Edition 4.1" and the FreeBSD elf(5) man page, and the "Executable and
+		 * Linkable Format (ELF) Portable Formats Specifications, Version 1.2" and not from any header file. */
+		struct Elf32FileHeader_disk {
+			unsigned char       e_ident_magic[4];       /* 0x7f, 'E', 'L', 'F' */
+			unsigned char       e_ident_file_class;     /* 1=>32-bit; 2=>64-bit; other is error */
+			unsigned char       e_ident_data_encoding;  /* 1=>LSB; 2=>MSB; other is error */
+			unsigned char       e_ident_file_version;   /* Format version number (same as e_version); must be 1 */
+			unsigned char       e_ident_padding[9];     /* padding to byte 16; must be zero */
+			uint16_t            e_type;                 /* object file type: relocatable, executable, lib, core */
+			uint16_t            e_machine;              /* required architecture for an individual file */
+			uint32_t            e_version;              /* object file version, currently zero or one */
+			uint32_t            e_entry;                /* entry virtual address or zero if none */
+			uint32_t            e_phoff;                /* file offset of program header table or zero if none */
+			uint32_t            e_shoff;                /* file offset of section header table or zero if none */
+			uint32_t            e_flags;                /* processor-specific flags (EF_* constants in docs) */
+			uint16_t            e_ehsize;               /* size of ELF header in bytes */
+			uint16_t            e_phentsize;            /* size of each entry in the program header table */
+			uint16_t            e_phnum;                /* number of program headers, or PN_XNUM, or zero */
+			uint16_t            e_shentsize;            /* size of each entry in the section header table */
+			uint16_t            e_shnum;                /* number of section headers, or zero for extended entries */
+			uint16_t            e_shstrndx;             /* index of name section, or SHN_UNDEF, or SHN_XINDEX */
+		} __attribute__((packed));
 
-     public:
-       /* File format of an ELF header. Byte order of members depends on e_ident value. This code comes directly from "System V
-        * Application Binary Interface, Edition 4.1" and the FreeBSD elf(5) man page, and the "Executable and Linkable Format (ELF)
-        * Portable Formats Specifications, Version 1.2" and not from any header file. */
-          struct Elf32FileHeader_disk {
-               unsigned char       e_ident_magic[4];       /* 0x7f, 'E', 'L', 'F' */
-               unsigned char       e_ident_file_class;     /* 1=>32-bit; 2=>64-bit; other is error */
-               unsigned char       e_ident_data_encoding;  /* 1=>LSB; 2=>MSB; other is error */
-               unsigned char       e_ident_file_version;   /* Format version number (same as 'version' member); must be one. */
-               unsigned char       e_ident_padding[9];     /* padding to align next member at byte offset 16; must be zero */
-               uint16_t            e_type;                 /* object file type: relocatable, executable, shared object, core, etc. */
-               uint16_t            e_machine;              /* required architecture for an individual file */
-               uint32_t            e_version;              /* object file version, currently zero or one */
-               uint32_t            e_entry;                /* entry virtual address or zero if none */
-               uint32_t            e_phoff;                /* file offset of program header (segment) table or zero if none */
-               uint32_t            e_shoff;                /* file offset of section header table or zero if none */
-               uint32_t            e_flags;                /* processor-specific flags (EF_* constants in documentation) */
-               uint16_t            e_ehsize;               /* size of ELF header in bytes */
-               uint16_t            e_phentsize;            /* size in bytes of each entry in the program header table */
-               uint16_t            e_phnum;                /* number of entries in the program header (segment) table, or PN_XNUM, or zero */
-               uint16_t            e_shentsize;            /* size in bytes of each entry in the section header table */
-               uint16_t            e_shnum;                /* number of entries in the section header table, or zero for extended entries */
-               uint16_t            e_shstrndx;             /* index of section containing section name strings, or SHN_UNDEF, or SHN_XINDEX */
-             } __attribute__((packed));
+		struct Elf64FileHeader_disk {
+			unsigned char       e_ident_magic[4];
+			unsigned char       e_ident_file_class;
+			unsigned char       e_ident_data_encoding;
+			unsigned char       e_ident_file_version;
+			unsigned char       e_ident_padding[9];
+			uint16_t            e_type;
+			uint16_t            e_machine;
+			uint32_t            e_version;
+			uint64_t            e_entry;
+			uint64_t            e_phoff;
+			uint64_t            e_shoff;
+			uint32_t            e_flags;
+			uint16_t            e_ehsize;
+			uint16_t            e_phentsize;
+			uint16_t            e_phnum;
+			uint16_t            e_shentsize;
+			uint16_t            e_shnum;
+			uint16_t            e_shstrndx;
+		} __attribute__((packed));
 
-          struct Elf64FileHeader_disk {
-               unsigned char       e_ident_magic[4];
-               unsigned char       e_ident_file_class;
-               unsigned char       e_ident_data_encoding;
-               unsigned char       e_ident_file_version;
-               unsigned char       e_ident_padding[9];
-               uint16_t            e_type;
-               uint16_t            e_machine;
-               uint32_t            e_version;
-               uint64_t            e_entry;
-               uint64_t            e_phoff;
-               uint64_t            e_shoff;
-               uint32_t            e_flags;
-               uint16_t            e_ehsize;
-               uint16_t            e_phentsize;
-               uint16_t            e_phnum;
-               uint16_t            e_shentsize;
-               uint16_t            e_shnum;
-               uint16_t            e_shstrndx;
-             } __attribute__((packed));
+		SgAsmElfFileHeader(SgAsmGenericFile *f, addr_t offset)
+			: SgAsmGenericHeader(f, offset, 0)
+			{ctor(f, offset);}
+		//virtual ~SgAsmElfFileHeader() {}
 
-#if USING_OLD_EXECUTABLE_FORMAT_SUPPORT
-       // DQ (8/10/2008): This constructor is implemented in sageSupport.C and will be removed later once the new IR nodes are integrated into use.
-       // SgAsmElfFileHeader ( Exec::ELF::ElfFileHeader* elf_file_header );
-#endif
+		uint64_t max_page_size();
+		virtual bool reallocate();
+		virtual void unparse(FILE*);
 
-          SgAsmElfFileHeader(SgAsmGenericFile *f, addr_t offset)   /* assume 32-bit for now and fix inside ctor() if necessary */
-             : SgAsmGenericHeader(f, offset, 0)
-             { ctor(f, offset); }
-       // virtual ~SgAsmElfFileHeader() {}
+		void *encode(SgAsmExecutableFileFormat::ByteOrder, SgAsmElfFileHeader::Elf32FileHeader_disk*);
+		void *encode(SgAsmExecutableFileFormat::ByteOrder, SgAsmElfFileHeader::Elf64FileHeader_disk*);
 
-          uint64_t max_page_size();
-	  virtual bool reallocate();
-          virtual void unparse(FILE*);
+		virtual void dump(FILE*, const char *prefix, ssize_t idx);
 
-          void *encode(SgAsmExecutableFileFormat::ByteOrder, SgAsmElfFileHeader::Elf32FileHeader_disk*);
-          void *encode(SgAsmExecutableFileFormat::ByteOrder, SgAsmElfFileHeader::Elf64FileHeader_disk*);
+		SgAsmGenericSectionPtrList get_sectab_sections();
+		SgAsmGenericSectionPtrList get_segtab_sections();
 
-          virtual void dump(FILE*, const char *prefix, ssize_t idx);
+	private:
+		void ctor(SgAsmGenericFile *f, addr_t offset);
 
-	// Override what ROSETTA would generate because we can't have users modifying these in the AST!
-	  addr_t get_e_shoff() const {return p_e_shoff;}
-	  addr_t get_e_phoff() const {return p_e_phoff;}
-	  void set_e_shoff(addr_t); //checks that we're parsing
-	  void set_e_phoff(addr_t); //checks that we're parsing
-
-     private:
-          void ctor(SgAsmGenericFile *f, addr_t offset);
-
-     public:
-       // Forward reference
-       // class Exec::ELF::ElfFileHeader;
-       //   AsmElfHeader
-       // SgAsmElfFileHeader ( Exec::ELF::ElfFileHeader* elf_file_header );
-
-       // Overloaded base class virtual function
-          const char *format_name();
-
-          static bool is_ELF(SgAsmGenericFile*);
-          static SgAsmElfFileHeader *parse(SgAsmGenericFile*);
-
+	public:
+		virtual const char *format_name();
+		static bool is_ELF(SgAsmGenericFile*);
+		static SgAsmElfFileHeader *parse(SgAsmGenericFile*);
 HEADER_ELF_HEADER_END
 
 HEADER_ELF_SECTION_TABLE_START
@@ -1604,8 +1610,8 @@
               PT_PHDR             = 6,                    /* Segment contains the segment table itself (program header array) */
 
 	      /* OS- and Processor-specific ranges */
-	      PT_LOOS		  = 0x60000000,		  /* Values reserved for OS-specific semantics */
-	      PT_HIOS             = 0x6fffffff,
+              PT_LOOS             = 0x60000000,           /* Values reserved for OS-specific semantics */
+              PT_HIOS             = 0x6fffffff,
               PT_LOPROC           = 0x70000000,           /* Values reserved for processor-specific semantics */
               PT_HIPROC           = 0x7fffffff,
 
@@ -1780,160 +1786,148 @@
 
 
 HEADER_PE_FILE_HEADER_START
+	public:
+		/* File format of a PE File Header. All fields are little endian. */
+		struct PEFileHeader_disk {
+			unsigned char e_magic[4];	/* magic number "PE\0\0" */
+			uint16_t    e_cpu_type;         /* e.g., 0x014c = Intel 386 */
+			uint16_t    e_nsections;        /* number of sections defined in the Section Table */
+			uint32_t    e_time;             /* time and date file was created or modified by the linker */
+			uint32_t    e_coff_symtab;      /* offset to COFF symbol table */
+			uint32_t    e_coff_nsyms;       /* number of symbols in COFF symbol table */
+			uint16_t    e_nt_hdr_size;      /* num remaining bytes in the header following the 'flags' field */
+			uint16_t    e_flags;            /* Bit flags: exe file, program/library image, fixed address, etc. */
+		} __attribute__((packed));
 
-     public:
-       // Overloaded base class virtual function
-          const char *format_name();
+		struct PE32OptHeader_disk {
+			uint16_t    e_opt_magic;        /* magic number */
+			uint16_t    e_lmajor;           /* linker version */
+			uint16_t    e_lminor;
+			uint16_t    e_code_size;        /* Size of .text or sum of all code sections */
+			uint32_t    e_data_size;        /* Sum size of initialized data */
+			uint32_t    e_bss_size;         /* Sum size of uninitialized data */
+			uint32_t    e_entrypoint_rva;   /* RVA="relative virtual address"; relative to 'image_base', below */
+			uint32_t    e_code_rva;         /* Address relative to image base for code section when memory mapped */
+			uint32_t    e_data_rva;         /* Address relative to image base for data section */
+			uint32_t    e_image_base;       /* Virtual base of image (first byte of file, DOS header). 64k aligned */
+			uint32_t    e_section_align;    /* Alignment of sections in memory. Power of two 512<=x<=256M */
+			uint32_t    e_file_align;       /* Alignment factor (in bytes) for image pages */
+			uint16_t    e_os_major;         /* OS version number required to run this image */
+			uint16_t    e_os_minor;
+			uint16_t    e_user_major;       /* User-specified at link time for differentiating between image revs */
+			uint16_t    e_user_minor;
+			uint16_t    e_subsys_major;     /* Subsystem version number */
+			uint16_t    e_subsys_minor;
+			uint32_t    e_reserved9;
+			uint32_t    e_image_size;       /* Virtual size (bytes) of the image inc. all headers; section_align */
+			uint32_t    e_header_size;      /* Total header size (DOS Header + PE Header + Section table */
+			uint32_t    e_file_checksum;    /* Checksum for entire file; Set to zero by the linker */
+			uint16_t    e_subsystem;        /* Unknown, Native, WindowsGUI, WindowsCharacter, OS/2 Character, etc. */
+			uint16_t    e_dll_flags;        /* Bit flags for library init/terminate per process or thread */
+			uint32_t    e_stack_reserve_size;/* Virtual memory reserved for stack; non-committed pages are guards */
+			uint32_t    e_stack_commit_size;/* Size of valid stack; other pages are guards; <= 'stack_reserve_size' */
+			uint32_t    e_heap_reserve_size;/* Size (bytes) of local heap to reserve */
+			uint32_t    e_heap_commit_size; /* Size (bytes) of valid local heap */
+			uint32_t    e_loader_flags;     /* Reserved, must be zero */
+			uint32_t    e_num_rvasize_pairs;/* Number of RVASizePair entries that follow this member; part of header */
+		} __attribute__((packed));
 
-          static bool is_PE (SgAsmGenericFile*);
-          static SgAsmPEFileHeader *parse(SgAsmGenericFile*);
+		struct PE64OptHeader_disk {
+			uint16_t    e_opt_magic;
+			uint16_t    e_lmajor;
+			uint16_t    e_lminor;
+			uint16_t    e_code_size;
+			uint32_t    e_data_size;
+			uint32_t    e_bss_size;
+			uint32_t    e_entrypoint_rva;
+			uint32_t    e_code_rva;
+			// uint32_t  e_data_rva;             /* Not present in PE32+ */
+			uint64_t    e_image_base;
+			uint32_t    e_section_align;
+			uint32_t    e_file_align;
+			uint16_t    e_os_major;
+			uint16_t    e_os_minor;
+			uint16_t    e_user_major;
+			uint16_t    e_user_minor;
+			uint16_t    e_subsys_major;
+			uint16_t    e_subsys_minor;
+			uint32_t    e_reserved9;
+			uint32_t    e_image_size;
+			uint32_t    e_header_size;
+			uint32_t    e_file_checksum;
+			uint16_t    e_subsystem;
+			uint16_t    e_dll_flags;
+			uint64_t    e_stack_reserve_size;
+			uint64_t    e_stack_commit_size;
+			uint64_t    e_heap_reserve_size;
+			uint64_t    e_heap_commit_size;
+			uint32_t    e_loader_flags;
+			uint32_t    e_num_rvasize_pairs;
+		} __attribute__((packed));
 
-       /* File format of a PE File Header. All fields are little endian. */
-          struct PEFileHeader_disk {
-               unsigned char e_magic[4];           /* magic number "PE\0\0" */
-               uint16_t    e_cpu_type;             /* e.g., 0x014c = Intel 386 */
-               uint16_t    e_nsections;            /* number of sections defined in the Section Table */
-               uint32_t    e_time;                 /* time and date file was created or modified by the linker */
-               uint32_t    e_coff_symtab;          /* offset to COFF symbol table */
-               uint32_t    e_coff_nsyms;           /* number of symbols in COFF symbol table */
-               uint16_t    e_nt_hdr_size;          /* number of remaining bytes in the header following the 'flags' field */
-               uint16_t    e_flags;                /* Bit flags: executable file, program/library image, fixed address, etc. */
-             } __attribute__((packed));
+		/* Bit flags for the PE header 'flags' member */
+		enum HeaderFlags {
+			HF_PROGRAM          = 0x0000,       /* Program image (no non-reserved bits set) */
+			HF_EXECUTABLE       = 0x0002,       /* Clear indicates can't load: link errors or incrementally linked */
+			HF_FIXED            = 0x0200,       /* Image *must* be loaded at image_base address or error */
+			HF_LIBRARY          = 0x2000,       /* Library image */
+			HF_RESERVED_MASK    = 0xddfd        /* Reserved bits */
+		};
 
-          struct PE32OptHeader_disk {
-               uint16_t    e_opt_magic;            /* magic number */
-               uint16_t    e_lmajor;               /* linker version */
-               uint16_t    e_lminor;
-               uint16_t    e_code_size;            /* Size of .text or sum of all code sections */
-               uint32_t    e_data_size;            /* Sum size of initialized data */
-               uint32_t    e_bss_size;             /* Sum size of uninitialized data */
-               uint32_t    e_entrypoint_rva;       /* RVA="relative virtual address"; relative to 'image_base', below */
-               uint32_t    e_code_rva;             /* Address relative to image base for code section when memory mapped */
-               uint32_t    e_data_rva;             /* Address relative to image base for data section */
-               uint32_t    e_image_base;           /* Virtual base of the image (first byte of file, DOS header). Multiple of 64k. */
-               uint32_t    e_section_align;        /* Alignment of sections in memory. Power of two 512<=x<=256M */
-               uint32_t    e_file_align;           /* Alignment factor (in bytes) for image pages */
-               uint16_t    e_os_major;             /* OS version number required to run this image */
-               uint16_t    e_os_minor;
-               uint16_t    e_user_major;           /* User-specified at link time. Useful for differentiating between image revisions */
-               uint16_t    e_user_minor;
-               uint16_t    e_subsys_major;         /* Subsystem version number */
-               uint16_t    e_subsys_minor;
-               uint32_t    e_reserved9;
-               uint32_t    e_image_size;           /* Virtual size (bytes) of the image inc. all headers; multiple of 'section_align' */
-               uint32_t    e_header_size;          /* Total header size (DOS Header + PE Header + Section table */
-               uint32_t    e_file_checksum;        /* Checksum for entire file; Set to zero by the linker */
-               uint16_t    e_subsystem;            /* Unknown, Native, WindowsGUI, WindowsCharacter, OS/2 Character, POSIX Character */
-               uint16_t    e_dll_flags;            /* Bit flags for library init/terminate per process or thread */
-               uint32_t    e_stack_reserve_size;   /* Virtual memory reserved for stack; non-committed pages are guards */
-               uint32_t    e_stack_commit_size;    /* Size (bytes) of valid stack; other pages are guards; <= 'stack_reserve_size' */
-               uint32_t    e_heap_reserve_size;    /* Size (bytes) of local heap to reserve */
-               uint32_t    e_heap_commit_size;     /* Size (bytes) of valid local heap */
-               uint32_t    e_loader_flags;         /* Reserved, must be zero */
-               uint32_t    e_num_rvasize_pairs;    /* Number of RVASizePair entries that follow this member; also part of the PE header */
-             } __attribute__((packed));
+		/* Values for the PE header 'subsystem' member */
+		enum Subsystem {
+			HF_SPEC_UNKNOWN     = 0x0000,       /* Specified as 'unknown' in the file */
+			HF_NATIVE           = 0x0001,       /* Native */
+			HF_WINGUI           = 0x0002,       /* Windows GUI */
+			HF_WINCHAR          = 0x0003,       /* Windows character */
+			HF_OS2CHAR          = 0x0005,       /* OS/2 character */
+			HF_POSIX            = 0x0007        /* POSIX character */
+		};
 
-          struct PE64OptHeader_disk {
-               uint16_t    e_opt_magic;
-               uint16_t    e_lmajor;
-               uint16_t    e_lminor;
-               uint16_t    e_code_size;
-               uint32_t    e_data_size;
-               uint32_t    e_bss_size;
-               uint32_t    e_entrypoint_rva;
-               uint32_t    e_code_rva;
-            // uint32_t  e_data_rva;             /* Not present in PE32+ */
-               uint64_t    e_image_base;
-               uint32_t    e_section_align;
-               uint32_t    e_file_align;
-               uint16_t    e_os_major;
-               uint16_t    e_os_minor;
-               uint16_t    e_user_major;
-               uint16_t    e_user_minor;
-               uint16_t    e_subsys_major;
-               uint16_t    e_subsys_minor;
-               uint32_t    e_reserved9;
-               uint32_t    e_image_size;
-               uint32_t    e_header_size;
-               uint32_t    e_file_checksum;
-               uint16_t    e_subsystem;
-               uint16_t    e_dll_flags;
-               uint64_t    e_stack_reserve_size;
-               uint64_t    e_stack_commit_size;
-               uint64_t    e_heap_reserve_size;
-               uint64_t    e_heap_commit_size;
-               uint32_t    e_loader_flags;
-               uint32_t    e_num_rvasize_pairs;
-             } __attribute__((packed));
+		/* Bit flags for the PE header 'dll_flags' member */
+		enum DLLFlags {
+			DLL_PROC_INIT       = 0x0001,       /* Per-process library initialization */
+			DLL_PROC_TERM       = 0x0002,       /* Per-process library termination */
+			DLL_THRD_INIT       = 0x0004,       /* Per-thread library initialization */
+			DLL_THRD_TERM       = 0x0008,       /* Per-thread library termination */
+			DLL_RESERVED_MASK   = 0xfff0        /* Reserved bits */
+		};
 
-          /* Bit flags for the PE header 'flags' member */
-          enum HeaderFlags {
-               HF_PROGRAM          = 0x0000,       /* Program image (no non-reserved bits set) */
-               HF_EXECUTABLE       = 0x0002,       /* Clear indicates can't load: either link errors or image is being incrementally linked */
-               HF_FIXED            = 0x0200,       /* Image *must* be loaded at image_base address or error */
-               HF_LIBRARY          = 0x2000,       /* Library image */
-               HF_RESERVED_MASK    = 0xddfd        /* Reserved bits */
-             };
+	public:
+		SgAsmPEFileHeader(SgAsmGenericFile *f, addr_t offset);
+		virtual ~SgAsmPEFileHeader();
 
-          /* Values for the PE header 'subsystem' member */
-          enum Subsystem {
-               HF_SPEC_UNKNOWN     = 0x0000,       /* Specified as 'unknown' in the file */
-               HF_NATIVE           = 0x0001,       /* Native */
-               HF_WINGUI           = 0x0002,       /* Windows GUI */
-               HF_WINCHAR          = 0x0003,       /* Windows character */
-               HF_OS2CHAR          = 0x0005,       /* OS/2 character */
-               HF_POSIX            = 0x0007        /* POSIX character */
-             };
+		virtual const char *format_name();
+		static bool is_PE (SgAsmGenericFile*);
+		static SgAsmPEFileHeader *parse(SgAsmGenericFile*);
+		void add_rvasize_pairs();
 
-          /* Bit flags for the PE header 'dll_flags' member */
-          enum DLLFlags {
-               DLL_PROC_INIT       = 0x0001,       /* Per-process library initialization */
-               DLL_PROC_TERM       = 0x0002,       /* Per-process library termination */
-               DLL_THRD_INIT       = 0x0004,       /* Per-thread library initialization */
-               DLL_THRD_TERM       = 0x0008,       /* Per-thread library termination */
-               DLL_RESERVED_MASK   = 0xfff0        /* Reserved bits */
-             };
+		virtual bool reallocate();
+		virtual void unparse(FILE*);
+		virtual void dump(FILE*, const char *prefix, ssize_t idx);
+		void create_table_sections();
 
-     public:
-          SgAsmPEFileHeader(SgAsmGenericFile *f, addr_t offset);
+		/* Override some ROSETTA accessors */
+		rose_addr_t get_e_coff_symtab() const {return p_e_coff_symtab;}
+		void set_e_coff_symtab(addr_t);
+		unsigned get_e_coff_nsyms() const {return p_e_coff_nsyms;}
+		void set_e_coff_nsyms(unsigned);
+		unsigned get_e_nsections() const {return p_e_nsections;}
+		void set_e_nsections(unsigned);
+		unsigned get_e_header_size() const {return p_e_header_size;}
+		void set_e_header_size(unsigned);
+		unsigned get_e_num_rvasize_pairs() const {return p_e_num_rvasize_pairs;}
+		void set_e_num_rvasize_pairs(unsigned);
+		unsigned get_e_lmajor() const {return p_e_lmajor;}
+		void set_e_lmajor(unsigned);
+		unsigned get_e_lminor() const {return p_e_lminor;}
+		void set_e_lminor(unsigned);
 
-       // DQ (8/16/2008): Implemented destructor to delete the p_rvasize_pairs
-          virtual ~SgAsmPEFileHeader();
-
-          void add_rvasize_pairs();
-          virtual void unparse(FILE*);
-          virtual void dump(FILE*, const char *prefix, ssize_t idx);
-	  void create_table_sections();
-
-       /* Accessors for protected/private data members */
-       // ExtendedDOSHeader *get_dos2_header() {return dos2_header;}
-       // void set_dos2_header(ExtendedDOSHeader *h) {dos2_header=h;}
-       // PESectionTable *get_section_table() {return section_table;}
-       // void set_section_table(PESectionTable *ot) {section_table=ot;}
-       // COFFSymtab *get_coff_symtab() {return coff_symtab;}
-       // void set_coff_symtab(COFFSymtab *st) {coff_symtab=st;}
-    
-    /* These are the native-format versions of the same members described in the PEFileHeader_disk format struct. */
-       // unsigned    e_cpu_type, e_nsections, e_time;
-       // addr_t      e_coff_symtab, e_nt_hdr_size;
-       // unsigned    e_coff_nsyms, e_flags, e_opt_magic;
-       // unsigned    e_lmajor, e_lminor, e_code_size, e_data_size, e_bss_size, e_entrypoint_rva, e_code_rva, e_data_rva;
-      //  addr_t      e_image_base;
-       // unsigned    e_section_align, e_file_align, e_os_major, e_os_minor, e_user_major, e_user_minor;
-       // unsigned    e_subsys_major, e_subsys_minor, e_reserved9, e_image_size, e_header_size, e_file_checksum, e_subsystem;
-       // unsigned    e_dll_flags, e_stack_reserve_size, e_stack_commit_size, e_heap_reserve_size, e_heap_commit_size;
-       // unsigned    e_loader_flags, e_num_rvasize_pairs;
-       // std::vector<RVASizePair> rvasize_pairs;
-
-     private:
-          void ctor(SgAsmGenericFile *f, addr_t offset);
-          void *encode(SgAsmPEFileHeader::PEFileHeader_disk*);
-          void *encode(SgAsmPEFileHeader::PE32OptHeader_disk*);
-          void *encode(SgAsmPEFileHeader::PE64OptHeader_disk*);
-       // ExtendedDOSHeader *dos2_header;
-       // PESectionTable *section_table;
-       // COFFSymtab *coff_symtab;
-
+	private:
+		void ctor(SgAsmGenericFile *f, addr_t offset);
+		void *encode(SgAsmPEFileHeader::PEFileHeader_disk*);
+		void *encode(SgAsmPEFileHeader::PE32OptHeader_disk*);
+		void *encode(SgAsmPEFileHeader::PE64OptHeader_disk*);
 HEADER_PE_FILE_HEADER_END
 
 HEADER_PE_SECTION_START
@@ -1953,23 +1947,92 @@
 HEADER_PE_SECTION_END
 
 HEADER_PE_IMPORT_SECTION_START
-     public:
-          SgAsmPEImportSection(SgAsmPEFileHeader *fhdr, addr_t offset, addr_t size, addr_t mapped_rva);
-       // virtual ~PEImportSection() {}
+	public:
+		SgAsmPEImportSection(SgAsmPEFileHeader *fhdr, addr_t offset, addr_t size, addr_t mapped_rva)
+			: SgAsmPESection(fhdr, offset, size)
+			{ctor(offset, size, mapped_rva);}
+		//virtual void unparse(FILE*);  FIXME: Temporarily commented out (see implementation comments)
+		virtual void dump(FILE*, const char *prefix, ssize_t idx);
+		void add_dll(SgAsmPEDLL *d);
+	private:
+		void ctor(addr_t offset, addr_t size, addr_t mapped_rva);
+HEADER_PE_IMPORT_SECTION_END
 
-          virtual void unparse(FILE*);
-          virtual void dump(FILE*, const char *prefix, ssize_t idx);
-          void add_dll(SgAsmPEDLL *d);
 
-       /* Accessors for protected/private data members */
-       // const std::vector<PEDLL*>& get_dlls() {return dlls;}
 
-     private:
-          void ctor(addr_t offset, addr_t size, addr_t mapped_rva);
-       // std::vector<PEDLL*> dlls;
+HEADER_PE_EXPORT_DIRECTORY_START
+	public:
+		/* An Export Section begins with the Export Directory */
+		struct PEExportDirectory_disk {
+			uint32_t res1;         /* 0x00 Reserved, must be zero */
+			uint32_t timestamp;    /* 0x04 Time that export data was created */
+			uint16_t vmajor;       /* 0x08 Major version number (user defined) */
+			uint16_t vminor;       /* 0x0a Minor version number (user defined) */
+			uint32_t name_rva;     /* 0x0c Location of name of DLL */
+			uint32_t ord_base;     /* 0x10 Starting ordinal for exports in this image (usually 1) */
+			uint32_t expaddr_n;    /* 0x14 Number of entries in the export address table */
+			uint32_t nameptr_n;    /* 0x18 Number of entries in the name pointer table and ordinal table */
+			uint32_t expaddr_rva;  /* 0x1c Location of Export Address Table */
+			uint32_t nameptr_rva;  /* 0x20 Location of Export Name Pointer Table */
+			uint32_t ordinals_rva; /* 0x24 Location of Ordinal Table */
+		} __attribute__((packed));     /* 0x28 */
 
-HEADER_PE_IMPORT_SECTION_END
+		SgAsmPEExportDirectory(SgAsmPEExportSection *s)
+			{ctor(s);}
+		void dump(FILE *f, const char *prefix, ssize_t idx);
+	private:
+		void ctor(SgAsmPEExportSection*);
+HEADER_PE_EXPORT_DIRECTORY_END
 
+
+
+HEADER_PE_EXPORT_ENTRY_START
+	public:
+		SgAsmPEExportEntry(SgAsmGenericString *name, unsigned ordinal, rose_rva_t export_rva,
+				   SgAsmGenericString *forwarder)
+			{ctor(name, ordinal, export_rva, forwarder);}
+
+		void dump(FILE *f,const char *prefix,ssize_t idx);
+
+		/* Accessors. Override ROSETTA because we adjust parents. */
+		SgAsmGenericString *get_name() const {return p_name;}
+		void set_name(SgAsmGenericString*);
+		SgAsmGenericString *get_forwarder() const {return p_forwarder;}
+		void set_forwarder(SgAsmGenericString*);
+	private:
+		void ctor(SgAsmGenericString *name, unsigned ordinal, rose_rva_t export_rva, SgAsmGenericString *forwarder);
+HEADER_PE_EXPORT_ENTRY_END
+
+
+
+
+HEADER_PE_EXPORT_SECTION_START
+	public:
+		/* The PE Export Address Table is an array of expaddr_n 4-byte RVAs. If the address is not in the export section
+		 * (as defined by the address and length that are indicated in the NT Optional Header) then the RVA is an actual
+		 * address in code or data. Otherwise its a Forwarder RVA that names a symbol in another DLL. */
+		typedef uint32_t ExportAddress_disk;
+
+		/* The PE Export Name Pointer Table is an array of nameptr_n 4-byte RVAs pointing into the Export Name Table. The
+		 * pointers are ordered lexically to allow binary searches.  An export name is defined only if the export name
+		 * pointer table contains a pointer to it. */
+		typedef uint32_t ExportNamePtr_disk;
+
+		/* The PE Export Ordinal Table is an array of nameptr_n (yes) 2-byte indices into the Export Address Table biased
+		 * by ord_base. In other words, the ord_base must be subtracted from the ordinals to obtain true indices into the
+		 * Export Address Table. */
+		typedef uint16_t ExportOrdinal_disk;
+
+		SgAsmPEExportSection(SgAsmPEFileHeader *fhdr, addr_t offset, addr_t size, addr_t mapped_rva)
+			: SgAsmPESection(fhdr, offset, size)
+			{ctor(offset, size, mapped_rva);}
+
+		virtual void dump(FILE*, const char *prefix, ssize_t idx);
+		void add_entry(SgAsmPEExportEntry*);
+	private:
+		void ctor(addr_t offset, addr_t size, addr_t mapped_rva);
+HEADER_PE_EXPORT_SECTION_END
+
 HEADER_PE_SECTION_TABLE_START
      public:
           SgAsmPESectionTable(SgAsmPEFileHeader *fhdr, addr_t offset, addr_t size);
@@ -3889,388 +3952,6 @@
 // *************************************
 
 SOURCE_EXECUTABLE_FILE_FORMAT_START
-
-SgAsmExecutableFileFormat::ByteOrder
-SgAsmExecutableFileFormat::host_order()
-   {
-     static const int i = 1;
-     return *(unsigned char*)&i ? ORDER_LSB : ORDER_MSB;
-   }
-
-/* Swap (reverse) bytes taking care of sign extension */
-uint8_t
-SgAsmExecutableFileFormat::swap_bytes(uint8_t n)
-   {
-     return n;
-   }
-
-uint16_t
-SgAsmExecutableFileFormat::swap_bytes(uint16_t n)
-   {
-     return ((n>>8) & 0xff) | ((n<<8) & 0xff00);
-   }
-
-uint32_t
-SgAsmExecutableFileFormat::swap_bytes(uint32_t n)
-   {
-     return ((n>>24) & 0xff) | ((n>>8) & 0xff00) | ((n<<8) & 0xff0000) | ((n<<24) & 0xff000000u);
-   }
-
-uint64_t
-SgAsmExecutableFileFormat::swap_bytes(uint64_t n)
-   {
-     return (((n>>56) & (0xffull<<0 )) | ((n>>40) & (0xffull<<8 )) | ((n>>24) & (0xffull<<16)) | ((n>>8 ) & (0xffull<<24)) |
-             ((n<<8 ) & (0xffull<<32)) | ((n<<24) & (0xffull<<40)) | ((n<<40) & (0xffull<<48)) | ((n<<56) & (0xffull<<56)));
-   }
-
-int8_t
-SgAsmExecutableFileFormat::swap_bytes(int8_t n)
-   {
-     return swap_bytes((uint8_t)n);
-   }
-
-int16_t
-SgAsmExecutableFileFormat::swap_bytes(int16_t n)
-   {
-     return swap_bytes((uint16_t)n);
-   }
-
-int32_t
-SgAsmExecutableFileFormat::swap_bytes(int32_t n)
-   {
-     return swap_bytes((uint32_t)n);
-   }
-
-int64_t
-SgAsmExecutableFileFormat::swap_bytes(int64_t n)
-   {
-     return swap_bytes((uint64_t)n);
-   }
-
-/* Little-endian byte order conversions */
-uint8_t
-SgAsmExecutableFileFormat::le_to_host(uint8_t n)
-   {
-     return ORDER_LSB==host_order() ? n : swap_bytes(n);
-   }
-
-uint16_t
-SgAsmExecutableFileFormat::le_to_host(uint16_t n)
-   {
-     return ORDER_LSB==host_order() ? n : swap_bytes(n);
-   }
-
-uint32_t
-SgAsmExecutableFileFormat::le_to_host(uint32_t n)
-   {
-     return ORDER_LSB==host_order() ? n : swap_bytes(n);
-   }
-
-uint64_t
-SgAsmExecutableFileFormat::le_to_host(uint64_t n)
-   {
-     return ORDER_LSB==host_order() ? n : swap_bytes(n);
-   }
-
-int8_t
-SgAsmExecutableFileFormat::le_to_host(int8_t n)
-   {
-     return ORDER_LSB==host_order() ? n : swap_bytes(n);
-   }
-
-int16_t
-SgAsmExecutableFileFormat::le_to_host(int16_t n)
-   {
-     return ORDER_LSB==host_order() ? n : swap_bytes(n);
-   }
-
-int32_t
-SgAsmExecutableFileFormat::le_to_host(int32_t n)
-   {
-     return ORDER_LSB==host_order() ? n : swap_bytes(n);
-   }
-
-int64_t
-SgAsmExecutableFileFormat::le_to_host(int64_t n)
-   {
-     return ORDER_LSB==host_order() ? n : swap_bytes(n);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_le(unsigned h, uint8_t *n)
-   {
-     assert(0==(h & ~0xff));
-     uint8_t hh = h;
-     *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_le(unsigned h, uint16_t *n)
-   {
-     assert(0==(h & ~0xffff));
-     uint16_t hh = h;
-     *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_le(unsigned h, uint32_t *n)
-   {
-     assert(0==(h & ~0xfffffffful));
-     uint32_t hh = h;
-     *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_le(addr_t h, uint64_t *n)
-   {
-     assert(0==(h & ~0xffffffffffffffffull));
-     uint64_t hh = h;
-     *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_le(int h, int8_t *n)
-   {
-     assert((unsigned)h<=0x8f || ((unsigned)h|0xff)==(unsigned)-1);
-     int8_t hh = h;
-     *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_le(int h, int16_t *n)
-   {
-     assert((unsigned)h<=0x8fff || ((unsigned)h|0xffff)==(unsigned)-1);
-     int16_t hh = h;
-     *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_le(int h, int32_t *n)
-   {
-     assert((unsigned)h<=0x8fffffffu || ((unsigned)h|0xffffffffu)==(unsigned)-1);
-     int32_t hh = h;
-     *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_le(int64_t h, int64_t *n)
-   {
-     *n = ORDER_LSB==host_order() ? h : swap_bytes(h);
-   }
-
-/* Big-endian byte order conversions */
-uint8_t
-SgAsmExecutableFileFormat::be_to_host(uint8_t n)
-   {
-     return ORDER_MSB==host_order() ? n : swap_bytes(n);
-   }
-
-uint16_t
-SgAsmExecutableFileFormat::be_to_host(uint16_t n)
-   {
-     return ORDER_MSB==host_order() ? n : swap_bytes(n);
-   }
-
-uint32_t
-SgAsmExecutableFileFormat::be_to_host(uint32_t n)
-   {
-     return ORDER_MSB==host_order() ? n : swap_bytes(n);
-   }
-
-uint64_t
-SgAsmExecutableFileFormat::be_to_host(uint64_t n)
-   {
-     return ORDER_MSB==host_order() ? n : swap_bytes(n);
-   }
-
-int8_t
-SgAsmExecutableFileFormat::be_to_host(int8_t n)
-   {
-     return ORDER_MSB==host_order() ? n : swap_bytes(n);
-   }
-
-int16_t
-SgAsmExecutableFileFormat::be_to_host(int16_t n)
-   {
-     return ORDER_MSB==host_order() ? n : swap_bytes(n);
-   }
-
-int32_t
-SgAsmExecutableFileFormat::be_to_host(int32_t n)
-   {
-     return ORDER_MSB==host_order() ? n : swap_bytes(n);
-   }
-
-int64_t
-SgAsmExecutableFileFormat::be_to_host(int64_t n)
-   {
-     return ORDER_MSB==host_order() ? n : swap_bytes(n);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_be(unsigned h, uint8_t *n)
-   {
-     assert(0==(h & ~0xff));
-     uint8_t hh = h;
-     *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_be(unsigned h, uint16_t *n)
-   {
-     assert(0==(h & ~0xffff));
-     uint16_t hh = h;
-     *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_be(unsigned h, uint32_t *n)
-   {
-     assert(0==(h & ~0xfffffffful));
-     uint32_t hh = h;
-     *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_be(addr_t h, uint64_t *n)
-   {
-     assert(0==(h & ~0xffffffffffffffffull));
-     uint64_t hh = h;
-     *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_be(int h, int8_t *n)
-   {
-     assert((unsigned)h<0x8f || ((unsigned)h|0xff)==(unsigned)-1);
-     int8_t hh = h;
-     *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_be(int h, int16_t *n)
-   {
-     assert((unsigned)h<0x8fff || ((unsigned)h|0xffff)==(unsigned)-1);
-     int16_t hh = h;
-     *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_be(int h, int32_t *n)
-   {
-     assert((unsigned)h<0x8ffffffful || ((unsigned)h|0xfffffffful)==(unsigned)-1);
-     int32_t hh = h;
-     *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_be(int64_t h, int64_t *n)
-   {
-     *n = ORDER_MSB==host_order() ? h : swap_bytes(h);
-   }
-
-/* Caller-specified byte order conversions */
-uint8_t
-SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, uint8_t n)
-   {
-     return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
-   }
-
-uint16_t
-SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, uint16_t n)
-   {
-     return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
-   }
-
-uint32_t
-SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, uint32_t n)
-   {
-     return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
-   }
-
-uint64_t
-SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, uint64_t n)
-   {
-     return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
-   }
-
-int8_t
-SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, int8_t n)
-   {
-     return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
-   }
-
-int16_t
-SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, int16_t n)
-   {
-     return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
-   }
-
-int32_t
-SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, int32_t n)
-   {
-     return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
-   }
-
-int64_t
-SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, int64_t n)
-   {
-     return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
-   }
-
-// void SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder, unsigned char h, unsigned char *np)
-//    {
-//      *np = h;
-//    }
-
-void
-SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, unsigned h, uint8_t *np)
-   {
-     ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, unsigned h, uint16_t *np)
-   {
-     ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, unsigned h, uint32_t *np)
-   {
-     ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, addr_t h, uint64_t *np)
-   {
-     ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int h, int8_t *np)
-   {
-     ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int h, int16_t *np)
-   {
-     ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int h, int32_t *np)
-   {
-     ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
-   }
-
-void
-SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int64_t h, int64_t *np)
-   {
-     ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
-   }
-
 SOURCE_EXECUTABLE_FILE_FORMAT_END
 
 
@@ -4786,23 +4467,6 @@
 
 SOURCE_PE_SECTION_END
 
-SOURCE_PE_IMPORT_SECTION_START
-
-SgAsmPEImportSection::SgAsmPEImportSection(SgAsmPEFileHeader *fhdr, addr_t offset, addr_t size, addr_t mapped_rva)
-   : SgAsmPESection(fhdr, offset, size)
-   {
-     ctor(offset, size, mapped_rva);
-   }
-
-void
-SgAsmPEImportSection::add_dll(SgAsmPEDLL *d)
-   {
-     ROSE_ASSERT(p_dlls != NULL);
-     p_dlls->get_dlls().push_back(d);
-   }
-
-SOURCE_PE_IMPORT_SECTION_END
-
 SOURCE_PE_SECTION_TABLE_START
 SgAsmPESectionTable::SgAsmPESectionTable(SgAsmPEFileHeader *fhdr, addr_t offset, addr_t size)
    : SgAsmGenericSection(fhdr->get_file(), fhdr, offset, size)

Modified: branches/rice/src/ROSETTA/Grammar/Common.code
===================================================================
--- branches/rice/src/ROSETTA/Grammar/Common.code	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/Grammar/Common.code	2008-11-11 22:06:33 UTC (rev 119)
@@ -181,18 +181,16 @@
        */
           virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const;
 
-      /*! \brief \b FOR \b INTERNAL \b USE Returns STL vector of pairs of references to SgNode* and strings for use in AST tools
+      /*! \brief \b FOR \b INTERNAL \b USE Processes pairs of references to SgNode* and strings for use in AST tools
 
-          This functions similar to returnDataMemberPointers() except that it containes pointers to SgNode* instead 
-          of SgNode pointers as values.  As a result there is FAR more damage that can be done by using this function.
+          This functions similar to returnDataMemberPointers() except that it passes references to a handler object.
+          As a result there is FAR more damage that can be done by using this function, but it is type-safe.
           This is provided for support of internal tools that operate on the AST, e.g the AST Merge mechanism.
 
           \warning This function can return unexpected data members and thus the order and the number of elements is unpredicable 
                    and subject to change.
-
-          \returns STL vector of pairs of SgNode** and strings
        */
-          virtual std::vector<std::pair<SgNode**,std::string> > returnDataMemberReferenceToPointers();
+          virtual void processDataMemberReferenceToPointers(ReferenceToPointerHandler*);
 
       /*! \brief \b FOR \b INTERNAL \b USE Returns a unique index value for the childNode in the list of children at this IR node.
 

Modified: branches/rice/src/ROSETTA/Grammar/Cxx_GlobalDeclarations.macro
===================================================================
--- branches/rice/src/ROSETTA/Grammar/Cxx_GlobalDeclarations.macro	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/Grammar/Cxx_GlobalDeclarations.macro	2008-11-11 22:06:33 UTC (rev 119)
@@ -66,3 +66,25 @@
 */
 #define DISABLE_REALLOCATION_OF_DELETED_POINTERS 1
 
+#ifndef REFERENCETOPOINTERHANDLER_DEFINED
+#define REFERENCETOPOINTERHANDLER_DEFINED
+
+// JJW (11/1/2008): This is the base class for handler objects given to
+// processReferenceToDataMembers(); just override operator()() to do your
+// replacement; apply() calls it and appropriately checks and writes back the
+// result.
+
+struct ReferenceToPointerHandler {
+  template <typename NodeSubclass>
+  void apply(NodeSubclass*& r, const SgName& n) {
+    SgNode* sgn = r;
+    (*this)(sgn, n);
+    ROSE_ASSERT (sgn == NULL || dynamic_cast<NodeSubclass*>(sgn));
+    r = dynamic_cast<NodeSubclass*>(sgn);
+  }
+
+  virtual void operator()(SgNode*&, const SgName&) = 0;
+  virtual ~ReferenceToPointerHandler() {}
+};
+
+#endif // REFERENCETOPOINTERHANDLER_DEFINED

Modified: branches/rice/src/ROSETTA/Grammar/Node.code
===================================================================
--- branches/rice/src/ROSETTA/Grammar/Node.code	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/Grammar/Node.code	2008-11-11 22:06:33 UTC (rev 119)
@@ -20,19 +20,22 @@
  * with an SgAsmGenericSection so that if the section address (mapped_rva) is changed then all rose_rva_t objects bound to
  * that section are also automatically adjusted. */
 class rose_rva_t {
-  public:
-    rose_rva_t() : addr(0), section(0) {}
-    rose_rva_t(rose_addr_t rva) : addr(rva), section(0) {} //implicit
-    rose_rva_t(rose_addr_t rva, SgAsmGenericSection *section) : addr(rva), section(0) {set_section(section);}
-
-    /* Accessors */
-    rose_addr_t get_rva() const;
-    void set_rva(rose_addr_t rva);
-    SgAsmGenericSection *get_section() const;
-    void set_section(SgAsmGenericSection *section);
-  private:
-    rose_addr_t addr;             /* virtual address (relative to section if section is not null) */
-    SgAsmGenericSection *section; /* rva is relative to header base_va if section is null */
+	public:
+		rose_rva_t() : addr(0), section(0) {}
+		rose_rva_t(const rose_rva_t &rva) : addr(rva.addr), section(rva.section) {}
+		rose_rva_t(rose_addr_t rva) : addr(rva), section(0) {} //implicit
+		rose_rva_t(rose_addr_t rva, SgAsmGenericSection *section) : addr(rva), section(0) {set_section(section);}
+		rose_addr_t get_rva() const;
+		rose_addr_t get_rel() const;	/* returns address relative to linked section */
+		rose_addr_t get_rel(SgAsmGenericSection*); /*returns address relative to specified section*/
+		rose_rva_t& set_rva(rose_addr_t rva);
+		SgAsmGenericSection *get_section() const;
+		rose_rva_t& set_section(SgAsmGenericSection *section);
+		rose_rva_t& set_section(SgAsmGenericHeader*);
+		std::string to_string() const;
+	private:
+		rose_addr_t addr;             /* virtual address (relative to section if section is not null) */
+		SgAsmGenericSection *section; /* rva is relative to header base_va if section is null */
 };
 std::ostream &operator<<(std::ostream&, const rose_rva_t&);
 
@@ -382,6 +385,9 @@
 typedef Rose_STL_Container<SgAsmPEDLL*>        SgAsmPEDLLPtrList;
 typedef SgAsmPEDLLPtrList*                     SgAsmPEDLLPtrListPtr;
 
+typedef Rose_STL_Container<SgAsmPEExportEntry*> SgAsmPEExportEntryPtrList;
+typedef SgAsmPEExportEntryPtrList*		SgAsmPEExportEntryPtrListPtr;
+
 typedef Rose_STL_Container<unsigned>           SgUnsignedList;
 typedef SgUnsignedList*                        SgUnsignedListPtr;
 
@@ -761,7 +767,9 @@
 
 typedef std::vector<RTIMemberData> RTIReturnType;
 
+struct ReferenceToPointerHandler;
 
+
 /*! \brief Supporting class from copy mechanism within ROSE.
 
     This class forms a base class for the SgShallowCopy and SgTreeCopy

Modified: branches/rice/src/ROSETTA/Grammar/Support.code
===================================================================
--- branches/rice/src/ROSETTA/Grammar/Support.code	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/Grammar/Support.code	2008-11-11 22:06:33 UTC (rev 119)
@@ -3738,11 +3738,13 @@
       //! errorCode is the return value assembled from the multiple error codes associated with the 
       //! different phases of the compilation.  The fileNameIndex is the index into the list of
       //! file names input on the user's command line.  We need a way to process them individually!
-          SgFile ( int & argc, char** & argv, int & errorCode, int fileNameIndex = 0, SgProject* project = NULL );
-          SgFile(std::vector<std::string>& argv, int& errorCode, int fileNameIndex = 0, SgProject* project = NULL);
+          SgFile ( int & argc, char** & argv,  SgProject* project = NULL );
+          SgFile(std::vector<std::string>& argv,  SgProject* project = NULL);
 
        // SgFile ( int & argc, char** & argv, int & errorCode, int fileNameIndex, SgProject* project );
-          void doSetupForConstructor(const std::vector<std::string>& argv, int& errorCode, int fileNameIndex, SgProject* project);
+       //   virtual void doSetupForConstructor(const std::vector<std::string>& argv, int& errorCode, int fileNameIndex, SgProject* project);
+       //AS(10/04/08) Changed semantics of doSetupForConstructor to not call frontend
+          virtual void doSetupForConstructor(const std::vector<std::string>& argv, SgProject* project);
 
        // DQ (8/16/2008): Added this function to the SgFile IR node (defined in sageSupport.C).
           void generateBinaryExecutableFileInformation ( std::string sourceFilename, SgAsmFile* asmFile );
@@ -3800,7 +3802,7 @@
        // int callFrontEnd ( int & argc, char** & argv );
 
        // Get the commandline from where it is stored internally
-          int callFrontEnd();
+          virtual int callFrontEnd();
 
        // DQ (9/2/2008): Added to factor out detail fo building the AST in callFrontEnd().
           virtual int buildAST( std::vector<std::string> argv, std::vector<std::string> inputCommandLine );
@@ -3896,7 +3898,8 @@
 HEADER_APPLICATION_SOURCE_FILE_START
      public:
        // SgSourceFile ( int & argc, char** & argv, int & errorCode, int fileNameIndex = 0, SgProject* project = NULL );
-          SgSourceFile(std::vector<std::string>& argv, int& errorCode, int fileNameIndex = 0, SgProject* project = NULL);
+          SgSourceFile(std::vector<std::string>& argv, SgProject* project = NULL);
+          virtual int callFrontEnd();
        // SgSourceFile ( const SgSourceFile & X );
 
       //! Default constructor (not meant to be used)
@@ -3911,6 +3914,7 @@
           int build_Fortran_AST( std::vector<std::string> argv, std::vector<std::string> inputCommandLine );
           int build_C_and_Cxx_AST( std::vector<std::string> argv, std::vector<std::string> inputCommandLine );
           int build_PHP_AST();
+          virtual void doSetupForConstructor(const std::vector<std::string>& argv, SgProject* project);
 
        // DQ (9/5/2008): Support for older name of the SgGlobal in SgSourceFile
        // SgGlobal* get_root() const;
@@ -3930,18 +3934,31 @@
 HEADER_APPLICATION_BINARY_FILE_START
      public:
        // SgBinaryFile ( int & argc, char** & argv, int & errorCode, int fileNameIndex = 0, SgProject* project = NULL );
-          SgBinaryFile(std::vector<std::string>& argv, int& errorCode, int fileNameIndex = 0, SgProject* project = NULL);
+          SgBinaryFile(std::vector<std::string>& argv,  SgProject* project = NULL);
        // SgBinaryFile ( const SgBinaryFile & X );
 
+          virtual int callFrontEnd();
       //  Default constructor (not meant to be used)
       //  JJW (9/5/2008): the normal constructor has defaults for all of its arguments, so this is ambiguous
       //  SgBinaryFile() ROSE_DEPRECATED_FUNCTION;
 
+           virtual void doSetupForConstructor(const std::vector<std::string>& argv, SgProject* project);
+
           virtual int buildAST( std::vector<std::string> argv, std::vector<std::string> inputCommandLine );
 
 HEADER_APPLICATION_BINARY_FILE_END
 
+HEADER_APPLICATION_UNKNOWN_FILE_START
+     public:
+          SgUnknownFile(std::vector<std::string>& argv, SgProject* project = NULL);
 
+          virtual int callFrontEnd();
+          virtual void doSetupForConstructor(const std::vector<std::string>& argv, SgProject* project);
+
+HEADER_APPLICATION_UNKNOWN_FILE_END
+
+
+
 HEADER_APPLICATION_FILE_LIST_START
 HEADER_APPLICATION_FILE_LIST_END
 
@@ -9413,21 +9430,21 @@
 // Moved to sageSupport.C: void SgFile::setupSourceFilename ( const vector<string>& argv )
 // Moved to sageSupport.C: void SgFile::doSetupForConstructor(const vector<string>& argv, int& errorCode, int fileNameIndex, SgProject* project)
 
-SgFile::SgFile ( int & argc, char** & argv , int & errorCode, int fileNameIndex, SgProject* project )
+SgFile::SgFile ( int & argc, char** & argv , SgProject* project )
 // : p_numberOfCommandLineArguments(argc) , p_commandLineArgumentList(NULL)
    {
   // This constructor actually makes the call to EDG to build the AST (via callFrontEnd()).
      ROSE_ASSERT (argv && argc >= 0);
 
   // Note use of pointer arithmetic in the computation of "argv + argc", this is standard STL fair.
-     doSetupForConstructor(vector<string>(argv, argv + argc), errorCode, fileNameIndex, project);
+     doSetupForConstructor(vector<string>(argv, argv + argc),  project);
    }
 
-SgFile::SgFile ( vector<string> & argv , int & errorCode, int fileNameIndex, SgProject* project )
+SgFile::SgFile ( vector<string> & argv ,  SgProject* project )
 // : p_numberOfCommandLineArguments(argc) , p_commandLineArgumentList(NULL)
    {
   // This constructor actually makes the call to EDG to build the AST (via callFrontEnd()).
-     doSetupForConstructor(argv, errorCode, fileNameIndex, project);
+     doSetupForConstructor(argv,  project);
    }
 
 #if 0
@@ -9584,7 +9601,7 @@
      p_outputFormat            = SgFile::e_unknown_output_format;
      p_backendCompileFormat    = SgFile::e_unknown_output_format;
      p_fortran_implicit_none   = false;
-     p_fortran_openmp          = false;
+     p_openmp          = false;
 
   // DQ (12/8/2007): Added commandline support for cray pointers.
      p_cray_pointer_support = false;
@@ -10208,7 +10225,7 @@
      printf ("     p_backendCompileFormat                 = %s output format \n",backendCompileFormatName.c_str());
 
      printf ("     p_fortran_implicit_none                = %s \n",(p_fortran_implicit_none == true) ? "true" : "false");
-     printf ("     p_fortran_openmp                       = %s \n",(p_fortran_openmp == true) ? "true" : "false");
+     printf ("     p_openmp                       = %s \n",(p_openmp == true) ? "true" : "false");
      printf ("     p_cray_pointer_support                 = %s \n",(p_cray_pointer_support == true) ? "true" : "false");
      printf ("     p_output_parser_actions                = %s \n",(p_output_parser_actions == true) ? "true" : "false");
      printf ("     p_exit_after_parser                    = %s \n",(p_exit_after_parser == true) ? "true" : "false");
@@ -10414,6 +10431,15 @@
 SOURCE_APPLICATION_BINARY_FILE_START
 SOURCE_APPLICATION_BINARY_FILE_END
 
+SOURCE_APPLICATION_UNKNOWN_FILE_START
+SgUnknownFile::SgUnknownFile ( vector<string> & argv ,  SgProject* project )
+   {
+     SgFile(argv, project);
+   }
+
+SOURCE_APPLICATION_UNKNOWN_FILE_END
+
+
 SOURCE_APPLICATION_FILE_LIST_START
 SOURCE_APPLICATION_FILE_LIST_END
 

Copied: branches/rice/src/ROSETTA/Grammar/grammarProcessDataMemberReferenceToPointers.macro (from rev 117, trunk/src/ROSETTA/Grammar/grammarProcessDataMemberReferenceToPointers.macro)
===================================================================
--- branches/rice/src/ROSETTA/Grammar/grammarProcessDataMemberReferenceToPointers.macro	                        (rev 0)
+++ branches/rice/src/ROSETTA/Grammar/grammarProcessDataMemberReferenceToPointers.macro	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,11 @@
+
+void
+$CLASSNAME::processDataMemberReferenceToPointers(ReferenceToPointerHandler* handler)
+   {
+  // ------------ checking pointers of $CLASSNAME -------------------
+     ROSE_ASSERT ( p_freepointer == AST_FileIO::IS_VALID_POINTER() );
+
+     $CODE_STRING
+
+   }
+

Deleted: branches/rice/src/ROSETTA/Grammar/grammarReturnDataMemberReferenceToPointers.macro
===================================================================
--- branches/rice/src/ROSETTA/Grammar/grammarReturnDataMemberReferenceToPointers.macro	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/Grammar/grammarReturnDataMemberReferenceToPointers.macro	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,11 +0,0 @@
-
-std::vector<std::pair<SgNode**,std::string> >
-$CLASSNAME::returnDataMemberReferenceToPointers()
-   {
-  // ------------ checking pointers of $CLASSNAME -------------------
-     ROSE_ASSERT ( p_freepointer == AST_FileIO::IS_VALID_POINTER() );
-
-     $CODE_STRING
-
-   }
-

Modified: branches/rice/src/ROSETTA/astNodeList
===================================================================
--- branches/rice/src/ROSETTA/astNodeList	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/astNodeList	2008-11-11 22:06:33 UTC (rev 119)
@@ -161,6 +161,7 @@
 SgFile
 SgSourceFile
 SgBinaryFile
+SgUnknownFile
 Sg_File_Info
 SgFileList
 SgFloatVal
@@ -430,6 +431,7 @@
 SgAsmPESection
 SgAsmPESectionTable
 SgAsmPEImportSection
+SgAsmPEExportSection
 SgAsmCoffSymbolTable
 SgAsmNESection
 SgAsmNESectionTable
@@ -461,6 +463,9 @@
 SgAsmElfSegmentTableEntryList
 SgAsmPEExtendedDOSHeader
 SgAsmPEImportDirectory
+SgAsmPEExportDirectory
+SgAsmPEExportEntry
+SgAsmPEExportEntryList
 SgAsmPEImportHintName
 SgAsmPESectionTableEntry
 SgAsmPEImportHintNameList

Modified: branches/rice/src/ROSETTA/src/Makefile.am
===================================================================
--- branches/rice/src/ROSETTA/src/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/src/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -56,7 +56,7 @@
      ../Grammar/grammarStaticDataManagingClassHeader.macro \
      ../Grammar/grammarStaticDataManagingClassStorageClassHeader.macro \
      ../Grammar/grammarReturnDataMemberPointers.macro \
-     ../Grammar/grammarReturnDataMemberReferenceToPointers.macro \
+     ../Grammar/grammarProcessDataMemberReferenceToPointers.macro \
      ../Grammar/grammarGetChildIndex.macro \
      ../astNodeList
 
@@ -124,8 +124,8 @@
 	rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnDataMemberPointers.C
 	mv Cxx_GrammarReturnDataMemberPointers.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnDataMemberPointers.C
 #	DQ (4/30/2006): Added support for function to return references to IR nodes pointers
-	rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnDataMemberReferenceToPointers.C
-	mv Cxx_GrammarReturnDataMemberReferenceToPointers.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnDataMemberReferenceToPointers.C
+	rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarProcessDataMemberReferenceToPointers.C
+	mv Cxx_GrammarProcessDataMemberReferenceToPointers.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarProcessDataMemberReferenceToPointers.C
 #	DQ (4/6/2006): Added from Jochen's multifile I/O support
 	rm -f $(CXX_GRAMMAR_DIR)/astFileIO/SourcesOfIRNodesAstFileIOSupport.C
 	mv SourcesOfIRNodesAstFileIOSupport.C $(CXX_GRAMMAR_DIR)/astFileIO/SourcesOfIRNodesAstFileIOSupport.C

Modified: branches/rice/src/ROSETTA/src/binaryInstruction.C
===================================================================
--- branches/rice/src/ROSETTA/src/binaryInstruction.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/src/binaryInstruction.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -182,8 +182,10 @@
      NEW_TERMINAL_MACRO    ( AsmElfSegmentTable,  "AsmElfSegmentTable",  "AsmElfSegmentTableTag"  );
 
      NEW_TERMINAL_MACRO    ( AsmPEImportSection, "AsmPEImportSection", "AsmPEImportSectionTag" );
+     NEW_TERMINAL_MACRO    ( AsmPEExportSection, "AsmPEExportSection", "AsmPEExportSectionTag" );
      NEW_TERMINAL_MACRO    ( AsmPEStringSection, "AsmPEStringSection", "AsmPEStringSectionTag");
-     NEW_NONTERMINAL_MACRO ( AsmPESection, AsmPEImportSection | AsmPEStringSection, "AsmPESection",       "AsmPESectionTag", true /* canHaveInstances = true */ );
+     NEW_NONTERMINAL_MACRO ( AsmPESection, AsmPEImportSection | AsmPEExportSection | AsmPEStringSection,
+                             "AsmPESection",       "AsmPESectionTag", true /* canHaveInstances = true */ );
 
      NEW_TERMINAL_MACRO    ( AsmPESectionTable,  "AsmPESectionTable",  "AsmPESectionTableTag"  );
      NEW_TERMINAL_MACRO    ( AsmCoffSymbolTable, "AsmCoffSymbolTable", "AsmCoffSymbolTableTag" );
@@ -228,6 +230,8 @@
      NEW_TERMINAL_MACRO    ( AsmElfDynamicEntryList,      "AsmElfDynamicEntryList",      "AsmElfDynamicEntryListTag"      );
 
      NEW_TERMINAL_MACRO    ( AsmPERVASizePair,       "AsmPERVASizePair",       "AsmPERVASizePairTag"       );
+     NEW_TERMINAL_MACRO    ( AsmPEExportDirectory,   "AsmPEExportDirectory",   "AsmPEExportDirectoryTag"   );
+     NEW_TERMINAL_MACRO    ( AsmPEExportEntry,       "AsmPEExportEntry",       "AsmPEExportEntryTag"       );
      NEW_TERMINAL_MACRO    ( AsmPEImportDirectory,   "AsmPEImportDirectory",   "AsmPEImportDirectoryTag"   );
      NEW_TERMINAL_MACRO    ( AsmPEImportHintName,    "AsmPEImportHintName",    "AsmPEImportHintNameTag"    );
      NEW_TERMINAL_MACRO    ( AsmPESectionTableEntry, "AsmPESectionTableEntry", "AsmPESectionTableEntryTag" );
@@ -249,6 +253,7 @@
      NEW_TERMINAL_MACRO ( AsmGenericDLLList,     "AsmGenericDLLList",     "AsmGenericDLLListTag"     );
      NEW_TERMINAL_MACRO ( AsmPEDLLList,          "AsmPEDLLList",          "AsmPEDLLListTag"          );
      NEW_TERMINAL_MACRO ( AsmPERVASizePairList,  "AsmPERVASizePairList",  "AsmPERVASizePairListTag"  );
+     NEW_TERMINAL_MACRO (AsmPEExportEntryList,   "AsmPEExportEntryList",  "AsmPEExportEntryListTag"  );
 
 
   // DQ (8/2/2008): These were removed from the design by Robb (segments and sections are now the same: as sections).
@@ -274,13 +279,14 @@
   // Root of class hierarchy for binary file support
      NEW_NONTERMINAL_MACRO ( AsmExecutableFileFormat,
                AsmGenericDLL           | AsmGenericFormat        | AsmGenericDLLList           |
-               AsmGenericFile          | AsmGenericSection       | AsmGenericSymbol            | AsmGenericStrtab | 
-               AsmGenericSymbolList    | AsmGenericSectionList   | AsmGenericHeaderList        | AsmGenericString |
+               AsmGenericFile          | AsmGenericSection       | AsmGenericSymbol            | AsmGenericStrtab     | 
+               AsmGenericSymbolList    | AsmGenericSectionList   | AsmGenericHeaderList        | AsmGenericString     |
                AsmElfSectionTableEntry | AsmElfSegmentTableEntry | AsmElfSymbolList            |
-               AsmElfRelaEntry         | AsmElfRelaEntryList     |
-               AsmElfDynamicEntry      | AsmElfDynamicEntryList  | AsmElfSegmentTableEntryList | AsmStringStorage |
-               AsmPEImportDirectory    | AsmPEImportHintName     | AsmPESectionTableEntry      | 
-               AsmPERVASizePair        | AsmCoffSymbolList       | AsmPERVASizePairList        | AsmPEDLLList | AsmPEImportHintNameList |
+               AsmElfRelaEntry         | AsmElfRelaEntryList     | AsmPEExportEntry            | AsmPEExportEntryList |
+               AsmElfDynamicEntry      | AsmElfDynamicEntryList  | AsmElfSegmentTableEntryList | AsmStringStorage     |
+               AsmPEImportDirectory    | AsmPEImportHintName     | AsmPESectionTableEntry      | AsmPEExportDirectory |
+               AsmPERVASizePair        | AsmCoffSymbolList       | AsmPERVASizePairList        | AsmPEDLLList         |
+               AsmPEImportHintNameList |
                AsmNEEntryPoint         | AsmNERelocEntry         | AsmNESectionTableEntry      |
                AsmLEPageTableEntry     | AsmLEEntryPoint         | AsmLESectionTableEntry, "AsmExecutableFileFormat", "AsmExecutableFileFormatTag", false /* canHaveInstances = false */ );
 
@@ -441,9 +447,9 @@
      AsmElfFileHeader.setDataPrototype("unsigned long","e_machine","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmElfFileHeader.setDataPrototype("rose_addr_t","e_phoff","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmElfFileHeader.setDataPrototype("rose_addr_t","e_shoff","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmElfFileHeader.setDataPrototype("unsigned long","e_flags","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmElfFileHeader.setDataPrototype("unsigned long","e_ehsize","= 0",
@@ -670,37 +676,33 @@
      AsmPEFileHeader.setDataPrototype("unsigned","e_cpu_type","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_nsections","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_time","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("rose_addr_t","e_coff_symtab","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("rose_addr_t","e_nt_hdr_size","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_coff_nsyms","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_flags","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_opt_magic","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_lmajor","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_lminor","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_code_size","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_data_size","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_bss_size","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
-     AsmPEFileHeader.setDataPrototype("unsigned","e_entrypoint_rva","= 0",
+     AsmPEFileHeader.setDataPrototype("rose_rva_t","e_code_rva","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
-     AsmPEFileHeader.setDataPrototype("unsigned","e_code_rva","= 0",
+     AsmPEFileHeader.setDataPrototype("rose_rva_t","e_data_rva","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
-     AsmPEFileHeader.setDataPrototype("unsigned","e_data_rva","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
-     AsmPEFileHeader.setDataPrototype("rose_addr_t","e_image_base","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_section_align","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_file_align","= 0",
@@ -722,7 +724,7 @@
      AsmPEFileHeader.setDataPrototype("unsigned","e_image_size","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_header_size","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_file_checksum","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_subsystem","= 0",
@@ -740,7 +742,7 @@
      AsmPEFileHeader.setDataPrototype("unsigned","e_loader_flags","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("unsigned","e_num_rvasize_pairs","= 0",
-                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
   // AsmPEFileHeader.setDataPrototype("std::vector<RVASizePair>","rvasize_pairs","",
   //                       NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEFileHeader.setDataPrototype("SgAsmPERVASizePairList*","rvasize_pairs","= NULL",
@@ -763,7 +765,7 @@
 
   // addr_t e_rva, e_size;
      AsmPERVASizePair.setFunctionPrototype ( "HEADER_PE_RVA_SIZE_PAIR", "../Grammar/BinaryInstruction.code");
-     AsmPERVASizePair.setDataPrototype("rose_addr_t","e_rva","= 0",
+     AsmPERVASizePair.setDataPrototype("rose_rva_t","e_rva","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPERVASizePair.setDataPrototype("rose_addr_t","e_size","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
@@ -808,15 +810,36 @@
 
 
 
-  // std::vector<PEDLL*> dlls;
      AsmPEImportSection.setFunctionPrototype ( "HEADER_PE_IMPORT_SECTION", "../Grammar/BinaryInstruction.code");
-  // AsmPEImportSection.setDataPrototype("SgAsmPEDLLPtrList","section_table","",
-  //                       NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
-  // AsmPEImportSection.setDataPrototype("SgAsmPEDLLPtrList","dlls","",
-  //                       NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEImportSection.setDataPrototype("SgAsmPEDLLList*","dlls","",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
 
+
+
+     AsmPEExportEntryList.setDataPrototype("SgAsmPEExportEntryPtrList", "exports", "",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
+
+
+
+     AsmPEExportSection.setFunctionPrototype("HEADER_PE_EXPORT_SECTION", "../Grammar/BinaryInstruction.code");
+     AsmPEExportSection.setDataPrototype("SgAsmPEExportDirectory*", "export_dir", "= NULL",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
+     AsmPEExportSection.setDataPrototype("SgAsmPEExportEntryList*", "exports", "",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
+
+
+
+     AsmPEExportEntry.setFunctionPrototype("HEADER_PE_EXPORT_ENTRY", "../Grammar/BinaryInstruction.code");
+     AsmPEExportEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL", 
+                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
+     AsmPEExportEntry.setDataPrototype("unsigned", "ordinal", "= 0", 
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportEntry.setDataPrototype("rose_rva_t", "export_rva", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportEntry.setDataPrototype("SgAsmGenericString*", "forwarder", "= NULL", 
+                           NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
+
+
      AsmPEDLLList.setDataPrototype("SgAsmPEDLLPtrList","dlls","",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
 
@@ -876,22 +899,51 @@
      AsmPEExtendedDOSHeader.setDataPrototype("rose_addr_t","e_lfanew","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
 
-  // time_t testVariable;
-  // addr_t    hintnames_rva, bindings_rva, dll_name_rva;
-  // time_t    time;
-  // unsigned  forwarder_chain;
+
+
      AsmPEImportDirectory.setFunctionPrototype ( "HEADER_PE_IMPORT_DIRECTORY", "../Grammar/BinaryInstruction.code");
-     AsmPEImportDirectory.setDataPrototype("rose_addr_t","hintnames_rva","= 0",
+     AsmPEImportDirectory.setDataPrototype("rose_rva_t","hintnames_rva","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
-     AsmPEImportDirectory.setDataPrototype("rose_addr_t","bindings_rva","= 0",
+     AsmPEImportDirectory.setDataPrototype("rose_rva_t","bindings_rva","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
-     AsmPEImportDirectory.setDataPrototype("rose_addr_t","dll_name_rva","= 0",
+     AsmPEImportDirectory.setDataPrototype("rose_rva_t","dll_name_rva","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEImportDirectory.setDataPrototype("time_t","time","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      AsmPEImportDirectory.setDataPrototype("unsigned","forwarder_chain","= 0",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
 
+
+
+     AsmPEExportDirectory.setFunctionPrototype("HEADER_PE_EXPORT_DIRECTORY", "../Grammar/BinaryInstruction.code");
+     AsmPEExportDirectory.setDataPrototype("unsigned", "res1", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("time_t", "timestamp", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("unsigned", "vmajor", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("unsigned", "vminor", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("rose_rva_t", "name_rva", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("unsigned", "ord_base", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("size_t", "expaddr_n", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("size_t", "nameptr_n", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("rose_rva_t", "expaddr_rva", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("rose_rva_t", "nameptr_rva", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("rose_rva_t", "ordinals_rva", "= 0",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     AsmPEExportDirectory.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
+                           NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+
+
+
+
   // unsigned hint;
   // std::string name;
   // unsigned char padding;
@@ -1390,7 +1442,6 @@
      AsmGenericSectionList.setDataPrototype("SgAsmGenericSectionPtrList","sections","",
                            NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
 
-
   // This data structure represents the ExecSection from file: ExecGeneric.h
   // ExecFile            *file;                          /* The file to which this section belongs */
   // ExecHeader          *header;                        /* Optional header associated with section */
@@ -1624,19 +1675,14 @@
 
 
 
-  // std::string         name;                           /* Name of library as stored in executable (usually a base name) */
-  // std::vector<std::string> funcs;                     /* List of functions needed from the library */
      AsmGenericDLL.setFunctionPrototype ( "HEADER_GENERIC_DLL", "../Grammar/BinaryInstruction.code");
-
-  // AsmGenericDLL.setAutomaticGenerationOfConstructor(false);
-  // AsmGenericDLL.setAutomaticGenerationOfDestructor(false);
-
      AsmGenericDLL.setDataPrototype("SgAsmGenericString*","name","= 0",
                             NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, NO_COPY_DATA);
      AsmGenericDLL.setDataPrototype("SgStringList","funcs","",
                             NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, NO_COPY_DATA);
 
 
+
      AsmGenericStrtab.setFunctionPrototype("HEADER_GENERIC_STRTAB", "../Grammar/BinaryInstruction.code");
      AsmGenericStrtab.setAutomaticGenerationOfDestructor(false);
      AsmGenericStrtab.setDataPrototype("SgAsmGenericSection*", "container", "= NULL", 
@@ -1856,7 +1902,6 @@
      AsmCoffSymbolTable.setFunctionSource ( "SOURCE_PE_COFF_SYMBOL_TABLE", "../Grammar/BinaryInstruction.code");
      AsmPEImportHintName.setFunctionSource ( "SOURCE_PE_IMPORT_HINT_NAME", "../Grammar/BinaryInstruction.code");
      AsmPEImportDirectory.setFunctionSource ( "SOURCE_PE_IMPORT_DIRECTORY", "../Grammar/BinaryInstruction.code");
-     AsmPEImportSection.setFunctionSource ( "SOURCE_PE_IMPORT_SECTION", "../Grammar/BinaryInstruction.code");
      AsmPEExtendedDOSHeader.setFunctionSource ( "SOURCE_PE_EXTENDED_DOS_HEADER", "../Grammar/BinaryInstruction.code");
      AsmPESectionTableEntry.setFunctionSource ( "SOURCE_PE_SECTION_TABLE_ENTRY", "../Grammar/BinaryInstruction.code");
      AsmPEDLL.setFunctionSource ( "SOURCE_PE_DLL", "../Grammar/BinaryInstruction.code");

Modified: branches/rice/src/ROSETTA/src/grammar.C
===================================================================
--- branches/rice/src/ROSETTA/src/grammar.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/src/grammar.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -911,17 +911,17 @@
 
 
 StringUtility::FileWithLineNumbers
-Grammar::buildStringForReturnDataMemberReferenceToPointersSource ( Terminal & node )
+Grammar::buildStringForProcessDataMemberReferenceToPointersSource ( Terminal & node )
    {
   // DQ & JH (1/17/2006): Added support for testing data members pointers if they point to IR nodes
 
      //AS Look at this one to see how the code in buildStringToTestPointerForContainmentInMemoryPoolSource is called
      //to generate code for checking the memory pool.
-     string isClassNameFunctionTemplateFileName   = "../Grammar/grammarReturnDataMemberReferenceToPointers.macro";
+     string isClassNameFunctionTemplateFileName   = "../Grammar/grammarProcessDataMemberReferenceToPointers.macro";
      StringUtility::FileWithLineNumbers returnString = readFileWithPos (isClassNameFunctionTemplateFileName);
   // printf ("returnString = %s \n",returnString);
 
-     string dataMemberSpecificString = node.buildReturnDataMemberReferenceToPointers();
+     string dataMemberSpecificString = node.buildProcessDataMemberReferenceToPointers();
 
      returnString = GrammarString::copyEdit(returnString,"$CODE_STRING",dataMemberSpecificString.c_str());
 
@@ -938,9 +938,9 @@
    }
 
 void
-Grammar::buildStringForReturnDataMemberReferenceToPointersSupport( Terminal & node, StringUtility::FileWithLineNumbers & outputFile )
+Grammar::buildStringForProcessDataMemberReferenceToPointersSupport( Terminal & node, StringUtility::FileWithLineNumbers & outputFile )
    {
-     StringUtility::FileWithLineNumbers editString = buildStringForReturnDataMemberReferenceToPointersSource(node);
+     StringUtility::FileWithLineNumbers editString = buildStringForProcessDataMemberReferenceToPointersSource(node);
 
   // printf ("editString = %s \n",editString.c_str());
 
@@ -956,7 +956,7 @@
           ROSE_ASSERT ((*treeNodeIterator) != NULL);
           ROSE_ASSERT ((*treeNodeIterator)->getBaseClass() != NULL);
 
-          buildStringForReturnDataMemberReferenceToPointersSupport(**treeNodeIterator,outputFile);
+          buildStringForProcessDataMemberReferenceToPointersSupport(**treeNodeIterator,outputFile);
         }
 #endif
    }
@@ -2450,6 +2450,10 @@
 
 #endif
 
+
+
+
+
 #if 1
    //-----------------------------------------------
    // generate code for the new and delete operators
@@ -2577,18 +2581,18 @@
   // --------------------------------------------
   // generate code for returning data member pointers to IR nodes
   // --------------------------------------------
-     StringUtility::FileWithLineNumbers ROSE_ReturnDataMemberReferenceToPointersSourceFile;
+     StringUtility::FileWithLineNumbers ROSE_ProcessDataMemberReferenceToPointersSourceFile;
 
-     ROSE_ReturnDataMemberReferenceToPointersSourceFile.push_back(StringUtility::StringWithLineNumber(includeHeaderString, "", 1));
+     ROSE_ProcessDataMemberReferenceToPointersSourceFile.push_back(StringUtility::StringWithLineNumber(includeHeaderString, "", 1));
   // Now build the source code for the terminals and non-terminals in the grammar
      ROSE_ASSERT (rootNode != NULL);
 
-     buildStringForReturnDataMemberReferenceToPointersSupport(*rootNode,ROSE_ReturnDataMemberReferenceToPointersSourceFile);
-     cout << "DONE: buildStringForReturnDataMemberReferenceToPointersSupport()" << endl;
+     buildStringForProcessDataMemberReferenceToPointersSupport(*rootNode,ROSE_ProcessDataMemberReferenceToPointersSourceFile);
+     cout << "DONE: buildStringForProcessDataMemberReferenceToPointersSupport()" << endl;
 
   // printf ("Exiting after building code to return references data members which are pointers to IR nodes \n");
   // ROSE_ASSERT(false);
-     Grammar::writeFile(ROSE_ReturnDataMemberReferenceToPointersSourceFile, ".", getGrammarName() + "ReturnDataMemberReferenceToPointers", ".C");
+     Grammar::writeFile(ROSE_ProcessDataMemberReferenceToPointersSourceFile, ".", getGrammarName() + "ProcessDataMemberReferenceToPointers", ".C");
 #endif
 
 #if 1

Modified: branches/rice/src/ROSETTA/src/grammar.h
===================================================================
--- branches/rice/src/ROSETTA/src/grammar.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/src/grammar.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -339,7 +339,7 @@
        // AS (2/14/06): Added support for building code to return data member pointers to IR nodes
 	  StringUtility::FileWithLineNumbers buildStringForReturnDataMemberPointersSource ( Terminal & node );
 
-	  StringUtility::FileWithLineNumbers buildStringForReturnDataMemberReferenceToPointersSource ( Terminal & node );
+	  StringUtility::FileWithLineNumbers buildStringForProcessDataMemberReferenceToPointersSource ( Terminal & node );
 
        // DQ (3/7/2007): support for getChildIndex member function
 	  StringUtility::FileWithLineNumbers buildStringForGetChildIndexSource ( Terminal & node );
@@ -388,7 +388,8 @@
           void buildStringForReturnDataMemberPointersSupport ( Terminal & node, StringUtility::FileWithLineNumbers & outputFile );
 
        // DQ (4/30/2006): Support for buildStringForReturnDataMemberReferenceToPointersSource
-          void buildStringForReturnDataMemberReferenceToPointersSupport( Terminal & node, StringUtility::FileWithLineNumbers & outputFile );
+       // JJW (11/1/2008): Changed to process rather than return the references
+          void buildStringForProcessDataMemberReferenceToPointersSupport( Terminal & node, StringUtility::FileWithLineNumbers & outputFile );
 
        // DQ (12/23/2005): Relocated copy function to a separate file to imrove readability of source code
           void buildCopyMemberFunctions( Terminal & node, StringUtility::FileWithLineNumbers & outputFile );

Modified: branches/rice/src/ROSETTA/src/support.C
===================================================================
--- branches/rice/src/ROSETTA/src/support.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/src/support.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -92,9 +92,10 @@
   // to an analysis phase to define and not defined in the structure of the AST.
      NEW_TERMINAL_MACRO (SourceFile, "SourceFile", "SourceFileTag" );
      NEW_TERMINAL_MACRO (BinaryFile, "BinaryFile", "BinaryFileTag" );
+     NEW_TERMINAL_MACRO (UnknownFile, "UnknownFile", "UnknownFileTag" );
 
   // Mark this as being able to be an IR node for now and later make it false.
-     NEW_NONTERMINAL_MACRO (File, SourceFile | BinaryFile, "File", "FileTag", false);
+     NEW_NONTERMINAL_MACRO (File, SourceFile | BinaryFile | UnknownFile , "File", "FileTag", false);
 #endif
      NEW_TERMINAL_MACRO (FileList, "FileList", "FileListTag" );
      NEW_TERMINAL_MACRO (Directory, "Directory", "DirectoryTag" );
@@ -484,6 +485,10 @@
 
      BinaryFile.setFunctionPrototype          ( "HEADER_APPLICATION_BINARY_FILE", "../Grammar/Support.code");
 
+     UnknownFile.setFunctionPrototype          ( "HEADER_APPLICATION_UNKNOWN_FILE", "../Grammar/Support.code");
+
+     
+
      File.setFunctionPrototype                ( "HEADER_APPLICATION_FILE", "../Grammar/Support.code");
   // File.setAutomaticGenerationOfConstructor(false);
   // Later we can have this be autogenerated (let's see what we need first)
@@ -713,6 +718,10 @@
   // the *.mod files to be put.  This is the data member for the list.
      SourceFile.setDataPrototype   ( "SgModuleStatementPtrList", "module_list", "",
                                      NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+
+     UnknownFile.setDataPrototype   ( "SgGlobal*", "globalScope", "= NULL",
+                                     NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
+
 #endif
 
   // DQ (10/16/2005): Added to support C++ style argument handling in SgFile
@@ -782,14 +791,15 @@
                                      NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      File.setDataPrototype         ( "bool", "fortran_implicit_none", "= false",
                                      NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
-     File.setDataPrototype         ( "bool", "fortran_openmp", "= false",
+  //Liao, 10/28/2008: Support for OpenMP 3.0 model for C/C++ pragma, will use it for Fortran later on, changed fortran_openmp to openmp
+     File.setDataPrototype         ( "bool", "openmp", "= false",
                                      NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      File.setDataPrototype         ( "bool", "cray_pointer_support", "= false",
                                      NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
 
-  // DQ (12/11/2007): Addes support for parser to output the parser rules to be called. For Fortran 
+  // DQ (12/11/2007): Adds support for parser to output the parser rules to be called. For Fortran 
   // support in ROSE this corresponds to the "--dump" option in the Open Fortran Parser (OFP).
-  // There is no coresponding action with EDG for the C and C++ support in ROSE, so for C/C++
+  // There is no corresponding action with EDG for the C and C++ support in ROSE, so for C/C++
   // this option has no effect.
      File.setDataPrototype         ( "bool", "output_parser_actions", "= false",
                  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
@@ -996,7 +1006,9 @@
                  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
      File.setDataPrototype         ( "bool", "sourceFileUsesBinaryFileExtension", "= false",
                  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
-
+     File.setDataPrototype         ( "bool", "sourceFileTypeIsUnknown", "= false",
+                 NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     
   // DQ (10/13/2007): Add the binary file to the SgFile IR node so that we can hold both the source
   // code AST and the binary AST together.  This also permits the binary AST to be handled similarly
   // the the source code AST (for traversals, file I/O, etc.).
@@ -1744,6 +1756,7 @@
      SourceFile.setFunctionSource      ( "SOURCE_APPLICATION_SOURCE_FILE", "../Grammar/Support.code");
      BinaryFile.setFunctionSource      ( "SOURCE_APPLICATION_BINARY_FILE", "../Grammar/Support.code");
      FileList.setFunctionSource        ( "SOURCE_APPLICATION_FILE_LIST", "../Grammar/Support.code");
+     UnknownFile.setFunctionSource     ( "SOURCE_APPLICATION_UNKNOWN_FILE", "../Grammar/Support.code");
 
      Project.setFunctionSource         ( "SOURCE_APPLICATION_PROJECT", "../Grammar/Support.code");
      Options.setFunctionSource         ( "SOURCE_OPTIONS", "../Grammar/Support.code");

Modified: branches/rice/src/ROSETTA/src/terminal.C
===================================================================
--- branches/rice/src/ROSETTA/src/terminal.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/src/terminal.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1695,8 +1695,8 @@
 /*************************************************************************************************
 *  The function
 *       Terminal::buildListIteratorStringForReferenceToPointers()
-*  supports buildReturnDataMemberReferenceToPointers() by building the string representing the code 
-*  necessary to return references (pointers) all data member pointers to IR nodes contained in STL lists.
+*  supports buildProcessDataMemberReferenceToPointers() by building the string representing the code 
+*  necessary to process references (pointers) all data member pointers to IR nodes contained in STL lists.
 *************************************************************************************************/
 string Terminal::buildListIteratorStringForReferenceToPointers(string typeName, string variableName, string classNameString)
    {
@@ -1798,20 +1798,17 @@
        // Open up the loop over the list elements
           if (accessOperator=="->")
              {
-               returnString += "     if (" + originalList + "== NULL)\n";
-            // Return a NULL pointer so that the graph shows that this pointer equals NULL
-               returnString += "        returnVector.push_back(pair<SgNode**,std::string>( NULL,\""+variableName+"\"));\n";
-
+               returnString += "     if (" + originalList + "== NULL) {}\n";
                returnString += "     else\n";
              }
 
-          returnString += "     for ( " +iteratorBaseType + "::const_iterator " + iteratorName + " = " + originalList + accessOperator + "begin() \n"
+          returnString += "     for ( " +iteratorBaseType + "::iterator " + iteratorName + " = " + originalList + accessOperator + "begin() \n"
                        + "; " + iteratorName
                        + " != " + originalList + accessOperator + "end(); ++" 
                        + iteratorName + ") \n        { \n";
 
        // Declare the a loop variable (reference to current element of list)
-          returnString += "          returnVector.push_back(pair<SgNode**,std::string>( (SgNode**)(&(*" + iteratorName + ")),\""+variableName+"\"));\n";
+          returnString += "          handler->apply(*" + iteratorName + ",SgName(\""+variableName+"\"));\n";
                 
        // close off the loop
           returnString += "        } \n";
@@ -1823,11 +1820,11 @@
 //DQ (4/30/2006): This function is similar to buildReturnDataMemberPointers but returns reference to the pointers.
 /*************************************************************************************************
 *  The function
-*       Terminal::buildReturnDataMemberReferenceToPointers()
-*  builds the code for returning references to all data member pointers to IR nodes in the AST.
+*       Terminal::buildProcessDataMemberReferenceToPointers()
+*  builds the code for processing references to all data member pointers to IR nodes in the AST.
 *************************************************************************************************/
 string
-Terminal::buildReturnDataMemberReferenceToPointers ()
+Terminal::buildProcessDataMemberReferenceToPointers ()
    {
   // DQ (4/30/2006): This is a modified version of the code for buildReturnDataMemberPointers()
 
@@ -1840,7 +1837,7 @@
      vector<GrammarString *>::iterator stringListIterator;
 
      string classNameString = this-> name;
-     string s("std::vector<std::pair<SgNode**,std::string> > returnVector;\n") ;
+     string s ;
   // s += "   std::cout << \"------------ checking pointers of " + classNameString + "  -------------------\" << std::endl;\n" ;
   // s += "   ROSE_ASSERT ( pointer->p_freepointer == AST_FileIO::IS_VALID_POINTER() );\n";
   // AS Iterate over the terminal and its parents (base-classes).
@@ -1878,7 +1875,7 @@
                        {
                       // AS Checks to see if the pointer is a data member. Because the mechanism for generating access to variables
                       // is the same as the one accessing access member functions. We do not want the last case to show up here.
-                         s += "          returnVector.push_back(pair<SgNode**,std::string>( (SgNode**)(&(p_" + varNameString + ")),\""+varNameString+"\"));\n";
+                         s += "          handler->apply(p_" + varNameString + ",SgName(\""+varNameString+"\"));\n";
                        }
                       else
                        {
@@ -1889,15 +1886,13 @@
                               accessOperator = "->";
                               s += "     if (p_" + varNameString + " == NULL)\n";
                               s += "        {\n";
-                           // Return a NULL pointer so that th graph shows that this pointer equals NULL
-                              s += "          returnVector.push_back(pair<SgNode**,std::string>( NULL,\"" + varNameString + "\"));\n";
                               s += "        }\n";
                               s += "     else\n";
                               s += "        {\n";
-                              s += "          for ( rose_hash_multimap::const_iterator it_"+varNameString+ "= p_" + varNameString + accessOperator + "begin(); it_" + varNameString + "!= p_" + varNameString + accessOperator + "end(); ++" + "it_" + varNameString + ")\n";
+                              s += "          for ( rose_hash_multimap::iterator it_"+varNameString+ "= p_" + varNameString + accessOperator + "begin(); it_" + varNameString + "!= p_" + varNameString + accessOperator + "end(); ++" + "it_" + varNameString + ")\n";
                               s += "             {\n";
                            // Declare the a loop variable (reference to current element of list)
-                              s += "               returnVector.push_back(pair<SgNode**,std::string>( (SgNode**)(&(it_" + varNameString + "->second)), std::string(it_" + varNameString + "->first.str()) ) );\n";
+                              s += "               handler->apply(it_" + varNameString + "->second, it_" + varNameString + "->first);\n";
                            // close off the loop
                               s += "             }\n";
                               s += "        }\n";
@@ -1907,8 +1902,6 @@
              }
         }
 
-     s += "     return returnVector;\n";
-
      return s;
    }
 

Modified: branches/rice/src/ROSETTA/src/terminal.h
===================================================================
--- branches/rice/src/ROSETTA/src/terminal.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/ROSETTA/src/terminal.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -298,7 +298,7 @@
 
 // DQ (4/30/2006): Added similar function to buildReturnDataMemberPointers() so that we could 
 // return references to the pointers to IR nodes (required low level support for AST Merge).
-  std::string buildReturnDataMemberReferenceToPointers ();
+  std::string buildProcessDataMemberReferenceToPointers ();
   std::string buildListIteratorStringForReferenceToPointers(std::string typeName, std::string variableName, std::string classNameString);
 
 // DQ (3/7/2007): Building support for "long getChildIndex();" to be use for "bool isChild();" and other purposes.

Modified: branches/rice/src/backend/unparser/unparser.C
===================================================================
--- branches/rice/src/backend/unparser/unparser.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/backend/unparser/unparser.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -414,12 +414,7 @@
 
                  // printf ("header name = %s \n",genericHeader->get_name()->c_str());
 
-                    SgAsmPEFileHeader* asmPEFileHeader = isSgAsmPEFileHeader(genericHeader);
-                    rose_addr_t imageBase = 0ull;
-                    if (asmPEFileHeader != NULL)
-                       {
-                         imageBase = asmPEFileHeader->get_e_image_base();
-                       }
+                    rose_addr_t imageBase = genericHeader->get_base_va();
  
                  // printf ("section %s imageBase = 0x%08"PRIx64"\n",sections[i]->get_name()->c_str(),imageBase);
 
@@ -444,12 +439,7 @@
                          if ( (j != i) && (sections[j]->is_mapped() == true) )
                             {
                               SgAsmGenericHeader* genericHeader  = sections[j]->get_header();
-                              SgAsmPEFileHeader* asmPEFileHeader = isSgAsmPEFileHeader(genericHeader);
-                              rose_addr_t temp_imageBase = 0ull;
-                              if (asmPEFileHeader != NULL)
-                                 {
-                                   temp_imageBase = asmPEFileHeader->get_e_image_base();
-                                 }
+                              rose_addr_t temp_imageBase = genericHeader->get_base_va();
                               rose_addr_t nestedAddressBase  = temp_imageBase    + sections[j]->get_mapped_rva();
                               rose_addr_t nestedAddressBound = nestedAddressBase + sections[j]->get_mapped_size();
                            // printf ("Exclude range in section %s starting address = 0x%08"PRIx64" ending address = 0x%08"PRIx64"\n",sections[j]->get_name().c_str(),nestedAddressBase,nestedAddressBound);

Modified: branches/rice/src/frontend/BinaryDisassembly/RoseBin.cpp
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/RoseBin.cpp	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/RoseBin.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -17,7 +17,8 @@
 
 //#ifndef __RoseBin__
 //#define __RoseBin__
-#include <mysql/mysql.h>
+//#include <mysql/mysql.h>
+#include <mysql_include/mysql.h>
 
 #include <stdio.h>
 #include <iostream>

Modified: branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB.cpp
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB.cpp	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -6,7 +6,8 @@
  ****************************************************/
 #include "rose.h"
 #include "RoseBin_DB.h"
-#include <mysql/mysql.h>
+//#include <mysql/mysql.h>
+#include "mysql_include/mysql.h"
 
 using namespace std;
 

Modified: branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB.h
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -8,7 +8,8 @@
 #ifndef __RoseBin_DB__
 #define __RoseBin_DB__
 
-#include <mysql/mysql.h>
+//#include <mysql/mysql.h>
+#include <mysql_include/mysql.h>
 
 #include <stdio.h>
 #include <iostream>

Modified: branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.cpp
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.cpp	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -7,7 +7,8 @@
 #include "rose.h"
 #include "RoseBin_DB_IDAPRO.h"
 #include <errno.h>
-#include <mysql/mysql.h>
+//#include <mysql/mysql.h>
+#include "mysql_include/mysql.h"
 
 using namespace std;
 

Modified: branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.h
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -8,7 +8,7 @@
 #ifndef __RoseBin_DB_IDAPRO__
 #define __RoseBin_DB_IDAPRO__
 
-#include <mysql/mysql.h>
+#include "mysql_include/mysql.h"
 #include <stdio.h>
 #include <iostream>
 // #include "rose.h"

Modified: branches/rice/src/frontend/BinaryDisassembly/RoseBin_support.h
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/RoseBin_support.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/RoseBin_support.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -323,6 +323,9 @@
 SgAsmx86Instruction* createx86Instruction(uint64_t address,
                                           const std::string& mnemonic);
 
+void normalizex86Mnemonic(std::string& mnemonic);
+void normalizeArmMnemonic(std::string& mnemonic);
+
 // From RoseBin_support.cpp:
 bool isAsmUnconditionalBranch(SgAsmInstruction*);
 bool isAsmBranch(SgAsmInstruction*);

Modified: branches/rice/src/frontend/BinaryDisassembly/instructionDispatch.cpp
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/instructionDispatch.cpp	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/instructionDispatch.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -2581,6 +2581,2582 @@
   }
   return insn;
 }
+void normalizex86Mnemonic(std::string& mnemonic) {
+  switch (mnemonic.size()) {
+    case 2:
+      switch (mnemonic[0]) {
+        case 'b': { // 'b'
+          if (mnemonic[1] == 't') { // 'bt'
+            mnemonic = "Bt";
+          }
+        break;}
+        case 'i': { // 'i'
+          if (mnemonic[1] == 'n') { // 'in'
+            mnemonic = "In";
+          }
+        break;}
+        case 'j': { // 'j'
+          switch (mnemonic[1]) {
+            case 'a': { // 'ja'
+              mnemonic = "Ja";
+            break;}
+            case 'b': { // 'jb'
+              mnemonic = "Jb";
+            break;}
+            case 'c': { // 'jc'
+              mnemonic = "Jb";
+            break;}
+            case 'e': { // 'je'
+              mnemonic = "Je";
+            break;}
+            case 'g': { // 'jg'
+              mnemonic = "Jg";
+            break;}
+            case 'l': { // 'jl'
+              mnemonic = "Jl";
+            break;}
+            case 'o': { // 'jo'
+              mnemonic = "Jo";
+            break;}
+            case 'p': { // 'jp'
+              mnemonic = "Jpe";
+            break;}
+            case 's': { // 'js'
+              mnemonic = "Js";
+            break;}
+            case 'z': { // 'jz'
+              mnemonic = "Je";
+            break;}
+            default: break;
+          }
+        break;}
+        case 'o': { // 'o'
+          if (mnemonic[1] == 'r') { // 'or'
+            mnemonic = "Or";
+          }
+        break;}
+        default: break;
+      }
+    break;
+    case 3:
+      switch (mnemonic[0]) {
+        case 'a': { // 'a'
+          switch (mnemonic[1]) {
+            case 'a': { // 'aa'
+              switch (mnemonic[2]) {
+                case 'a': { // 'aaa'
+                  mnemonic = "Aaa";
+                break;}
+                case 'd': { // 'aad'
+                  mnemonic = "Aad";
+                break;}
+                case 'm': { // 'aam'
+                  mnemonic = "Aam";
+                break;}
+                case 's': { // 'aas'
+                  mnemonic = "Aas";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'd': { // 'ad'
+              switch (mnemonic[2]) {
+                case 'c': { // 'adc'
+                  mnemonic = "Adc";
+                break;}
+                case 'd': { // 'add'
+                  mnemonic = "Add";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'n': { // 'an'
+              if (mnemonic[2] == 'd') { // 'and'
+                mnemonic = "And";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'b': { // 'b'
+          switch (mnemonic[1]) {
+            case 's': { // 'bs'
+              switch (mnemonic[2]) {
+                case 'f': { // 'bsf'
+                  mnemonic = "Bsf";
+                break;}
+                case 'r': { // 'bsr'
+                  mnemonic = "Bsr";
+                break;}
+                default: break;
+              }
+            break;}
+            case 't': { // 'bt'
+              switch (mnemonic[2]) {
+                case 'c': { // 'btc'
+                  mnemonic = "Btc";
+                break;}
+                case 'l': { // 'btl'
+                  mnemonic = "Bt";
+                break;}
+                case 'r': { // 'btr'
+                  mnemonic = "Btr";
+                break;}
+                case 's': { // 'bts'
+                  mnemonic = "Bts";
+                break;}
+                default: break;
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'c': { // 'c'
+          switch (mnemonic[1]) {
+            case 'b': { // 'cb'
+              if (mnemonic[2] == 'w') { // 'cbw'
+                mnemonic = "Cbw";
+              }
+            break;}
+            case 'd': { // 'cd'
+              if (mnemonic[2] == 'q') { // 'cdq'
+                mnemonic = "Cdq";
+              }
+            break;}
+            case 'l': { // 'cl'
+              switch (mnemonic[2]) {
+                case 'c': { // 'clc'
+                  mnemonic = "Clc";
+                break;}
+                case 'd': { // 'cld'
+                  mnemonic = "Cld";
+                break;}
+                case 'i': { // 'cli'
+                  mnemonic = "Cli";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'm': { // 'cm'
+              switch (mnemonic[2]) {
+                case 'c': { // 'cmc'
+                  mnemonic = "Cmc";
+                break;}
+                case 'p': { // 'cmp'
+                  mnemonic = "Cmp";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'q': { // 'cq'
+              if (mnemonic[2] == 'o') { // 'cqo'
+                mnemonic = "Cqo";
+              }
+            break;}
+            case 'w': { // 'cw'
+              if (mnemonic[2] == 'd') { // 'cwd'
+                mnemonic = "Cwd";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'd': { // 'd'
+          switch (mnemonic[1]) {
+            case 'a': { // 'da'
+              switch (mnemonic[2]) {
+                case 'a': { // 'daa'
+                  mnemonic = "Daa";
+                break;}
+                case 's': { // 'das'
+                  mnemonic = "Das";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'e': { // 'de'
+              if (mnemonic[2] == 'c') { // 'dec'
+                mnemonic = "Dec";
+              }
+            break;}
+            case 'i': { // 'di'
+              if (mnemonic[2] == 'v') { // 'div'
+                mnemonic = "Div";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'e': { // 'e'
+          if (mnemonic[1] == 's') { // 'es'
+            if (mnemonic[2] == 'c') { // 'esc'
+              mnemonic = "Esc";
+            }
+          }
+        break;}
+        case 'f': { // 'f'
+          switch (mnemonic[1]) {
+            case 'l': { // 'fl'
+              if (mnemonic[2] == 'd') { // 'fld'
+                mnemonic = "Fld";
+              }
+            break;}
+            case 's': { // 'fs'
+              if (mnemonic[2] == 't') { // 'fst'
+                mnemonic = "Fst";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'h': { // 'h'
+          if (mnemonic[1] == 'l') { // 'hl'
+            if (mnemonic[2] == 't') { // 'hlt'
+              mnemonic = "Hlt";
+            }
+          }
+        break;}
+        case 'i': { // 'i'
+          if (mnemonic[1] == 'n') { // 'in'
+            switch (mnemonic[2]) {
+              case 'b': { // 'inb'
+                mnemonic = "In";
+              break;}
+              case 'c': { // 'inc'
+                mnemonic = "Inc";
+              break;}
+              case 'd': { // 'ind'
+                mnemonic = "In";
+              break;}
+              case 'l': { // 'inl'
+                mnemonic = "In";
+              break;}
+              case 't': { // 'int'
+                mnemonic = "Int";
+              break;}
+              case 'w': { // 'inw'
+                mnemonic = "In";
+              break;}
+              default: break;
+            }
+          }
+        break;}
+        case 'j': { // 'j'
+          switch (mnemonic[1]) {
+            case 'a': { // 'ja'
+              if (mnemonic[2] == 'e') { // 'jae'
+                mnemonic = "Jae";
+              }
+            break;}
+            case 'b': { // 'jb'
+              if (mnemonic[2] == 'e') { // 'jbe'
+                mnemonic = "Jbe";
+              }
+            break;}
+            case 'g': { // 'jg'
+              if (mnemonic[2] == 'e') { // 'jge'
+                mnemonic = "Jge";
+              }
+            break;}
+            case 'l': { // 'jl'
+              if (mnemonic[2] == 'e') { // 'jle'
+                mnemonic = "Jle";
+              }
+            break;}
+            case 'm': { // 'jm'
+              if (mnemonic[2] == 'p') { // 'jmp'
+                mnemonic = "Jmp";
+              }
+            break;}
+            case 'n': { // 'jn'
+              switch (mnemonic[2]) {
+                case 'a': { // 'jna'
+                  mnemonic = "Jbe";
+                break;}
+                case 'b': { // 'jnb'
+                  mnemonic = "Jae";
+                break;}
+                case 'c': { // 'jnc'
+                  mnemonic = "Jae";
+                break;}
+                case 'e': { // 'jne'
+                  mnemonic = "Jne";
+                break;}
+                case 'g': { // 'jng'
+                  mnemonic = "Jle";
+                break;}
+                case 'l': { // 'jnl'
+                  mnemonic = "Jge";
+                break;}
+                case 'o': { // 'jno'
+                  mnemonic = "Jno";
+                break;}
+                case 'p': { // 'jnp'
+                  mnemonic = "Jpo";
+                break;}
+                case 's': { // 'jns'
+                  mnemonic = "Jns";
+                break;}
+                case 'z': { // 'jnz'
+                  mnemonic = "Jne";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'p': { // 'jp'
+              switch (mnemonic[2]) {
+                case 'e': { // 'jpe'
+                  mnemonic = "Jpe";
+                break;}
+                case 'o': { // 'jpo'
+                  mnemonic = "Jpo";
+                break;}
+                default: break;
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'l': { // 'l'
+          switch (mnemonic[1]) {
+            case 'd': { // 'ld'
+              if (mnemonic[2] == 's') { // 'lds'
+                mnemonic = "Lds";
+              }
+            break;}
+            case 'e': { // 'le'
+              switch (mnemonic[2]) {
+                case 'a': { // 'lea'
+                  mnemonic = "Lea";
+                break;}
+                case 's': { // 'les'
+                  mnemonic = "Les";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'f': { // 'lf'
+              if (mnemonic[2] == 's') { // 'lfs'
+                mnemonic = "Lfs";
+              }
+            break;}
+            case 'g': { // 'lg'
+              if (mnemonic[2] == 's') { // 'lgs'
+                mnemonic = "Lgs";
+              }
+            break;}
+            case 's': { // 'ls'
+              if (mnemonic[2] == 's') { // 'lss'
+                mnemonic = "Lss";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'm': { // 'm'
+          switch (mnemonic[1]) {
+            case 'o': { // 'mo'
+              if (mnemonic[2] == 'v') { // 'mov'
+                mnemonic = "Mov";
+              }
+            break;}
+            case 'u': { // 'mu'
+              if (mnemonic[2] == 'l') { // 'mul'
+                mnemonic = "Mul";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'n': { // 'n'
+          switch (mnemonic[1]) {
+            case 'e': { // 'ne'
+              if (mnemonic[2] == 'g') { // 'neg'
+                mnemonic = "Neg";
+              }
+            break;}
+            case 'o': { // 'no'
+              switch (mnemonic[2]) {
+                case 'p': { // 'nop'
+                  mnemonic = "Nop";
+                break;}
+                case 't': { // 'not'
+                  mnemonic = "Not";
+                break;}
+                default: break;
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'o': { // 'o'
+          if (mnemonic[1] == 'u') { // 'ou'
+            if (mnemonic[2] == 't') { // 'out'
+              mnemonic = "Out";
+            }
+          }
+        break;}
+        case 'p': { // 'p'
+          if (mnemonic[1] == 'o') { // 'po'
+            if (mnemonic[2] == 'p') { // 'pop'
+              mnemonic = "Pop";
+            }
+          }
+        break;}
+        case 'r': { // 'r'
+          switch (mnemonic[1]) {
+            case 'c': { // 'rc'
+              switch (mnemonic[2]) {
+                case 'l': { // 'rcl'
+                  mnemonic = "Rcl";
+                break;}
+                case 'r': { // 'rcr'
+                  mnemonic = "Rcr";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'e': { // 're'
+              if (mnemonic[2] == 't') { // 'ret'
+                mnemonic = "Ret";
+              }
+            break;}
+            case 'o': { // 'ro'
+              switch (mnemonic[2]) {
+                case 'l': { // 'rol'
+                  mnemonic = "Rol";
+                break;}
+                case 'r': { // 'ror'
+                  mnemonic = "Ror";
+                break;}
+                default: break;
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 's': { // 's'
+          switch (mnemonic[1]) {
+            case 'a': { // 'sa'
+              switch (mnemonic[2]) {
+                case 'l': { // 'sal'
+                  mnemonic = "Shl";
+                break;}
+                case 'r': { // 'sar'
+                  mnemonic = "Sar";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'b': { // 'sb'
+              if (mnemonic[2] == 'b') { // 'sbb'
+                mnemonic = "Sbb";
+              }
+            break;}
+            case 'h': { // 'sh'
+              switch (mnemonic[2]) {
+                case 'l': { // 'shl'
+                  mnemonic = "Shl";
+                break;}
+                case 'r': { // 'shr'
+                  mnemonic = "Shr";
+                break;}
+                default: break;
+              }
+            break;}
+            case 't': { // 'st'
+              switch (mnemonic[2]) {
+                case 'c': { // 'stc'
+                  mnemonic = "Stc";
+                break;}
+                case 'd': { // 'std'
+                  mnemonic = "Std";
+                break;}
+                case 'i': { // 'sti'
+                  mnemonic = "Sti";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'u': { // 'su'
+              if (mnemonic[2] == 'b') { // 'sub'
+                mnemonic = "Sub";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'u': { // 'u'
+          if (mnemonic[1] == 'd') { // 'ud'
+            if (mnemonic[2] == '2') { // 'ud2'
+              mnemonic = "Ud2";
+            }
+          }
+        break;}
+        case 'x': { // 'x'
+          if (mnemonic[1] == 'o') { // 'xo'
+            if (mnemonic[2] == 'r') { // 'xor'
+              mnemonic = "Xor";
+            }
+          }
+        break;}
+        default: break;
+      }
+    break;
+    case 4:
+      switch (mnemonic[0]) {
+        case 'a': { // 'a'
+          if (mnemonic[1] == 'r') { // 'ar'
+            if (mnemonic[2] == 'p') { // 'arp'
+              if (mnemonic[3] == 'l') { // 'arpl'
+                mnemonic = "Arpl";
+              }
+            }
+          }
+        break;}
+        case 'b': { // 'b'
+          if (mnemonic[1] == 't') { // 'bt'
+            switch (mnemonic[2]) {
+              case 'c': { // 'btc'
+                if (mnemonic[3] == 'l') { // 'btcl'
+                  mnemonic = "Btc";
+                }
+              break;}
+              case 'r': { // 'btr'
+                if (mnemonic[3] == 'l') { // 'btrl'
+                  mnemonic = "Btr";
+                }
+              break;}
+              case 's': { // 'bts'
+                if (mnemonic[3] == 'l') { // 'btsl'
+                  mnemonic = "Bts";
+                }
+              break;}
+              default: break;
+            }
+          }
+        break;}
+        case 'c': { // 'c'
+          switch (mnemonic[1]) {
+            case 'a': { // 'ca'
+              if (mnemonic[2] == 'l') { // 'cal'
+                if (mnemonic[3] == 'l') { // 'call'
+                  mnemonic = "Call";
+                }
+              }
+            break;}
+            case 'd': { // 'cd'
+              if (mnemonic[2] == 'q') { // 'cdq'
+                if (mnemonic[3] == 'e') { // 'cdqe'
+                  mnemonic = "Cdqe";
+                }
+              }
+            break;}
+            case 'w': { // 'cw'
+              if (mnemonic[2] == 'd') { // 'cwd'
+                if (mnemonic[3] == 'e') { // 'cwde'
+                  mnemonic = "Cwde";
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'e': { // 'e'
+          if (mnemonic[1] == 'm') { // 'em'
+            if (mnemonic[2] == 'm') { // 'emm'
+              if (mnemonic[3] == 's') { // 'emms'
+                mnemonic = "Emms";
+              }
+            }
+          }
+        break;}
+        case 'f': { // 'f'
+          switch (mnemonic[1]) {
+            case 'a': { // 'fa'
+              switch (mnemonic[2]) {
+                case 'b': { // 'fab'
+                  if (mnemonic[3] == 's') { // 'fabs'
+                    mnemonic = "Fabs";
+                  }
+                break;}
+                case 'd': { // 'fad'
+                  if (mnemonic[3] == 'd') { // 'fadd'
+                    mnemonic = "Fadd";
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'c': { // 'fc'
+              switch (mnemonic[2]) {
+                case 'h': { // 'fch'
+                  if (mnemonic[3] == 's') { // 'fchs'
+                    mnemonic = "Fchs";
+                  }
+                break;}
+                case 'o': { // 'fco'
+                  switch (mnemonic[3]) {
+                    case 'm': { // 'fcom'
+                      mnemonic = "Fcom";
+                    break;}
+                    case 's': { // 'fcos'
+                      mnemonic = "Fcos";
+                    break;}
+                    default: break;
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'd': { // 'fd'
+              if (mnemonic[2] == 'i') { // 'fdi'
+                if (mnemonic[3] == 'v') { // 'fdiv'
+                  mnemonic = "Fdiv";
+                }
+              }
+            break;}
+            case 'i': { // 'fi'
+              switch (mnemonic[2]) {
+                case 'l': { // 'fil'
+                  if (mnemonic[3] == 'd') { // 'fild'
+                    mnemonic = "Fild";
+                  }
+                break;}
+                case 's': { // 'fis'
+                  if (mnemonic[3] == 't') { // 'fist'
+                    mnemonic = "Fist";
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'l': { // 'fl'
+              if (mnemonic[2] == 'd') { // 'fld'
+                switch (mnemonic[3]) {
+                  case '1': { // 'fld1'
+                    mnemonic = "Fld1";
+                  break;}
+                  case 'l': { // 'fldl'
+                    mnemonic = "Fld";
+                  break;}
+                  case 's': { // 'flds'
+                    mnemonic = "Fld";
+                  break;}
+                  case 't': { // 'fldt'
+                    mnemonic = "Fld";
+                  break;}
+                  case 'z': { // 'fldz'
+                    mnemonic = "Fldz";
+                  break;}
+                  default: break;
+                }
+              }
+            break;}
+            case 'm': { // 'fm'
+              if (mnemonic[2] == 'u') { // 'fmu'
+                if (mnemonic[3] == 'l') { // 'fmul'
+                  mnemonic = "Fmul";
+                }
+              }
+            break;}
+            case 'n': { // 'fn'
+              if (mnemonic[2] == 'o') { // 'fno'
+                if (mnemonic[3] == 'p') { // 'fnop'
+                  mnemonic = "Fnop";
+                }
+              }
+            break;}
+            case 's': { // 'fs'
+              switch (mnemonic[2]) {
+                case 'i': { // 'fsi'
+                  if (mnemonic[3] == 'n') { // 'fsin'
+                    mnemonic = "Fsin";
+                  }
+                break;}
+                case 't': { // 'fst'
+                  switch (mnemonic[3]) {
+                    case 'l': { // 'fstl'
+                      mnemonic = "Fst";
+                    break;}
+                    case 'p': { // 'fstp'
+                      mnemonic = "Fstp";
+                    break;}
+                    case 's': { // 'fsts'
+                      mnemonic = "Fst";
+                    break;}
+                    default: break;
+                  }
+                break;}
+                case 'u': { // 'fsu'
+                  if (mnemonic[3] == 'b') { // 'fsub'
+                    mnemonic = "Fsub";
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 't': { // 'ft'
+              if (mnemonic[2] == 's') { // 'fts'
+                if (mnemonic[3] == 't') { // 'ftst'
+                  mnemonic = "Ftst";
+                }
+              }
+            break;}
+            case 'x': { // 'fx'
+              if (mnemonic[2] == 'c') { // 'fxc'
+                if (mnemonic[3] == 'h') { // 'fxch'
+                  mnemonic = "Fxch";
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'i': { // 'i'
+          switch (mnemonic[1]) {
+            case 'd': { // 'id'
+              if (mnemonic[2] == 'i') { // 'idi'
+                if (mnemonic[3] == 'v') { // 'idiv'
+                  mnemonic = "IDiv";
+                }
+              }
+            break;}
+            case 'm': { // 'im'
+              if (mnemonic[2] == 'u') { // 'imu'
+                if (mnemonic[3] == 'l') { // 'imul'
+                  mnemonic = "IMul";
+                }
+              }
+            break;}
+            case 'n': { // 'in'
+              switch (mnemonic[2]) {
+                case 's': { // 'ins'
+                  switch (mnemonic[3]) {
+                    case 'b': { // 'insb'
+                      mnemonic = "Insb";
+                    break;}
+                    case 'd': { // 'insd'
+                      mnemonic = "Insd";
+                    break;}
+                    case 'w': { // 'insw'
+                      mnemonic = "Insw";
+                    break;}
+                    default: break;
+                  }
+                break;}
+                case 't': { // 'int'
+                  if (mnemonic[3] == 'o') { // 'into'
+                    mnemonic = "Into";
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'r': { // 'ir'
+              if (mnemonic[2] == 'e') { // 'ire'
+                if (mnemonic[3] == 't') { // 'iret'
+                  mnemonic = "IRet";
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'j': { // 'j'
+          switch (mnemonic[1]) {
+            case 'c': { // 'jc'
+              if (mnemonic[2] == 'x') { // 'jcx'
+                if (mnemonic[3] == 'z') { // 'jcxz'
+                  mnemonic = "Jcxz";
+                }
+              }
+            break;}
+            case 'n': { // 'jn'
+              switch (mnemonic[2]) {
+                case 'a': { // 'jna'
+                  if (mnemonic[3] == 'e') { // 'jnae'
+                    mnemonic = "Jb";
+                  }
+                break;}
+                case 'b': { // 'jnb'
+                  if (mnemonic[3] == 'e') { // 'jnbe'
+                    mnemonic = "Ja";
+                  }
+                break;}
+                case 'g': { // 'jng'
+                  if (mnemonic[3] == 'e') { // 'jnge'
+                    mnemonic = "Jl";
+                  }
+                break;}
+                case 'l': { // 'jnl'
+                  if (mnemonic[3] == 'e') { // 'jnle'
+                    mnemonic = "Jg";
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'l': { // 'l'
+          switch (mnemonic[1]) {
+            case 'a': { // 'la'
+              if (mnemonic[2] == 'h') { // 'lah'
+                if (mnemonic[3] == 'f') { // 'lahf'
+                  mnemonic = "Lahf";
+                }
+              }
+            break;}
+            case 'o': { // 'lo'
+              switch (mnemonic[2]) {
+                case 'c': { // 'loc'
+                  if (mnemonic[3] == 'k') { // 'lock'
+                    mnemonic = "Lock";
+                  }
+                break;}
+                case 'o': { // 'loo'
+                  if (mnemonic[3] == 'p') { // 'loop'
+                    mnemonic = "Loop";
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'p': { // 'p'
+          switch (mnemonic[1]) {
+            case 'a': { // 'pa'
+              if (mnemonic[2] == 'n') { // 'pan'
+                if (mnemonic[3] == 'd') { // 'pand'
+                  mnemonic = "Pand";
+                }
+              }
+            break;}
+            case 'o': { // 'po'
+              if (mnemonic[2] == 'p') { // 'pop'
+                switch (mnemonic[3]) {
+                  case 'a': { // 'popa'
+                    mnemonic = "Popa";
+                  break;}
+                  case 'f': { // 'popf'
+                    mnemonic = "Popf";
+                  break;}
+                  default: break;
+                }
+              }
+            break;}
+            case 'u': { // 'pu'
+              if (mnemonic[2] == 's') { // 'pus'
+                if (mnemonic[3] == 'h') { // 'push'
+                  mnemonic = "Push";
+                }
+              }
+            break;}
+            case 'x': { // 'px'
+              if (mnemonic[2] == 'o') { // 'pxo'
+                if (mnemonic[3] == 'r') { // 'pxor'
+                  mnemonic = "Pxor";
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 's': { // 's'
+          switch (mnemonic[1]) {
+            case 'a': { // 'sa'
+              if (mnemonic[2] == 'h') { // 'sah'
+                if (mnemonic[3] == 'f') { // 'sahf'
+                  mnemonic = "Sahf";
+                }
+              }
+            break;}
+            case 'e': { // 'se'
+              if (mnemonic[2] == 't') { // 'set'
+                switch (mnemonic[3]) {
+                  case 'a': { // 'seta'
+                    mnemonic = "Seta";
+                  break;}
+                  case 'b': { // 'setb'
+                    mnemonic = "Setb";
+                  break;}
+                  case 'c': { // 'setc'
+                    mnemonic = "Setb";
+                  break;}
+                  case 'e': { // 'sete'
+                    mnemonic = "Sete";
+                  break;}
+                  case 'g': { // 'setg'
+                    mnemonic = "Setg";
+                  break;}
+                  case 'l': { // 'setl'
+                    mnemonic = "Setl";
+                  break;}
+                  case 'o': { // 'seto'
+                    mnemonic = "Seto";
+                  break;}
+                  case 'p': { // 'setp'
+                    mnemonic = "Setpe";
+                  break;}
+                  case 's': { // 'sets'
+                    mnemonic = "Sets";
+                  break;}
+                  case 'z': { // 'setz'
+                    mnemonic = "Sete";
+                  break;}
+                  default: break;
+                }
+              }
+            break;}
+            case 'h': { // 'sh'
+              switch (mnemonic[2]) {
+                case 'l': { // 'shl'
+                  if (mnemonic[3] == 'd') { // 'shld'
+                    mnemonic = "Shld";
+                  }
+                break;}
+                case 'r': { // 'shr'
+                  if (mnemonic[3] == 'd') { // 'shrd'
+                    mnemonic = "Shrd";
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'l': { // 'sl'
+              if (mnemonic[2] == 'd') { // 'sld'
+                if (mnemonic[3] == 't') { // 'sldt'
+                  mnemonic = "Sldt";
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 't': { // 't'
+          if (mnemonic[1] == 'e') { // 'te'
+            if (mnemonic[2] == 's') { // 'tes'
+              if (mnemonic[3] == 't') { // 'test'
+                mnemonic = "Test";
+              }
+            }
+          }
+        break;}
+        case 'v': { // 'v'
+          if (mnemonic[1] == 'e') { // 've'
+            if (mnemonic[2] == 'r') { // 'ver'
+              switch (mnemonic[3]) {
+                case 'r': { // 'verr'
+                  mnemonic = "Verr";
+                break;}
+                case 'w': { // 'verw'
+                  mnemonic = "Verw";
+                break;}
+                default: break;
+              }
+            }
+          }
+        break;}
+        case 'w': { // 'w'
+          if (mnemonic[1] == 'a') { // 'wa'
+            if (mnemonic[2] == 'i') { // 'wai'
+              if (mnemonic[3] == 't') { // 'wait'
+                mnemonic = "Wait";
+              }
+            }
+          }
+        break;}
+        case 'x': { // 'x'
+          switch (mnemonic[1]) {
+            case 'a': { // 'xa'
+              if (mnemonic[2] == 'd') { // 'xad'
+                if (mnemonic[3] == 'd') { // 'xadd'
+                  mnemonic = "Xadd";
+                }
+              }
+            break;}
+            case 'c': { // 'xc'
+              if (mnemonic[2] == 'h') { // 'xch'
+                if (mnemonic[3] == 'g') { // 'xchg'
+                  mnemonic = "Xchg";
+                }
+              }
+            break;}
+            case 'l': { // 'xl'
+              if (mnemonic[2] == 'a') { // 'xla'
+                if (mnemonic[3] == 't') { // 'xlat'
+                  mnemonic = "Xlatb";
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        default: break;
+      }
+    break;
+    case 5:
+      switch (mnemonic[0]) {
+        case 'a': { // 'a'
+          switch (mnemonic[1]) {
+            case 'd': { // 'ad'
+              if (mnemonic[2] == 'd') { // 'add'
+                if (mnemonic[3] == 's') { // 'adds'
+                  switch (mnemonic[4]) {
+                    case 'd': { // 'addsd'
+                      mnemonic = "Addsd";
+                    break;}
+                    case 's': { // 'addss'
+                      mnemonic = "Addss";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            case 'n': { // 'an'
+              if (mnemonic[2] == 'd') { // 'and'
+                if (mnemonic[3] == 'p') { // 'andp'
+                  if (mnemonic[4] == 'd') { // 'andpd'
+                    mnemonic = "Andpd";
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'b': { // 'b'
+          switch (mnemonic[1]) {
+            case 'o': { // 'bo'
+              if (mnemonic[2] == 'u') { // 'bou'
+                if (mnemonic[3] == 'n') { // 'boun'
+                  if (mnemonic[4] == 'd') { // 'bound'
+                    mnemonic = "Bound";
+                  }
+                }
+              }
+            break;}
+            case 's': { // 'bs'
+              if (mnemonic[2] == 'w') { // 'bsw'
+                if (mnemonic[3] == 'a') { // 'bswa'
+                  if (mnemonic[4] == 'p') { // 'bswap'
+                    mnemonic = "Bswap";
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'c': { // 'c'
+          switch (mnemonic[1]) {
+            case 'm': { // 'cm'
+              switch (mnemonic[2]) {
+                case 'o': { // 'cmo'
+                  if (mnemonic[3] == 'v') { // 'cmov'
+                    switch (mnemonic[4]) {
+                      case 'a': { // 'cmova'
+                        mnemonic = "CMova";
+                      break;}
+                      case 'b': { // 'cmovb'
+                        mnemonic = "CMovb";
+                      break;}
+                      case 'c': { // 'cmovc'
+                        mnemonic = "CMovb";
+                      break;}
+                      case 'e': { // 'cmove'
+                        mnemonic = "CMove";
+                      break;}
+                      case 'g': { // 'cmovg'
+                        mnemonic = "CMovg";
+                      break;}
+                      case 'l': { // 'cmovl'
+                        mnemonic = "CMovl";
+                      break;}
+                      case 'o': { // 'cmovo'
+                        mnemonic = "CMovo";
+                      break;}
+                      case 'p': { // 'cmovp'
+                        mnemonic = "CMovpe";
+                      break;}
+                      case 's': { // 'cmovs'
+                        mnemonic = "CMovs";
+                      break;}
+                      case 'z': { // 'cmovz'
+                        mnemonic = "CMove";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                case 'p': { // 'cmp'
+                  if (mnemonic[3] == 's') { // 'cmps'
+                    switch (mnemonic[4]) {
+                      case 'b': { // 'cmpsb'
+                        mnemonic = "Cmpsb";
+                      break;}
+                      case 'd': { // 'cmpsd'
+                        mnemonic = "Cmpsd";
+                      break;}
+                      case 'q': { // 'cmpsq'
+                        mnemonic = "Cmpsq";
+                      break;}
+                      case 'w': { // 'cmpsw'
+                        mnemonic = "Cmpsw";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'p': { // 'cp'
+              if (mnemonic[2] == 'u') { // 'cpu'
+                if (mnemonic[3] == 'i') { // 'cpui'
+                  if (mnemonic[4] == 'd') { // 'cpuid'
+                    mnemonic = "Cpuid";
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'd': { // 'd'
+          if (mnemonic[1] == 'i') { // 'di'
+            if (mnemonic[2] == 'v') { // 'div'
+              if (mnemonic[3] == 's') { // 'divs'
+                if (mnemonic[4] == 'd') { // 'divsd'
+                  mnemonic = "Divsd";
+                }
+              }
+            }
+          }
+        break;}
+        case 'e': { // 'e'
+          if (mnemonic[1] == 'n') { // 'en'
+            if (mnemonic[2] == 't') { // 'ent'
+              if (mnemonic[3] == 'e') { // 'ente'
+                if (mnemonic[4] == 'r') { // 'enter'
+                  mnemonic = "Enter";
+                }
+              }
+            }
+          }
+        break;}
+        case 'f': { // 'f'
+          switch (mnemonic[1]) {
+            case '2': { // 'f2'
+              if (mnemonic[2] == 'x') { // 'f2x'
+                if (mnemonic[3] == 'm') { // 'f2xm'
+                  if (mnemonic[4] == '1') { // 'f2xm1'
+                    mnemonic = "F2xm1";
+                  }
+                }
+              }
+            break;}
+            case 'a': { // 'fa'
+              if (mnemonic[2] == 'd') { // 'fad'
+                if (mnemonic[3] == 'd') { // 'fadd'
+                  switch (mnemonic[4]) {
+                    case 'l': { // 'faddl'
+                      mnemonic = "Fadd";
+                    break;}
+                    case 'p': { // 'faddp'
+                      mnemonic = "Faddp";
+                    break;}
+                    case 's': { // 'fadds'
+                      mnemonic = "Fadd";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            case 'c': { // 'fc'
+              if (mnemonic[2] == 'o') { // 'fco'
+                if (mnemonic[3] == 'm') { // 'fcom'
+                  switch (mnemonic[4]) {
+                    case 'l': { // 'fcoml'
+                      mnemonic = "Fcom";
+                    break;}
+                    case 'p': { // 'fcomp'
+                      mnemonic = "Fcomp";
+                    break;}
+                    case 's': { // 'fcoms'
+                      mnemonic = "Fcom";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            case 'd': { // 'fd'
+              if (mnemonic[2] == 'i') { // 'fdi'
+                if (mnemonic[3] == 'v') { // 'fdiv'
+                  switch (mnemonic[4]) {
+                    case 'l': { // 'fdivl'
+                      mnemonic = "Fdiv";
+                    break;}
+                    case 'p': { // 'fdivp'
+                      mnemonic = "Fdivp";
+                    break;}
+                    case 'r': { // 'fdivr'
+                      mnemonic = "Fdivr";
+                    break;}
+                    case 's': { // 'fdivs'
+                      mnemonic = "Fdiv";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            case 'f': { // 'ff'
+              if (mnemonic[2] == 'r') { // 'ffr'
+                if (mnemonic[3] == 'e') { // 'ffre'
+                  if (mnemonic[4] == 'e') { // 'ffree'
+                    mnemonic = "Ffree";
+                  }
+                }
+              }
+            break;}
+            case 'i': { // 'fi'
+              switch (mnemonic[2]) {
+                case 'a': { // 'fia'
+                  if (mnemonic[3] == 'd') { // 'fiad'
+                    if (mnemonic[4] == 'd') { // 'fiadd'
+                      mnemonic = "Fiadd";
+                    }
+                  }
+                break;}
+                case 'd': { // 'fid'
+                  if (mnemonic[3] == 'i') { // 'fidi'
+                    if (mnemonic[4] == 'v') { // 'fidiv'
+                      mnemonic = "Fidiv";
+                    }
+                  }
+                break;}
+                case 'l': { // 'fil'
+                  if (mnemonic[3] == 'd') { // 'fild'
+                    if (mnemonic[4] == 'l') { // 'fildl'
+                      mnemonic = "Fild";
+                    }
+                  }
+                break;}
+                case 'm': { // 'fim'
+                  if (mnemonic[3] == 'u') { // 'fimu'
+                    if (mnemonic[4] == 'l') { // 'fimul'
+                      mnemonic = "Fimul";
+                    }
+                  }
+                break;}
+                case 's': { // 'fis'
+                  if (mnemonic[3] == 't') { // 'fist'
+                    switch (mnemonic[4]) {
+                      case 'l': { // 'fistl'
+                        mnemonic = "Fist";
+                      break;}
+                      case 'p': { // 'fistp'
+                        mnemonic = "Fistp";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'l': { // 'fl'
+              if (mnemonic[2] == 'd') { // 'fld'
+                switch (mnemonic[3]) {
+                  case 'c': { // 'fldc'
+                    if (mnemonic[4] == 'w') { // 'fldcw'
+                      mnemonic = "Fldcw";
+                    }
+                  break;}
+                  case 'p': { // 'fldp'
+                    if (mnemonic[4] == 'i') { // 'fldpi'
+                      mnemonic = "Fldpi";
+                    }
+                  break;}
+                  default: break;
+                }
+              }
+            break;}
+            case 'm': { // 'fm'
+              if (mnemonic[2] == 'u') { // 'fmu'
+                if (mnemonic[3] == 'l') { // 'fmul'
+                  switch (mnemonic[4]) {
+                    case 'l': { // 'fmull'
+                      mnemonic = "Fmul";
+                    break;}
+                    case 'p': { // 'fmulp'
+                      mnemonic = "Fmulp";
+                    break;}
+                    case 's': { // 'fmuls'
+                      mnemonic = "Fmul";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            case 'p': { // 'fp'
+              switch (mnemonic[2]) {
+                case 'r': { // 'fpr'
+                  if (mnemonic[3] == 'e') { // 'fpre'
+                    if (mnemonic[4] == 'm') { // 'fprem'
+                      mnemonic = "Fprem";
+                    }
+                  }
+                break;}
+                case 't': { // 'fpt'
+                  if (mnemonic[3] == 'a') { // 'fpta'
+                    if (mnemonic[4] == 'n') { // 'fptan'
+                      mnemonic = "Fptan";
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 's': { // 'fs'
+              switch (mnemonic[2]) {
+                case 'a': { // 'fsa'
+                  if (mnemonic[3] == 'v') { // 'fsav'
+                    if (mnemonic[4] == 'e') { // 'fsave'
+                      mnemonic = "Fsave";
+                    }
+                  }
+                break;}
+                case 'q': { // 'fsq'
+                  if (mnemonic[3] == 'r') { // 'fsqr'
+                    if (mnemonic[4] == 't') { // 'fsqrt'
+                      mnemonic = "Fsqrt";
+                    }
+                  }
+                break;}
+                case 't': { // 'fst'
+                  if (mnemonic[3] == 'p') { // 'fstp'
+                    switch (mnemonic[4]) {
+                      case 'l': { // 'fstpl'
+                        mnemonic = "Fstp";
+                      break;}
+                      case 's': { // 'fstps'
+                        mnemonic = "Fstp";
+                      break;}
+                      case 't': { // 'fstpt'
+                        mnemonic = "Fstp";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                case 'u': { // 'fsu'
+                  if (mnemonic[3] == 'b') { // 'fsub'
+                    switch (mnemonic[4]) {
+                      case 'l': { // 'fsubl'
+                        mnemonic = "Fsub";
+                      break;}
+                      case 'p': { // 'fsubp'
+                        mnemonic = "Fsubp";
+                      break;}
+                      case 'r': { // 'fsubr'
+                        mnemonic = "Fsubr";
+                      break;}
+                      case 's': { // 'fsubs'
+                        mnemonic = "Fsub";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'u': { // 'fu'
+              if (mnemonic[2] == 'c') { // 'fuc'
+                if (mnemonic[3] == 'o') { // 'fuco'
+                  if (mnemonic[4] == 'm') { // 'fucom'
+                    mnemonic = "Fucom";
+                  }
+                }
+              }
+            break;}
+            case 'w': { // 'fw'
+              if (mnemonic[2] == 'a') { // 'fwa'
+                if (mnemonic[3] == 'i') { // 'fwai'
+                  if (mnemonic[4] == 't') { // 'fwait'
+                    mnemonic = "Fwait";
+                  }
+                }
+              }
+            break;}
+            case 'y': { // 'fy'
+              if (mnemonic[2] == 'l') { // 'fyl'
+                if (mnemonic[3] == '2') { // 'fyl2'
+                  if (mnemonic[4] == 'x') { // 'fyl2x'
+                    mnemonic = "Fyl2x";
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'i': { // 'i'
+          if (mnemonic[1] == 'r') { // 'ir'
+            if (mnemonic[2] == 'e') { // 'ire'
+              if (mnemonic[3] == 't') { // 'iret'
+                switch (mnemonic[4]) {
+                  case 'd': { // 'iretd'
+                    mnemonic = "IRet";
+                  break;}
+                  case 'l': { // 'iretl'
+                    mnemonic = "IRet";
+                  break;}
+                  case 'q': { // 'iretq'
+                    mnemonic = "IRet";
+                  break;}
+                  default: break;
+                }
+              }
+            }
+          }
+        break;}
+        case 'j': { // 'j'
+          switch (mnemonic[1]) {
+            case 'e': { // 'je'
+              if (mnemonic[2] == 'c') { // 'jec'
+                if (mnemonic[3] == 'x') { // 'jecx'
+                  if (mnemonic[4] == 'z') { // 'jecxz'
+                    mnemonic = "Jecxz";
+                  }
+                }
+              }
+            break;}
+            case 'r': { // 'jr'
+              if (mnemonic[2] == 'c') { // 'jrc'
+                if (mnemonic[3] == 'x') { // 'jrcx'
+                  if (mnemonic[4] == 'z') { // 'jrcxz'
+                    mnemonic = "Jrcxz";
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'l': { // 'l'
+          switch (mnemonic[1]) {
+            case 'e': { // 'le'
+              if (mnemonic[2] == 'a') { // 'lea'
+                if (mnemonic[3] == 'v') { // 'leav'
+                  if (mnemonic[4] == 'e') { // 'leave'
+                    mnemonic = "Leave";
+                  }
+                }
+              }
+            break;}
+            case 'o': { // 'lo'
+              switch (mnemonic[2]) {
+                case 'd': { // 'lod'
+                  if (mnemonic[3] == 's') { // 'lods'
+                    switch (mnemonic[4]) {
+                      case 'b': { // 'lodsb'
+                        mnemonic = "Lodsb";
+                      break;}
+                      case 'd': { // 'lodsd'
+                        mnemonic = "Lodsd";
+                      break;}
+                      case 'q': { // 'lodsq'
+                        mnemonic = "Lodsq";
+                      break;}
+                      case 'w': { // 'lodsw'
+                        mnemonic = "Lodsw";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                case 'o': { // 'loo'
+                  if (mnemonic[3] == 'p') { // 'loop'
+                    switch (mnemonic[4]) {
+                      case 'e': { // 'loope'
+                        mnemonic = "Loopz";
+                      break;}
+                      case 'l': { // 'loopl'
+                        mnemonic = "Loop";
+                      break;}
+                      case 'z': { // 'loopz'
+                        mnemonic = "Loopz";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'm': { // 'm'
+          if (mnemonic[1] == 'o') { // 'mo'
+            if (mnemonic[2] == 'v') { // 'mov'
+              switch (mnemonic[3]) {
+                case 's': { // 'movs'
+                  switch (mnemonic[4]) {
+                    case 'b': { // 'movsb'
+                      mnemonic = "Movsb";
+                    break;}
+                    case 'd': { // 'movsd'
+                      mnemonic = "Movsd";
+                    break;}
+                    case 'q': { // 'movsq'
+                      mnemonic = "Movsq";
+                    break;}
+                    case 's': { // 'movss'
+                      mnemonic = "Movss";
+                    break;}
+                    case 'w': { // 'movsw'
+                      mnemonic = "Movsw";
+                    break;}
+                    case 'x': { // 'movsx'
+                      mnemonic = "Movsx";
+                    break;}
+                    default: break;
+                  }
+                break;}
+                case 'z': { // 'movz'
+                  if (mnemonic[4] == 'x') { // 'movzx'
+                    mnemonic = "Movzx";
+                  }
+                break;}
+                default: break;
+              }
+            }
+          }
+        break;}
+        case 'o': { // 'o'
+          if (mnemonic[1] == 'u') { // 'ou'
+            if (mnemonic[2] == 't') { // 'out'
+              if (mnemonic[3] == 's') { // 'outs'
+                switch (mnemonic[4]) {
+                  case 'b': { // 'outsb'
+                    mnemonic = "Outsb";
+                  break;}
+                  case 'd': { // 'outsd'
+                    mnemonic = "Outsd";
+                  break;}
+                  case 'w': { // 'outsw'
+                    mnemonic = "Outsw";
+                  break;}
+                  default: break;
+                }
+              }
+            }
+          }
+        break;}
+        case 'p': { // 'p'
+          switch (mnemonic[1]) {
+            case 'a': { // 'pa'
+              switch (mnemonic[2]) {
+                case 'd': { // 'pad'
+                  if (mnemonic[3] == 'd') { // 'padd'
+                    switch (mnemonic[4]) {
+                      case 'b': { // 'paddb'
+                        mnemonic = "Padd";
+                      break;}
+                      case 'd': { // 'paddd'
+                        mnemonic = "Padd";
+                      break;}
+                      case 'q': { // 'paddq'
+                        mnemonic = "Padd";
+                      break;}
+                      case 'w': { // 'paddw'
+                        mnemonic = "Padd";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                case 'n': { // 'pan'
+                  if (mnemonic[3] == 'd') { // 'pand'
+                    if (mnemonic[4] == 'n') { // 'pandn'
+                      mnemonic = "Pandn";
+                    }
+                  }
+                break;}
+                case 'u': { // 'pau'
+                  if (mnemonic[3] == 's') { // 'paus'
+                    if (mnemonic[4] == 'e') { // 'pause'
+                      mnemonic = "Pause";
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'o': { // 'po'
+              if (mnemonic[2] == 'p') { // 'pop'
+                switch (mnemonic[3]) {
+                  case 'a': { // 'popa'
+                    if (mnemonic[4] == 'd') { // 'popad'
+                      mnemonic = "Popad";
+                    }
+                  break;}
+                  case 'f': { // 'popf'
+                    switch (mnemonic[4]) {
+                      case 'd': { // 'popfd'
+                        mnemonic = "Popfd";
+                      break;}
+                      case 'q': { // 'popfq'
+                        mnemonic = "Popfq";
+                      break;}
+                      default: break;
+                    }
+                  break;}
+                  default: break;
+                }
+              }
+            break;}
+            case 's': { // 'ps'
+              switch (mnemonic[2]) {
+                case 'l': { // 'psl'
+                  if (mnemonic[3] == 'l') { // 'psll'
+                    switch (mnemonic[4]) {
+                      case 'd': { // 'pslld'
+                        mnemonic = "Psll";
+                      break;}
+                      case 'q': { // 'psllq'
+                        mnemonic = "Psll";
+                      break;}
+                      case 'w': { // 'psllw'
+                        mnemonic = "Psll";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                case 'r': { // 'psr'
+                  if (mnemonic[3] == 'l') { // 'psrl'
+                    switch (mnemonic[4]) {
+                      case 'd': { // 'psrld'
+                        mnemonic = "Psrl";
+                      break;}
+                      case 'q': { // 'psrlq'
+                        mnemonic = "Psrl";
+                      break;}
+                      case 'w': { // 'psrlw'
+                        mnemonic = "Psrl";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                case 'u': { // 'psu'
+                  if (mnemonic[3] == 'b') { // 'psub'
+                    switch (mnemonic[4]) {
+                      case 'b': { // 'psubb'
+                        mnemonic = "Psub";
+                      break;}
+                      case 'd': { // 'psubd'
+                        mnemonic = "Psub";
+                      break;}
+                      case 'w': { // 'psubw'
+                        mnemonic = "Psub";
+                      break;}
+                      default: break;
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'u': { // 'pu'
+              if (mnemonic[2] == 's') { // 'pus'
+                if (mnemonic[3] == 'h') { // 'push'
+                  switch (mnemonic[4]) {
+                    case 'a': { // 'pusha'
+                      mnemonic = "Pusha";
+                    break;}
+                    case 'f': { // 'pushf'
+                      mnemonic = "Pushf";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'r': { // 'r'
+          if (mnemonic[1] == 'd') { // 'rd'
+            if (mnemonic[2] == 't') { // 'rdt'
+              if (mnemonic[3] == 's') { // 'rdts'
+                if (mnemonic[4] == 'c') { // 'rdtsc'
+                  mnemonic = "Rdtsc";
+                }
+              }
+            }
+          }
+        break;}
+        case 's': { // 's'
+          switch (mnemonic[1]) {
+            case 'c': { // 'sc'
+              if (mnemonic[2] == 'a') { // 'sca'
+                if (mnemonic[3] == 's') { // 'scas'
+                  switch (mnemonic[4]) {
+                    case 'b': { // 'scasb'
+                      mnemonic = "Scasb";
+                    break;}
+                    case 'd': { // 'scasd'
+                      mnemonic = "Scasd";
+                    break;}
+                    case 'q': { // 'scasq'
+                      mnemonic = "Scasq";
+                    break;}
+                    case 'w': { // 'scasw'
+                      mnemonic = "Scasw";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            case 'e': { // 'se'
+              if (mnemonic[2] == 't') { // 'set'
+                switch (mnemonic[3]) {
+                  case 'a': { // 'seta'
+                    if (mnemonic[4] == 'e') { // 'setae'
+                      mnemonic = "Setb";
+                    }
+                  break;}
+                  case 'b': { // 'setb'
+                    if (mnemonic[4] == 'e') { // 'setbe'
+                      mnemonic = "Setbe";
+                    }
+                  break;}
+                  case 'g': { // 'setg'
+                    if (mnemonic[4] == 'e') { // 'setge'
+                      mnemonic = "Setge";
+                    }
+                  break;}
+                  case 'l': { // 'setl'
+                    if (mnemonic[4] == 'e') { // 'setle'
+                      mnemonic = "Setle";
+                    }
+                  break;}
+                  case 'n': { // 'setn'
+                    switch (mnemonic[4]) {
+                      case 'a': { // 'setna'
+                        mnemonic = "Setbe";
+                      break;}
+                      case 'b': { // 'setnb'
+                        mnemonic = "Setae";
+                      break;}
+                      case 'c': { // 'setnc'
+                        mnemonic = "Setae";
+                      break;}
+                      case 'e': { // 'setne'
+                        mnemonic = "Setne";
+                      break;}
+                      case 'g': { // 'setng'
+                        mnemonic = "Setle";
+                      break;}
+                      case 'l': { // 'setnl'
+                        mnemonic = "Setge";
+                      break;}
+                      case 'o': { // 'setno'
+                        mnemonic = "Setno";
+                      break;}
+                      case 'p': { // 'setnp'
+                        mnemonic = "Setpo";
+                      break;}
+                      case 's': { // 'setns'
+                        mnemonic = "Setns";
+                      break;}
+                      case 'z': { // 'setnz'
+                        mnemonic = "Setne";
+                      break;}
+                      default: break;
+                    }
+                  break;}
+                  case 'p': { // 'setp'
+                    switch (mnemonic[4]) {
+                      case 'e': { // 'setpe'
+                        mnemonic = "Setpe";
+                      break;}
+                      case 'o': { // 'setpo'
+                        mnemonic = "Setpo";
+                      break;}
+                      default: break;
+                    }
+                  break;}
+                  default: break;
+                }
+              }
+            break;}
+            case 'l': { // 'sl'
+              if (mnemonic[2] == 'd') { // 'sld'
+                if (mnemonic[3] == 't') { // 'sldt'
+                  if (mnemonic[4] == 'l') { // 'sldtl'
+                    mnemonic = "Sldt";
+                  }
+                }
+              }
+            break;}
+            case 't': { // 'st'
+              if (mnemonic[2] == 'o') { // 'sto'
+                if (mnemonic[3] == 's') { // 'stos'
+                  switch (mnemonic[4]) {
+                    case 'b': { // 'stosb'
+                      mnemonic = "Stosb";
+                    break;}
+                    case 'd': { // 'stosd'
+                      mnemonic = "Stosd";
+                    break;}
+                    case 'q': { // 'stosq'
+                      mnemonic = "Stosq";
+                    break;}
+                    case 'w': { // 'stosw'
+                      mnemonic = "Stosw";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            case 'u': { // 'su'
+              if (mnemonic[2] == 'b') { // 'sub'
+                if (mnemonic[3] == 's') { // 'subs'
+                  switch (mnemonic[4]) {
+                    case 'd': { // 'subsd'
+                      mnemonic = "Subsd";
+                    break;}
+                    case 's': { // 'subss'
+                      mnemonic = "Subss";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'x': { // 'x'
+          switch (mnemonic[1]) {
+            case 'a': { // 'xa'
+              if (mnemonic[2] == 'd') { // 'xad'
+                if (mnemonic[3] == 'd') { // 'xadd'
+                  if (mnemonic[4] == 'l') { // 'xaddl'
+                    mnemonic = "Xadd";
+                  }
+                }
+              }
+            break;}
+            case 'l': { // 'xl'
+              if (mnemonic[2] == 'a') { // 'xla'
+                if (mnemonic[3] == 't') { // 'xlat'
+                  if (mnemonic[4] == 'b') { // 'xlatb'
+                    mnemonic = "Xlatb";
+                  }
+                }
+              }
+            break;}
+            case 'o': { // 'xo'
+              if (mnemonic[2] == 'r') { // 'xor'
+                if (mnemonic[3] == 'p') { // 'xorp'
+                  switch (mnemonic[4]) {
+                    case 'd': { // 'xorpd'
+                      mnemonic = "Xorpd";
+                    break;}
+                    case 's': { // 'xorps'
+                      mnemonic = "Xorps";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        default: break;
+      }
+    break;
+    case 6:
+      switch (mnemonic[0]) {
+        case 'a': { // 'a'
+          if (mnemonic[1] == 'n') { // 'an'
+            if (mnemonic[2] == 'd') { // 'and'
+              if (mnemonic[3] == 'n') { // 'andn'
+                if (mnemonic[4] == 'p') { // 'andnp'
+                  switch (mnemonic[5]) {
+                    case 'd': { // 'andnpd'
+                      mnemonic = "Andnpd";
+                    break;}
+                    case 's': { // 'andnps'
+                      mnemonic = "Andnpd";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            }
+          }
+        break;}
+        case 'b': { // 'b'
+          if (mnemonic[1] == 'o') { // 'bo'
+            if (mnemonic[2] == 'u') { // 'bou'
+              if (mnemonic[3] == 'n') { // 'boun'
+                if (mnemonic[4] == 'd') { // 'bound'
+                  if (mnemonic[5] == 'l') { // 'boundl'
+                    mnemonic = "Bound";
+                  }
+                }
+              }
+            }
+          }
+        break;}
+        case 'c': { // 'c'
+          if (mnemonic[1] == 'm') { // 'cm'
+            if (mnemonic[2] == 'o') { // 'cmo'
+              if (mnemonic[3] == 'v') { // 'cmov'
+                switch (mnemonic[4]) {
+                  case 'a': { // 'cmova'
+                    if (mnemonic[5] == 'e') { // 'cmovae'
+                      mnemonic = "CMovae";
+                    }
+                  break;}
+                  case 'b': { // 'cmovb'
+                    if (mnemonic[5] == 'e') { // 'cmovbe'
+                      mnemonic = "CMovbe";
+                    }
+                  break;}
+                  case 'g': { // 'cmovg'
+                    if (mnemonic[5] == 'e') { // 'cmovge'
+                      mnemonic = "CMovge";
+                    }
+                  break;}
+                  case 'l': { // 'cmovl'
+                    if (mnemonic[5] == 'e') { // 'cmovle'
+                      mnemonic = "CMovle";
+                    }
+                  break;}
+                  case 'n': { // 'cmovn'
+                    switch (mnemonic[5]) {
+                      case 'a': { // 'cmovna'
+                        mnemonic = "CMovbe";
+                      break;}
+                      case 'b': { // 'cmovnb'
+                        mnemonic = "CMovae";
+                      break;}
+                      case 'c': { // 'cmovnc'
+                        mnemonic = "CMovae";
+                      break;}
+                      case 'e': { // 'cmovne'
+                        mnemonic = "CMovne";
+                      break;}
+                      case 'g': { // 'cmovng'
+                        mnemonic = "CMovle";
+                      break;}
+                      case 'l': { // 'cmovnl'
+                        mnemonic = "CMovge";
+                      break;}
+                      case 'o': { // 'cmovno'
+                        mnemonic = "CMovno";
+                      break;}
+                      case 'p': { // 'cmovnp'
+                        mnemonic = "CMovpo";
+                      break;}
+                      case 's': { // 'cmovns'
+                        mnemonic = "CMovns";
+                      break;}
+                      case 'z': { // 'cmovnz'
+                        mnemonic = "CMovne";
+                      break;}
+                      default: break;
+                    }
+                  break;}
+                  case 'p': { // 'cmovp'
+                    switch (mnemonic[5]) {
+                      case 'e': { // 'cmovpe'
+                        mnemonic = "CMovpe";
+                      break;}
+                      case 'o': { // 'cmovpo'
+                        mnemonic = "CMovpo";
+                      break;}
+                      default: break;
+                    }
+                  break;}
+                  default: break;
+                }
+              }
+            }
+          }
+        break;}
+        case 'd': { // 'd'
+          if (mnemonic[1] == 'a') { // 'da'
+            if (mnemonic[2] == 't') { // 'dat'
+              if (mnemonic[3] == 'a') { // 'data'
+                if (mnemonic[4] == '1') { // 'data1'
+                  if (mnemonic[5] == '6') { // 'data16'
+                    mnemonic = "Data16";
+                  }
+                }
+              }
+            }
+          }
+        break;}
+        case 'e': { // 'e'
+          if (mnemonic[1] == 'n') { // 'en'
+            if (mnemonic[2] == 't') { // 'ent'
+              if (mnemonic[3] == 'e') { // 'ente'
+                if (mnemonic[4] == 'r') { // 'enter'
+                  if (mnemonic[5] == 'l') { // 'enterl'
+                    mnemonic = "Enter";
+                  }
+                }
+              }
+            }
+          }
+        break;}
+        case 'f': { // 'f'
+          switch (mnemonic[1]) {
+            case 'c': { // 'fc'
+              if (mnemonic[2] == 'o') { // 'fco'
+                if (mnemonic[3] == 'm') { // 'fcom'
+                  if (mnemonic[4] == 'p') { // 'fcomp'
+                    switch (mnemonic[5]) {
+                      case 'l': { // 'fcompl'
+                        mnemonic = "Fcomp";
+                      break;}
+                      case 'p': { // 'fcompp'
+                        mnemonic = "Fcompp";
+                      break;}
+                      case 's': { // 'fcomps'
+                        mnemonic = "Fcomp";
+                      break;}
+                      default: break;
+                    }
+                  }
+                }
+              }
+            break;}
+            case 'd': { // 'fd'
+              if (mnemonic[2] == 'i') { // 'fdi'
+                if (mnemonic[3] == 'v') { // 'fdiv'
+                  if (mnemonic[4] == 'r') { // 'fdivr'
+                    switch (mnemonic[5]) {
+                      case 'l': { // 'fdivrl'
+                        mnemonic = "Fdivr";
+                      break;}
+                      case 'p': { // 'fdivrp'
+                        mnemonic = "Fdivrp";
+                      break;}
+                      case 's': { // 'fdivrs'
+                        mnemonic = "Fdivr";
+                      break;}
+                      default: break;
+                    }
+                  }
+                }
+              }
+            break;}
+            case 'i': { // 'fi'
+              switch (mnemonic[2]) {
+                case 'a': { // 'fia'
+                  if (mnemonic[3] == 'd') { // 'fiad'
+                    if (mnemonic[4] == 'd') { // 'fiadd'
+                      if (mnemonic[5] == 'l') { // 'fiaddl'
+                        mnemonic = "Fiadd";
+                      }
+                    }
+                  }
+                break;}
+                case 'd': { // 'fid'
+                  if (mnemonic[3] == 'i') { // 'fidi'
+                    if (mnemonic[4] == 'v') { // 'fidiv'
+                      if (mnemonic[5] == 'l') { // 'fidivl'
+                        mnemonic = "Fidiv";
+                      }
+                    }
+                  }
+                break;}
+                case 'm': { // 'fim'
+                  if (mnemonic[3] == 'u') { // 'fimu'
+                    if (mnemonic[4] == 'l') { // 'fimul'
+                      if (mnemonic[5] == 'l') { // 'fimull'
+                        mnemonic = "Fimul";
+                      }
+                    }
+                  }
+                break;}
+                case 's': { // 'fis'
+                  if (mnemonic[3] == 't') { // 'fist'
+                    if (mnemonic[4] == 'p') { // 'fistp'
+                      if (mnemonic[5] == 'l') { // 'fistpl'
+                        mnemonic = "Fistp";
+                      }
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'l': { // 'fl'
+              if (mnemonic[2] == 'd') { // 'fld'
+                if (mnemonic[3] == 'l') { // 'fldl'
+                  switch (mnemonic[4]) {
+                    case '2': { // 'fldl2'
+                      switch (mnemonic[5]) {
+                        case 'e': { // 'fldl2e'
+                          mnemonic = "Fldl2e";
+                        break;}
+                        case 't': { // 'fldl2t'
+                          mnemonic = "Fldl2t";
+                        break;}
+                        default: break;
+                      }
+                    break;}
+                    case 'g': { // 'fldlg'
+                      if (mnemonic[5] == '2') { // 'fldlg2'
+                        mnemonic = "Fldlg2";
+                      }
+                    break;}
+                    case 'n': { // 'fldln'
+                      if (mnemonic[5] == '2') { // 'fldln2'
+                        mnemonic = "Fldln2";
+                      }
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            case 'n': { // 'fn'
+              if (mnemonic[2] == 's') { // 'fns'
+                if (mnemonic[3] == 't') { // 'fnst'
+                  switch (mnemonic[4]) {
+                    case 'c': { // 'fnstc'
+                      if (mnemonic[5] == 'w') { // 'fnstcw'
+                        mnemonic = "Fnstcw";
+                      }
+                    break;}
+                    case 's': { // 'fnsts'
+                      if (mnemonic[5] == 'w') { // 'fnstsw'
+                        mnemonic = "Fnstsw";
+                      }
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            break;}
+            case 'p': { // 'fp'
+              if (mnemonic[2] == 'a') { // 'fpa'
+                if (mnemonic[3] == 't') { // 'fpat'
+                  if (mnemonic[4] == 'a') { // 'fpata'
+                    if (mnemonic[5] == 'n') { // 'fpatan'
+                      mnemonic = "Fpatan";
+                    }
+                  }
+                }
+              }
+            break;}
+            case 's': { // 'fs'
+              switch (mnemonic[2]) {
+                case 'c': { // 'fsc'
+                  if (mnemonic[3] == 'a') { // 'fsca'
+                    if (mnemonic[4] == 'l') { // 'fscal'
+                      if (mnemonic[5] == 'e') { // 'fscale'
+                        mnemonic = "Fscale";
+                      }
+                    }
+                  }
+                break;}
+                case 'u': { // 'fsu'
+                  if (mnemonic[3] == 'b') { // 'fsub'
+                    if (mnemonic[4] == 'r') { // 'fsubr'
+                      switch (mnemonic[5]) {
+                        case 'l': { // 'fsubrl'
+                          mnemonic = "Fsubr";
+                        break;}
+                        case 'p': { // 'fsubrp'
+                          mnemonic = "Fsubrp";
+                        break;}
+                        case 's': { // 'fsubrs'
+                          mnemonic = "Fsubr";
+                        break;}
+                        default: break;
+                      }
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            break;}
+            case 'u': { // 'fu'
+              if (mnemonic[2] == 'c') { // 'fuc'
+                if (mnemonic[3] == 'o') { // 'fuco'
+                  if (mnemonic[4] == 'm') { // 'fucom'
+                    switch (mnemonic[5]) {
+                      case 'i': { // 'fucomi'
+                        mnemonic = "Fucom";
+                      break;}
+                      case 'p': { // 'fucomp'
+                        mnemonic = "Fucomp";
+                      break;}
+                      default: break;
+                    }
+                  }
+                }
+              }
+            break;}
+            case 'x': { // 'fx'
+              if (mnemonic[2] == 's') { // 'fxs'
+                if (mnemonic[3] == 'a') { // 'fxsa'
+                  if (mnemonic[4] == 'v') { // 'fxsav'
+                    if (mnemonic[5] == 'e') { // 'fxsave'
+                      mnemonic = "Fxsave";
+                    }
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'l': { // 'l'
+          if (mnemonic[1] == 'o') { // 'lo'
+            if (mnemonic[2] == 'o') { // 'loo'
+              if (mnemonic[3] == 'p') { // 'loop'
+                if (mnemonic[4] == 'n') { // 'loopn'
+                  switch (mnemonic[5]) {
+                    case 'e': { // 'loopne'
+                      mnemonic = "Loopnz";
+                    break;}
+                    case 'z': { // 'loopnz'
+                      mnemonic = "Loopnz";
+                    break;}
+                    default: break;
+                  }
+                }
+              }
+            }
+          }
+        break;}
+        case 'm': { // 'm'
+          if (mnemonic[1] == 'o') { // 'mo'
+            if (mnemonic[2] == 'v') { // 'mov'
+              switch (mnemonic[3]) {
+                case 'a': { // 'mova'
+                  if (mnemonic[4] == 'p') { // 'movap'
+                    if (mnemonic[5] == 's') { // 'movaps'
+                      mnemonic = "Movaps";
+                    }
+                  }
+                break;}
+                case 'd': { // 'movd'
+                  if (mnemonic[4] == 'q') { // 'movdq'
+                    if (mnemonic[5] == 'u') { // 'movdqu'
+                      mnemonic = "Movdqu";
+                    }
+                  }
+                break;}
+                case 'l': { // 'movl'
+                  if (mnemonic[4] == 'p') { // 'movlp'
+                    if (mnemonic[5] == 'd') { // 'movlpd'
+                      mnemonic = "Movlpd";
+                    }
+                  }
+                break;}
+                case 'n': { // 'movn'
+                  if (mnemonic[4] == 't') { // 'movnt'
+                    if (mnemonic[5] == 'q') { // 'movntq'
+                      mnemonic = "Movntq";
+                    }
+                  }
+                break;}
+                default: break;
+              }
+            }
+          }
+        break;}
+        case 'p': { // 'p'
+          if (mnemonic[1] == 'u') { // 'pu'
+            if (mnemonic[2] == 's') { // 'pus'
+              if (mnemonic[3] == 'h') { // 'push'
+                switch (mnemonic[4]) {
+                  case 'a': { // 'pusha'
+                    if (mnemonic[5] == 'd') { // 'pushad'
+                      mnemonic = "Pushad";
+                    }
+                  break;}
+                  case 'f': { // 'pushf'
+                    switch (mnemonic[5]) {
+                      case 'd': { // 'pushfd'
+                        mnemonic = "Pushfd";
+                      break;}
+                      case 'q': { // 'pushfq'
+                        mnemonic = "Pushfq";
+                      break;}
+                      default: break;
+                    }
+                  break;}
+                  default: break;
+                }
+              }
+            }
+          }
+        break;}
+        case 's': { // 's'
+          if (mnemonic[1] == 'e') { // 'se'
+            if (mnemonic[2] == 't') { // 'set'
+              if (mnemonic[3] == 'n') { // 'setn'
+                switch (mnemonic[4]) {
+                  case 'b': { // 'setnb'
+                    if (mnemonic[5] == 'e') { // 'setnbe'
+                      mnemonic = "Seta";
+                    }
+                  break;}
+                  case 'g': { // 'setng'
+                    if (mnemonic[5] == 'e') { // 'setnge'
+                      mnemonic = "Setl";
+                    }
+                  break;}
+                  case 'l': { // 'setnl'
+                    if (mnemonic[5] == 'e') { // 'setnle'
+                      mnemonic = "Setg";
+                    }
+                  break;}
+                  default: break;
+                }
+              }
+            }
+          }
+        break;}
+        default: break;
+      }
+    break;
+    case 7:
+      switch (mnemonic[0]) {
+        case 'c': { // 'c'
+          if (mnemonic[1] == 'm') { // 'cm'
+            switch (mnemonic[2]) {
+              case 'o': { // 'cmo'
+                if (mnemonic[3] == 'v') { // 'cmov'
+                  if (mnemonic[4] == 'n') { // 'cmovn'
+                    switch (mnemonic[5]) {
+                      case 'a': { // 'cmovna'
+                        if (mnemonic[6] == 'e') { // 'cmovnae'
+                          mnemonic = "CMovb";
+                        }
+                      break;}
+                      case 'b': { // 'cmovnb'
+                        if (mnemonic[6] == 'e') { // 'cmovnbe'
+                          mnemonic = "CMova";
+                        }
+                      break;}
+                      case 'g': { // 'cmovng'
+                        if (mnemonic[6] == 'e') { // 'cmovnge'
+                          mnemonic = "CMovl";
+                        }
+                      break;}
+                      case 'l': { // 'cmovnl'
+                        if (mnemonic[6] == 'e') { // 'cmovnle'
+                          mnemonic = "CMovg";
+                        }
+                      break;}
+                      default: break;
+                    }
+                  }
+                }
+              break;}
+              case 'p': { // 'cmp'
+                if (mnemonic[3] == 'x') { // 'cmpx'
+                  if (mnemonic[4] == 'c') { // 'cmpxc'
+                    if (mnemonic[5] == 'h') { // 'cmpxch'
+                      if (mnemonic[6] == 'g') { // 'cmpxchg'
+                        mnemonic = "Cmpxchg";
+                      }
+                    }
+                  }
+                }
+              break;}
+              default: break;
+            }
+          }
+        break;}
+        case 'f': { // 'f'
+          if (mnemonic[1] == 'u') { // 'fu'
+            if (mnemonic[2] == 'c') { // 'fuc'
+              if (mnemonic[3] == 'o') { // 'fuco'
+                if (mnemonic[4] == 'm') { // 'fucom'
+                  if (mnemonic[5] == 'p') { // 'fucomp'
+                    if (mnemonic[6] == 'p') { // 'fucompp'
+                      mnemonic = "Fucompp";
+                    }
+                  }
+                }
+              }
+            }
+          }
+        break;}
+        case 'l': { // 'l'
+          if (mnemonic[1] == 'd') { // 'ld'
+            if (mnemonic[2] == 'm') { // 'ldm'
+              if (mnemonic[3] == 'x') { // 'ldmx'
+                if (mnemonic[4] == 'c') { // 'ldmxc'
+                  if (mnemonic[5] == 's') { // 'ldmxcs'
+                    if (mnemonic[6] == 'r') { // 'ldmxcsr'
+                      mnemonic = "Ldmxcsr";
+                    }
+                  }
+                }
+              }
+            }
+          }
+        break;}
+        case 'p': { // 'p'
+          switch (mnemonic[1]) {
+            case 'a': { // 'pa'
+              if (mnemonic[2] == 'd') { // 'pad'
+                if (mnemonic[3] == 'd') { // 'padd'
+                  if (mnemonic[4] == 'u') { // 'paddu'
+                    if (mnemonic[5] == 's') { // 'paddus'
+                      switch (mnemonic[6]) {
+                        case 'b': { // 'paddusb'
+                          mnemonic = "Paddus";
+                        break;}
+                        case 'w': { // 'paddusw'
+                          mnemonic = "Paddus";
+                        break;}
+                        default: break;
+                      }
+                    }
+                  }
+                }
+              }
+            break;}
+            case 'c': { // 'pc'
+              if (mnemonic[2] == 'm') { // 'pcm'
+                if (mnemonic[3] == 'p') { // 'pcmp'
+                  if (mnemonic[4] == 'e') { // 'pcmpe'
+                    if (mnemonic[5] == 'q') { // 'pcmpeq'
+                      switch (mnemonic[6]) {
+                        case 'b': { // 'pcmpeqb'
+                          mnemonic = "Pcmpeq";
+                        break;}
+                        case 'd': { // 'pcmpeqd'
+                          mnemonic = "Pcmpeq";
+                        break;}
+                        case 'w': { // 'pcmpeqw'
+                          mnemonic = "Pcmpeq";
+                        break;}
+                        default: break;
+                      }
+                    }
+                  }
+                }
+              }
+            break;}
+            case 's': { // 'ps'
+              if (mnemonic[2] == 'u') { // 'psu'
+                if (mnemonic[3] == 'b') { // 'psub'
+                  if (mnemonic[4] == 'u') { // 'psubu'
+                    if (mnemonic[5] == 's') { // 'psubus'
+                      switch (mnemonic[6]) {
+                        case 'b': { // 'psubusb'
+                          mnemonic = "Psubus";
+                        break;}
+                        case 'w': { // 'psubusw'
+                          mnemonic = "Psubus";
+                        break;}
+                        default: break;
+                      }
+                    }
+                  }
+                }
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 's': { // 's'
+          if (mnemonic[1] == 't') { // 'st'
+            if (mnemonic[2] == 'm') { // 'stm'
+              if (mnemonic[3] == 'x') { // 'stmx'
+                if (mnemonic[4] == 'c') { // 'stmxc'
+                  if (mnemonic[5] == 's') { // 'stmxcs'
+                    if (mnemonic[6] == 'r') { // 'stmxcsr'
+                      mnemonic = "Stmxcsr";
+                    }
+                  }
+                }
+              }
+            }
+          }
+        break;}
+        case 'u': { // 'u'
+          if (mnemonic[1] == 'c') { // 'uc'
+            if (mnemonic[2] == 'o') { // 'uco'
+              if (mnemonic[3] == 'm') { // 'ucom'
+                if (mnemonic[4] == 'i') { // 'ucomi'
+                  if (mnemonic[5] == 's') { // 'ucomis'
+                    switch (mnemonic[6]) {
+                      case 'd': { // 'ucomisd'
+                        mnemonic = "Ucomisd";
+                      break;}
+                      case 's': { // 'ucomiss'
+                        mnemonic = "Ucomiss";
+                      break;}
+                      default: break;
+                    }
+                  }
+                }
+              }
+            }
+          }
+        break;}
+        default: break;
+      }
+    break;
+    case 9:
+      if (mnemonic[0] == 'c') { // 'c'
+        if (mnemonic[1] == 'm') { // 'cm'
+          if (mnemonic[2] == 'p') { // 'cmp'
+            if (mnemonic[3] == 'x') { // 'cmpx'
+              if (mnemonic[4] == 'c') { // 'cmpxc'
+                if (mnemonic[5] == 'h') { // 'cmpxch'
+                  if (mnemonic[6] == 'g') { // 'cmpxchg'
+                    if (mnemonic[7] == '8') { // 'cmpxchg8'
+                      if (mnemonic[8] == 'b') { // 'cmpxchg8b'
+                        mnemonic = "Cmpxchg8b";
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    break;
+    default: break;
+  }
+}
 SgAsmArmInstruction* createArmInstruction(uint64_t address, const std::string& mnemonic) {
   SgAsmArmInstruction* insn = new SgAsmArmInstruction(address, mnemonic, arm_unknown_instruction);
   switch (mnemonic.size()) {
@@ -2826,3 +5402,246 @@
   }
   return insn;
 }
+void normalizeArmMnemonic(std::string& mnemonic) {
+  switch (mnemonic.size()) {
+    case 1:
+      if (mnemonic[0] == 'b') { // 'b'
+        mnemonic = "B";
+      }
+    break;
+    case 2:
+      if (mnemonic[0] == 'b') { // 'b'
+        switch (mnemonic[1]) {
+          case 'l': { // 'bl'
+            mnemonic = "Bl";
+          break;}
+          case 'x': { // 'bx'
+            mnemonic = "Bx";
+          break;}
+          default: break;
+        }
+      }
+    break;
+    case 3:
+      switch (mnemonic[0]) {
+        case 'a': { // 'a'
+          switch (mnemonic[1]) {
+            case 'd': { // 'ad'
+              switch (mnemonic[2]) {
+                case 'c': { // 'adc'
+                  mnemonic = "Adc";
+                break;}
+                case 'd': { // 'add'
+                  mnemonic = "Add";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'n': { // 'an'
+              if (mnemonic[2] == 'd') { // 'and'
+                mnemonic = "And";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'b': { // 'b'
+          if (mnemonic[1] == 'i') { // 'bi'
+            if (mnemonic[2] == 'c') { // 'bic'
+              mnemonic = "Bic";
+            }
+          }
+        break;}
+        case 'c': { // 'c'
+          if (mnemonic[1] == 'm') { // 'cm'
+            switch (mnemonic[2]) {
+              case 'n': { // 'cmn'
+                mnemonic = "Cmn";
+              break;}
+              case 'p': { // 'cmp'
+                mnemonic = "Cmp";
+              break;}
+              default: break;
+            }
+          }
+        break;}
+        case 'e': { // 'e'
+          if (mnemonic[1] == 'o') { // 'eo'
+            if (mnemonic[2] == 'r') { // 'eor'
+              mnemonic = "Eor";
+            }
+          }
+        break;}
+        case 'l': { // 'l'
+          if (mnemonic[1] == 'd') { // 'ld'
+            switch (mnemonic[2]) {
+              case 'm': { // 'ldm'
+                mnemonic = "Ldm";
+              break;}
+              case 'r': { // 'ldr'
+                mnemonic = "Ldr";
+              break;}
+              default: break;
+            }
+          }
+        break;}
+        case 'm': { // 'm'
+          switch (mnemonic[1]) {
+            case 'l': { // 'ml'
+              if (mnemonic[2] == 'a') { // 'mla'
+                mnemonic = "Mla";
+              }
+            break;}
+            case 'o': { // 'mo'
+              if (mnemonic[2] == 'v') { // 'mov'
+                mnemonic = "Mov";
+              }
+            break;}
+            case 'r': { // 'mr'
+              if (mnemonic[2] == 's') { // 'mrs'
+                mnemonic = "Mrs";
+              }
+            break;}
+            case 's': { // 'ms'
+              if (mnemonic[2] == 'r') { // 'msr'
+                mnemonic = "Msr";
+              }
+            break;}
+            case 'u': { // 'mu'
+              if (mnemonic[2] == 'l') { // 'mul'
+                mnemonic = "Mul";
+              }
+            break;}
+            case 'v': { // 'mv'
+              if (mnemonic[2] == 'n') { // 'mvn'
+                mnemonic = "Mvn";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 'o': { // 'o'
+          if (mnemonic[1] == 'r') { // 'or'
+            if (mnemonic[2] == 'r') { // 'orr'
+              mnemonic = "Orr";
+            }
+          }
+        break;}
+        case 'r': { // 'r'
+          if (mnemonic[1] == 's') { // 'rs'
+            switch (mnemonic[2]) {
+              case 'b': { // 'rsb'
+                mnemonic = "Rsb";
+              break;}
+              case 'c': { // 'rsc'
+                mnemonic = "Rsc";
+              break;}
+              default: break;
+            }
+          }
+        break;}
+        case 's': { // 's'
+          switch (mnemonic[1]) {
+            case 'b': { // 'sb'
+              if (mnemonic[2] == 'c') { // 'sbc'
+                mnemonic = "Sbc";
+              }
+            break;}
+            case 't': { // 'st'
+              switch (mnemonic[2]) {
+                case 'm': { // 'stm'
+                  mnemonic = "Stm";
+                break;}
+                case 'r': { // 'str'
+                  mnemonic = "Str";
+                break;}
+                default: break;
+              }
+            break;}
+            case 'u': { // 'su'
+              if (mnemonic[2] == 'b') { // 'sub'
+                mnemonic = "Sub";
+              }
+            break;}
+            case 'w': { // 'sw'
+              switch (mnemonic[2]) {
+                case 'i': { // 'swi'
+                  mnemonic = "Swi";
+                break;}
+                case 'p': { // 'swp'
+                  mnemonic = "Swp";
+                break;}
+                default: break;
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        case 't': { // 't'
+          switch (mnemonic[1]) {
+            case 'e': { // 'te'
+              if (mnemonic[2] == 'q') { // 'teq'
+                mnemonic = "Teq";
+              }
+            break;}
+            case 's': { // 'ts'
+              if (mnemonic[2] == 't') { // 'tst'
+                mnemonic = "Tst";
+              }
+            break;}
+            default: break;
+          }
+        break;}
+        default: break;
+      }
+    break;
+    case 5:
+      switch (mnemonic[0]) {
+        case 's': { // 's'
+          if (mnemonic[1] == 'm') { // 'sm'
+            switch (mnemonic[2]) {
+              case 'l': { // 'sml'
+                if (mnemonic[3] == 'a') { // 'smla'
+                  if (mnemonic[4] == 'l') { // 'smlal'
+                    mnemonic = "Smlal";
+                  }
+                }
+              break;}
+              case 'u': { // 'smu'
+                if (mnemonic[3] == 'l') { // 'smul'
+                  if (mnemonic[4] == 'l') { // 'smull'
+                    mnemonic = "Smull";
+                  }
+                }
+              break;}
+              default: break;
+            }
+          }
+        break;}
+        case 'u': { // 'u'
+          if (mnemonic[1] == 'm') { // 'um'
+            switch (mnemonic[2]) {
+              case 'l': { // 'uml'
+                if (mnemonic[3] == 'a') { // 'umla'
+                  if (mnemonic[4] == 'l') { // 'umlal'
+                    mnemonic = "Umlal";
+                  }
+                }
+              break;}
+              case 'u': { // 'umu'
+                if (mnemonic[3] == 'l') { // 'umul'
+                  if (mnemonic[4] == 'l') { // 'umull'
+                    mnemonic = "Umull";
+                  }
+                }
+              break;}
+              default: break;
+            }
+          }
+        break;}
+        default: break;
+      }
+    break;
+    default: break;
+  }
+}

Modified: branches/rice/src/frontend/BinaryDisassembly/make-decision-tree.tcl
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/make-decision-tree.tcl	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/make-decision-tree.tcl	2008-11-11 22:06:33 UTC (rev 119)
@@ -71,6 +71,85 @@
   puts $outFile "}"
 }
 
+
+##BEGIN SUPPORT FOR STRING MNEMONIC NORMALIZATION
+##AS(10/04/08) This is necessary for the work where we compare 
+##the output of ROSE with the output of IDA Pro. 
+
+proc doLeafNormalize {insn platform} {
+  global astNode$platform
+  if {[info exists astNode${platform}($insn)]} {
+    return [format "mnemonic = \"[set astNode${platform}($insn)]\";"]
+  } else {
+    return [format ";"]
+  }
+}
+
+proc makeSwitchNormalize {len prefix platform outFile indent} {
+  global astNode$platform
+  set offset [string length $prefix]
+  if {$offset == $len} {puts $outFile "${indent}[doLeafNormalize $prefix $platform]"; return}
+  foreach str [array names astNode$platform] {
+    if {[string range $str 0 [expr {$offset - 1}]] != $prefix} {continue}
+    if {[string length $str] != $len} {continue}
+    set c [string index $str $offset]
+    if {$c == ""} {continue}
+    lappend firstChar($c) $str
+  }
+  if {[array size firstChar] == 0} {
+    error "Bad prefix '$prefix' for length $len"
+  } elseif {[array size firstChar] == 1} {
+    puts $outFile "${indent}if (mnemonic\[$offset\] == '$c') { // '$prefix$c'"
+    makeSwitchNormalize $len "$prefix$c" $platform $outFile "${indent}  "
+    puts $outFile "${indent}}"
+  } else {
+    puts $outFile "${indent}switch (mnemonic\[$offset\]) {"
+    foreach c [lsort [array names firstChar]] {
+      puts $outFile "${indent}  case '$c': { // '$prefix$c'"
+      makeSwitchNormalize $len "$prefix$c" $platform $outFile "${indent}    "
+      puts $outFile "${indent}  break;}"
+    }
+    puts $outFile "${indent}  default: break;"
+    puts $outFile "${indent}}"
+  }
+}
+
+
+proc makeSwitchForLanguageNormalizeToString {platform outFile} {
+  global astNode$platform
+  set instructionTable [open "RoseBin_instruction_table_[string tolower $platform]" r]
+  while {1} {
+    set line [split [gets $instructionTable] " "]
+    if {[eof $instructionTable]} {break}
+    if {[lindex $line end-1] != "->"} {error "Incorrect line format: should be mnemonic ... -> AstNodeName" line}
+    foreach mnemonic [lrange $line 0 end-2] {
+      set astNode${platform}($mnemonic) [lindex $line end]
+    }
+  }
+  close $instructionTable
+
+  foreach mnemonic [array names astNode$platform] {
+    set byLength([string length $mnemonic]) x
+  }
+
+  puts $outFile "void normalize${platform}Mnemonic(std::string& mnemonic) {"
+  #puts $outFile "  std::string returnMnemonic = \"unknown_instruction\";"
+  puts $outFile "  switch (mnemonic.size()) {"
+  foreach len [lsort -integer [array names byLength]] {
+    puts $outFile "    case $len:"
+    makeSwitchNormalize $len "" $platform $outFile "      "
+    puts $outFile "    break;"
+  }
+  puts $outFile "    default: break;"
+  puts $outFile "  }"
+  #puts $outFile "  return returnMnemonic;"
+  puts $outFile "}"
+}
+
+## END CODE FOR SUPPORTING NORMALIZATION OF MNEMONICS
+
+
+
 set outFile [open "instructionDispatch.cpp" w]
 puts $outFile "#include \"rose.h\""
 puts $outFile "#include <stdint.h>"
@@ -79,5 +158,10 @@
 puts $outFile "// ************************************"
 foreach platform {x86 Arm} {
   makeSwitchForLanguage $platform $outFile
+
+  ##Call code for generation the function to normalize mnemnoic strings
+  ##necessary for work which compares ROSE disassembler with IDA Pro.
+  makeSwitchForLanguageNormalizeToString $platform $outFile
+
 }
 close $outFile

Modified: branches/rice/src/frontend/BinaryDisassembly/powerpcInstructionEnum.h
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/powerpcInstructionEnum.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/powerpcInstructionEnum.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -154,12 +154,91 @@
      powerpc_fnmsub_record, // Floating Negative Multiply-Subtract 
      powerpc_fnmsubs, // Floating Negative Multiply-Subtract Single 
      powerpc_fnmsubs_record, // Floating Negative Multiply-Subtract Single 
+
+  // DQ (11/1/2008): Added PowerPC 440 BGL (Double Hummer) specific floating point instructions.
+     powerpc_fpmul,  // FP2 Floating Parallel Multiply (BGL specific)
+     powerpc_fxmul,  // FP2 Floating Cross Multiply (BGL specific)
+     powerpc_fxpmul, // FP2 Floating Cross Copy-Primary Multiply (BGL specific)
+     powerpc_fxsmul, // FP2 Floating Cross Copy-Secondary Multiply (BGL specific)
+     powerpc_fpadd,  // FP2 Floating Parallel Add (BGL specific)
+     powerpc_fpsub,  // FP2 Floating Parallel Subtract (BGL specific)
+     powerpc_fpre,   // FP2 Floating Parallel Reciprocal Estimate (BGL specific)
+     powerpc_fprsqrte, // FP2 Floating Parallel Reciprocal Square Root Estimate (BGL specific)
+     powerpc_fpmr,
+     powerpc_fpabs,
+     powerpc_lfssx,
+     powerpc_fpneg,
+     powerpc_lfssux,
+     powerpc_fprsp,
+     powerpc_lfsdx,
+     powerpc_fpnabs,
+     powerpc_lfsdux,
+     powerpc_lfxsx,
+     powerpc_fsmr,
+     powerpc_lfxsux,
+     powerpc_lfxdx,
+     powerpc_fsabs,
+     powerpc_lfxdux,
+     powerpc_lfpsx,
+     powerpc_fsneg,
+     powerpc_lfpsux,
+     powerpc_lfpdx,
+     powerpc_fsnabs,
+     powerpc_lfpdux,
+     powerpc_stfpiwx,
+     powerpc_fxmr,
+     powerpc_fpctiw,
+     powerpc_stfssx,
+     powerpc_stfssux,
+     powerpc_fpctiwz,
+     powerpc_stfsdx,
+     powerpc_stfsdux,
+     powerpc_stfxsx,
+     powerpc_fsmtp,
+     powerpc_stfxsux,
+     powerpc_stfxdx,
+     powerpc_stfxdux,
+     powerpc_stfpsx,
+     powerpc_fsmfp,
+     powerpc_stfpsux,
+     powerpc_stfpdx,
+     powerpc_stfpdux,
+     powerpc_fpsel,
+     powerpc_fpmadd,
+     powerpc_fpmsub,
+     powerpc_fxmadd,
+     powerpc_fxcpmadd,
+     powerpc_fxcsmadd,
+     powerpc_fpnmadd,
+     powerpc_fxnmadd,
+     powerpc_fxcpnmadd,
+     powerpc_fxcsnmadd,
+     powerpc_fxcpnpma,
+     powerpc_fxmsub,
+     powerpc_fxcsnpma,
+     powerpc_fxcpmsub,
+     powerpc_fxcpnsma,
+     powerpc_fxcsmsub,
+     powerpc_fxcsnsma,
+     powerpc_fpnmsub,
+     powerpc_fxcxma,
+     powerpc_fxnmsub,
+     powerpc_fxcxnpma,
+     powerpc_fxcpnmsub,
+     powerpc_fxcxnsma,
+     powerpc_fxcsnmsub,
+     powerpc_fxcxnms,
+
+     powerpc_fre, // Floating Reciprocal Estimate Single (optional) 
+     powerpc_fre_record, // Floating Reciprocal Estimate Single (optional) 
      powerpc_fres, // Floating Reciprocal Estimate Single (optional) 
      powerpc_fres_record, // Floating Reciprocal Estimate Single (optional) 
      powerpc_frsp, // Floating Round to Single Precision 
      powerpc_frsp_record, // Floating Round to Single Precision 
      powerpc_frsqrte, // Floating Reciprocal Square Root Estimate (optional) 
      powerpc_frsqrte_record, // Floating Reciprocal Square Root Estimate (optional) 
+     powerpc_frsqrtes, // Floating Reciprocal Square Root Estimate (optional) 
+     powerpc_frsqrtes_record, // Floating Reciprocal Square Root Estimate (optional) 
      powerpc_fsel, // Floating-Point Select (optional) 
      powerpc_fsel_record, // Floating-Point Select (optional) 
      powerpc_fsqrt, // Floating-Point Square Root (optional)

Modified: branches/rice/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -148,12 +148,91 @@
 "powerpc_fnmsub.",
 "powerpc_fnmsubs",
 "powerpc_fnmsubs.",
+"",
+"",
+"powerpc_fpmul",
+"powerpc_fxmul",
+"powerpc_fxpmul",
+"powerpc_fxsmul",
+"powerpc_fpadd",
+"powerpc_fpsub",
+"powerpc_fpre",
+"powerpc_fprsqrte",
+"powerpc_fpmr",
+"powerpc_fpabs",
+"powerpc_lfssx",
+"powerpc_fpneg",
+"powerpc_lfssux",
+"powerpc_fprsp",
+"powerpc_lfsdx",
+"powerpc_fpnabs",
+"powerpc_lfsdux",
+"powerpc_lfxsx",
+"powerpc_fsmr",
+"powerpc_lfxsux",
+"powerpc_lfxdx",
+"powerpc_fsabs",
+"powerpc_lfxdux",
+"powerpc_lfpsx",
+"powerpc_fsneg",
+"powerpc_lfpsux",
+"powerpc_lfpdx",
+"powerpc_fsnabs",
+"powerpc_lfpdux",
+"powerpc_stfpiwx",
+"powerpc_fxmr",
+"powerpc_fpctiw",
+"powerpc_stfssx",
+"powerpc_stfssux",
+"powerpc_fpctiwz",
+"powerpc_stfsdx",
+"powerpc_stfsdux",
+"powerpc_stfxsx",
+"powerpc_fsmtp",
+"powerpc_stfxsux",
+"powerpc_stfxdx",
+"powerpc_stfxdux",
+"powerpc_stfpsx",
+"powerpc_fsmfp",
+"powerpc_stfpsux",
+"powerpc_stfpdx",
+"powerpc_stfpdux",
+"powerpc_fpsel",
+"powerpc_fpmadd",
+"powerpc_fpmsub",
+"powerpc_fxmadd",
+"powerpc_fxcpmadd",
+"powerpc_fxcsmadd",
+"powerpc_fpnmadd",
+"powerpc_fxnmadd",
+"powerpc_fxcpnmadd",
+"powerpc_fxcsnmadd",
+"powerpc_fxcpnpma",
+"powerpc_fxmsub",
+"powerpc_fxcsnpma",
+"powerpc_fxcpmsub",
+"powerpc_fxcpnsma",
+"powerpc_fxcsmsub",
+"powerpc_fxcsnsma",
+"powerpc_fpnmsub",
+"powerpc_fxcxma",
+"powerpc_fxnmsub",
+"powerpc_fxcxnpma",
+"powerpc_fxcpnmsub",
+"powerpc_fxcxnsma",
+"powerpc_fxcsnmsub",
+"powerpc_fxcxnms",
+"",
+"powerpc_fre",
+"powerpc_fre.",
 "powerpc_fres",
 "powerpc_fres.",
 "powerpc_frsp",
 "powerpc_frsp.",
 "powerpc_frsqrte",
 "powerpc_frsqrte.",
+"powerpc_frsqrtes",
+"powerpc_frsqrtes.",
 "powerpc_fsel",
 "powerpc_fsel.",
 "powerpc_fsqrt",

Modified: branches/rice/src/frontend/BinaryDisassembly/readTicl.C
===================================================================
--- branches/rice/src/frontend/BinaryDisassembly/readTicl.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/BinaryDisassembly/readTicl.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,6 +1,9 @@
 #include "readTicl.h"
 #include <string.h>
 
+
+
+
 using namespace ticl;
 
 #define FILL_IN_STRUCT(STRUCT_NAME,FORMAT, FILENAME)			\
@@ -118,8 +121,8 @@
 void ticl::get_instructions_1(std::string directory, vector<instructions_1>& vec_STRUCT)
 {
 #define ARGS_instructions_1  &elem_instructions_1->address, &elem_instructions_1->basic_block_id, &elem_instructions_1->mnemonic, \
-    &elem_instructions_1->sequence
-  FILL_IN_STRUCT(instructions_1, "ssss","instructions_1.tsv");
+    &elem_instructions_1->sequence, &elem_instructions_1->data
+  FILL_IN_STRUCT(instructions_1, "sssss","instructions_1.tsv");
 };
 
 void ticl::get_callgraph_1(std::string directory, vector<callgraph_1>& vec_STRUCT)
@@ -189,3 +192,5 @@
 
 
 
+
+

Modified: branches/rice/src/frontend/CxxFrontend/Makefile.am
===================================================================
--- branches/rice/src/frontend/CxxFrontend/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/CxxFrontend/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -20,4 +20,4 @@
 clean-local:
 	-rm -rf .libs/
 
-EXTRA_DIST = roseBinaryEDG-i686-apple-darwin9.5.0-a0cac5c137a2be0e2ce8fb85a561050f.tar.gz roseBinaryEDG-i686-pc-linux-gnu-a0cac5c137a2be0e2ce8fb85a561050f.tar.gz roseBinaryEDG-x86_64-pc-linux-gnu-a0cac5c137a2be0e2ce8fb85a561050f.tar.gz
+EXTRA_DIST = roseBinaryEDG-i686-apple-darwin9.5.0-b0847234cb4f3e1afaefa965207df2c0.tar.gz roseBinaryEDG-i686-pc-linux-gnu-b0847234cb4f3e1afaefa965207df2c0.tar.gz roseBinaryEDG-x86_64-pc-linux-gnu-b0847234cb4f3e1afaefa965207df2c0.tar.gz

Deleted: branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-i686-apple-darwin9.5.0-a0cac5c137a2be0e2ce8fb85a561050f.tar.gz
===================================================================
(Binary files differ)

Copied: branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-i686-apple-darwin9.5.0-b0847234cb4f3e1afaefa965207df2c0.tar.gz (from rev 117, trunk/src/frontend/CxxFrontend/roseBinaryEDG-i686-apple-darwin9.5.0-b0847234cb4f3e1afaefa965207df2c0.tar.gz)
===================================================================
(Binary files differ)

Deleted: branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-i686-pc-linux-gnu-a0cac5c137a2be0e2ce8fb85a561050f.tar.gz
===================================================================
(Binary files differ)

Copied: branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-i686-pc-linux-gnu-b0847234cb4f3e1afaefa965207df2c0.tar.gz (from rev 117, trunk/src/frontend/CxxFrontend/roseBinaryEDG-i686-pc-linux-gnu-b0847234cb4f3e1afaefa965207df2c0.tar.gz)
===================================================================
(Binary files differ)

Deleted: branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-x86_64-pc-linux-gnu-a0cac5c137a2be0e2ce8fb85a561050f.tar.gz
===================================================================
(Binary files differ)

Copied: branches/rice/src/frontend/CxxFrontend/roseBinaryEDG-x86_64-pc-linux-gnu-b0847234cb4f3e1afaefa965207df2c0.tar.gz (from rev 117, trunk/src/frontend/CxxFrontend/roseBinaryEDG-x86_64-pc-linux-gnu-b0847234cb4f3e1afaefa965207df2c0.tar.gz)
===================================================================
(Binary files differ)

Modified: branches/rice/src/frontend/Disassemblers/disassemblerCommon.C
===================================================================
--- branches/rice/src/frontend/Disassemblers/disassemblerCommon.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/Disassemblers/disassemblerCommon.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -192,7 +192,7 @@
     } else if (isa == SgAsmExecutableFileFormat::ISA_PowerPC) {
 
    // DQ (10/12/2008): Added support for PowerPC.
-      PowerpcDisassembler::Parameters params(addr, true);
+      PowerpcDisassembler::Parameters params(addr);
 
    // printf ("Initial file starting address (entry point) = %p  file size = %zu  fileOffset = %zu \n",&(file->content()[0]),file->get_orig_size(),fileOffset);
 

Modified: branches/rice/src/frontend/Disassemblers/disassemblers.h
===================================================================
--- branches/rice/src/frontend/Disassemblers/disassemblers.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/Disassemblers/disassemblers.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -68,9 +68,9 @@
    {
      struct Parameters
         {
-          uint32_t ip;
+          uint64_t ip;
           bool decodeUnconditionalInstructions;
-          Parameters(uint32_t ip = 0, bool decodeUnconditionalInstructions = true): ip(ip), decodeUnconditionalInstructions(decodeUnconditionalInstructions) {}
+          Parameters(uint64_t ip = 0): ip(ip) {}
         };
 
   // SgAsmPowerpcRegisterReferenceExpression* makeRegister(uint8_t reg);

Modified: branches/rice/src/frontend/Disassemblers/powerpcDisassembler.C
===================================================================
--- branches/rice/src/frontend/Disassemblers/powerpcDisassembler.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/Disassemblers/powerpcDisassembler.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -5,6 +5,8 @@
 #include <vector>
 #include "rose.h"
 
+#include "integerOps.h"
+
 using namespace std;
 using namespace SageBuilderAsm;
 
@@ -46,10 +48,10 @@
           SgAsmPowerpcInstruction* decode_MD_formInstruction();
           SgAsmPowerpcInstruction* decode_MDS_formInstruction();
 
-          SgAsmDoubleWordValueExpression* makeBranchTarget( uint32_t targetAddr ) const;
+          SgAsmQuadWordValueExpression* makeBranchTarget( uint64_t targetAddr ) const;
         };
 
-     SgAsmPowerpcInstruction* makeInstructionWithoutOperands(uint32_t address, const std::string& mnemonic, PowerpcInstructionKind kind, uint32_t insn);
+     SgAsmPowerpcInstruction* makeInstructionWithoutOperands(uint64_t address, const std::string& mnemonic, PowerpcInstructionKind kind, uint32_t insn);
 
   // SgAsmPowerpcRegisterReferenceExpression* makeRegister(uint8_t reg);
      SgAsmPowerpcRegisterReferenceExpression* makeRegister(PowerpcRegisterClass reg_class, int reg_number, PowerpcConditionRegisterAccessGranularity reg_grainularity = powerpc_condreggranularity_whole );
@@ -69,8 +71,8 @@
 #define MAKE_INSN4(Mne, Op1, Op2, Op3, Op4) (appendOperand(MAKE_INSN3(Mne, Op1, Op2, Op3), (Op4)))
 #define MAKE_INSN5(Mne, Op1, Op2, Op3, Op4, Op5) (appendOperand(MAKE_INSN4(Mne, Op1, Op2, Op3, Op4), (Op5)))
 
-SgAsmDoubleWordValueExpression*
-PowerpcDisassembler::SingleInstructionDisassembler::makeBranchTarget ( uint32_t targetAddr ) const
+SgAsmQuadWordValueExpression*
+PowerpcDisassembler::SingleInstructionDisassembler::makeBranchTarget ( uint64_t targetAddr ) const
    {
   // int32_t val = insn & 0xFFFFFF;
   // val <<= 8;
@@ -83,7 +85,7 @@
 #endif
 
      if (knownSuccessorsReturn) knownSuccessorsReturn->insert(targetAddr);
-     return makeDWordValue(targetAddr);
+     return makeQWordValue(targetAddr);
    }
 
 bool
@@ -94,7 +96,7 @@
    }
 
 SgAsmPowerpcInstruction*
-PowerpcDisassembler::makeInstructionWithoutOperands(uint32_t address, const std::string& mnemonic, PowerpcInstructionKind kind, uint32_t insn)
+PowerpcDisassembler::makeInstructionWithoutOperands(uint64_t address, const std::string& mnemonic, PowerpcInstructionKind kind, uint32_t insn)
    {
   // Constructor: SgAsmPowerpcInstruction(rose_addr_t address = 0, std::string mnemonic = "", PowerpcInstructionKind kind = powerpc_unknown_instruction);
      SgAsmPowerpcInstruction* instruction = new SgAsmPowerpcInstruction(address, mnemonic, kind);
@@ -163,6 +165,8 @@
   // Added this to get pass zero instruction (padding?)
      if (c == 0)
         {
+       // DQ (11/1/2008): This case generates a lot of calls to the BadInstruction() handler! Why?
+
 #if DEBUG_OPCODES
           printf ("####### In PowerpcDisassembler::disassemble(): Return NULL pointer for case of c == 0 ####### \n");
 #endif
@@ -201,14 +205,38 @@
    // Handle all the different legal Primary Opcode values
      switch (primaryOpcode)
         {
-#if 0
-          case 0x00:
+       // 0 : These are the BGL specific PowerPC440 FP2 Architecture instructions
+           case 0x00: // { instruction = decode_A_formInstruction(); break; }
+             {
+            // Depending on if this is A form or X form, the extended opCode maps to different bit ranges, so this code is incorrect!
+            // uint16_t x_Opcode   = (insn >> 1) & 0x3FF;
+               uint8_t  a_Opcode   = (insn >> 1) & 0x1F;
+
+            // printf ("x_Opcode = 0x%x = %d xfl_Opcode = 0x%x = %d a_Opcode = 0x%x = %d \n",x_Opcode,x_Opcode,xfl_Opcode,xfl_Opcode,a_Opcode,a_Opcode);
+
+            // Different parts of the instruction are used to identify what kind of instruction this is!
+               if (  a_Opcode == 5 || (a_Opcode >= 8 && a_Opcode <= 31) )
+                  {
+                    instruction = decode_A_formInstruction();
+                  }
+                 else
+                  {
+                    instruction = decode_X_formInstruction();
+                  }
+
+               ROSE_ASSERT(instruction != NULL);
+               break;
+             }
+
+#if 1
           case 0x01: { /* illegal instruction */ ROSE_ASSERT(false); break; }
 #endif
           case 0x02: { instruction = decode_D_formInstruction(); break; }
           case 0x03: { instruction = decode_D_formInstruction(); break; }
 
-          case 0x04: 
+       // 4 : These are the BGL specific PowerPC440 FP2 Architecture instructions
+          case 0x04: { instruction = decode_A_formInstruction(); break; }
+
           case 0x05: 
           case 0x06: { /* illegal instruction */ ROSE_ASSERT(false); break; }
 
@@ -333,9 +361,10 @@
        // 58
           case 0x3A: { instruction = decode_DS_formInstruction(); break; }
 
+       // 59
           case 0x3B: { instruction = decode_A_formInstruction(); break; }
 
-       // 60
+       // 60, 61
           case 0x3C: 
           case 0x3D: { /* illeagal instruction */ ROSE_ASSERT(false); break; }
 
@@ -378,8 +407,8 @@
             // The default case is now used for handling illegal instructions 
             // (during development it was for those not yet implemented).
                printf ("Primary opcode not handled yet: primaryOpcode = %d \n",primaryOpcode);
-            // ROSE_ASSERT(false);
-               throw BadInstruction();
+               ROSE_ASSERT(false);
+            // throw BadInstruction();
              }
         }
 
@@ -432,7 +461,7 @@
                     targetBranchAddress += p.ip;
                   }
 
-               SgAsmDoubleWordValueExpression* targetAddressExpression = makeBranchTarget(targetBranchAddress);
+               SgAsmQuadWordValueExpression* targetAddressExpression = makeBranchTarget(targetBranchAddress);
                ROSE_ASSERT(knownSuccessorsReturn->empty() == false);
 
                if (aaOpcode == 0)
@@ -490,13 +519,13 @@
 
      uint8_t primaryOpcode = (insn >> 26) & 0x3F;
 
-  // Get bits 6-8, 3 bits as the BF opcode
+  // Get bits 6-10, 5 bits as the BO opcode
      uint8_t boOpcode = (insn >> 21) & 0x1F;
 
   // Get the bits 11-15, next 5 bits, as the tertiary opcode
      uint8_t biOpcode = (insn >> 16) & 0x1F;
 
-  // Get the bits 16-31, next 16 bits, as the tertiary opcode
+  // Get the bits 16-29, next 14 bits, as the tertiary opcode
      uint16_t bdOpcode = (insn >> 2) & 0x3FFF;
 
   // Get bit 30, 1 bit as the reserved flag
@@ -515,11 +544,11 @@
              {
             // Skip the registers for now!
                SgAsmExpression* BO = new SgAsmByteValueExpression(boOpcode);
-               SgAsmExpression* BI = makeRegister(powerpc_regclass_gpr,biOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BI = makeRegister(powerpc_regclass_cr,biOpcode,powerpc_condreggranularity_bit);
 
             // DQ (10/15/2008): Compute the address of the branch to restart the disassembly.
             // The address is BD || 0b00 sign-extended.
-               uint32_t computedAddress = (bdOpcode >= (1U << 13)) ? bdOpcode - (1U << 14) : bdOpcode;
+               uint64_t computedAddress = (bdOpcode >= (1U << 13)) ? bdOpcode - (1U << 14) : bdOpcode;
                computedAddress <<= 2;
 
                uint32_t targetBranchAddress = computedAddress;
@@ -530,7 +559,7 @@
                     targetBranchAddress += p.ip;
                   }
 
-               SgAsmDoubleWordValueExpression* targetAddressExpression = makeBranchTarget(targetBranchAddress);
+               SgAsmQuadWordValueExpression* targetAddressExpression = makeBranchTarget(targetBranchAddress);
                ROSE_ASSERT(knownSuccessorsReturn->empty() == false);
 
                if (lkOpcode == 0)
@@ -623,16 +652,16 @@
      uint8_t raOpcode = (insn >> 16) & 0x1F;
 
   // Get bits 6-8, 3 bits as the BF opcode
-     uint8_t bfOpcode = (insn >> 21) & 0x8;
+     uint8_t bfOpcode = (insn >> 23) & 0x7;
 
   // Get bit 9, 1 bit as the reserved flag
   // uint8_t reservedOpcode = (insn >> 24) & 0x1;
 
   // Get bit 10, 1 bit as the length flag
-     uint8_t lengthOpcode = (insn >> 25) & 0x1;
+     uint8_t lengthOpcode = (insn >> 21) & 0x1;
 
   // Get the bits 16-31, next 16 bits, as the tertiary opcode
-     uint8_t lastOpcode = (insn >> 0) & 0xFFFF;
+     uint16_t lastOpcode = (insn >> 0) & 0xFFFF;
 
 #if DEBUG_OPCODES
   // printf ("D-Form instruction opcode = 0x%x secodaryOpcode = 0x%x bfOpcode = 0x%x reservedOpcode = 0x%x lengthOpcode = 0x%x raOpcode = 0x%x lastOpcode 0x%x \n",insn,secodaryOpcode,bfOpcode,reservedOpcode,lengthOpcode,raOpcode,lastOpcode);
@@ -646,7 +675,8 @@
              {
                SgAsmExpression* TO = makeRegister(powerpc_regclass_gpr,toOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* SI = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                instruction = MAKE_INSN3(tdi,TO,RA,SI);
                break;
              }
@@ -656,7 +686,8 @@
              {
                SgAsmExpression* TO = makeRegister(powerpc_regclass_gpr,toOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* SI = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                instruction = MAKE_INSN3(twi,TO,RA,SI);
                break;
              }
@@ -671,7 +702,8 @@
              {
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,rtOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* SI = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                instruction = MAKE_INSN3(mulli,RT,RA,SI);
                break;
              }
@@ -681,7 +713,8 @@
              {
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* SI = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                instruction = MAKE_INSN3(subfic,RT,RA,SI);
                break;
              }
@@ -692,21 +725,23 @@
        // 10
           case 0x0A:
              {
-               SgAsmExpression* BF = new SgAsmByteValueExpression(bfOpcode);
+                SgAsmExpression* BF = makeRegister(powerpc_regclass_cr,bfOpcode,powerpc_condreggranularity_field);
                SgAsmExpression* L  = new SgAsmByteValueExpression(lengthOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
-               instruction = MAKE_INSN4(cmpl,BF,L,RA,UI);
+            // SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* UI = new SgAsmDoubleWordValueExpression(uint32_t(lastOpcode));
+               instruction = MAKE_INSN4(cmpli,BF,L,RA,UI);
                break;
              }
 
        // 11
           case 0x0B:
              {
-               SgAsmExpression* BF = new SgAsmByteValueExpression(bfOpcode);
+               SgAsmExpression* BF = makeRegister(powerpc_regclass_cr,bfOpcode,powerpc_condreggranularity_field);
                SgAsmExpression* L  = new SgAsmByteValueExpression(lengthOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* SI = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                instruction = MAKE_INSN4(cmpi,BF,L,RA,SI);
                break;
              }
@@ -716,7 +751,8 @@
              {
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,rtOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* SI = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                instruction = MAKE_INSN3(addic,RT,RA,SI);
                break;
              }
@@ -726,7 +762,8 @@
              {
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,rtOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* SI = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                instruction = MAKE_INSN3(addic_record,RT,RA,SI);
                break;
              }
@@ -736,10 +773,12 @@
              {
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
-               SgAsmExpression* addressExpr = makeAdd(RA,D);
-               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
-               instruction = MAKE_INSN2(addi,RT,mr);
+            // SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* SI = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
+            // SgAsmExpression* addressExpr = makeAdd(RA,D);
+            // SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
+            // instruction = MAKE_INSN2(addi,RT,mr);
+               instruction = MAKE_INSN3(addi,RT,RA,SI);
                break;
              }
 
@@ -747,8 +786,13 @@
           case 0x0F:
              {
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
-               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* SI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* RA = raOpcode == 0 ? new SgAsmDoubleWordValueExpression(0) : (SgAsmExpression*) makeRegister(powerpc_regclass_gpr,raOpcode);
+
+            // Compute the signExtended value directly in the disassembly instead of in the emulation.
+            // Computing this to be sign extended is more important for 64-bit mode (which is not currently supported).
+            // The signExtend keeps the same type, so it needs to be cast to a 32 bit value.
+               SgAsmExpression* SI = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
+
                instruction = MAKE_INSN3(addis,RT,RA,SI);
                break;
              }
@@ -758,7 +802,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* UI = new SgAsmDoubleWordValueExpression(uint32_t(lastOpcode));
                instruction = MAKE_INSN3(ori,RS,RA,UI);
                break;
              }
@@ -768,7 +813,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* UI = new SgAsmDoubleWordValueExpression(uint32_t(lastOpcode));
                instruction = MAKE_INSN3(oris,RS,RA,UI);
                break;
              }
@@ -778,7 +824,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* UI = new SgAsmDoubleWordValueExpression(uint32_t(lastOpcode));
                instruction = MAKE_INSN3(xori,RS,RA,UI);
                break;
              }
@@ -788,7 +835,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* UI = new SgAsmDoubleWordValueExpression(uint32_t(lastOpcode));
                instruction = MAKE_INSN3(xoris,RS,RA,UI);
                break;
              }
@@ -798,7 +846,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* UI = new SgAsmDoubleWordValueExpression(uint32_t(lastOpcode));
                instruction = MAKE_INSN3(andi_record,RS,RA,UI);
                break;
              }
@@ -808,7 +857,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* UI = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* UI = new SgAsmDoubleWordValueExpression(uint32_t(lastOpcode));
                instruction = MAKE_INSN3(andis_record,RS,RA,UI);
                break;
              }
@@ -819,9 +869,12 @@
             // The correct form of this instruction is "xxx RT,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
-               SgAsmExpression* addressExpr = makeAdd(RA,D);
-               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
+
+            // Compute the signExtended value directly in the disassembly instead of in the emulation.
+            // The signExtend keeps the same type, so it needs to be cast to a 32 bit value.
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
+               SgAsmExpression* addressExpr = raOpcode == 0 ? D : makeAdd(RA,D);
+               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL,SgAsmTypeDoubleWord::createType());
                instruction = MAKE_INSN2(lwz,RT,mr);
                break;
              }
@@ -832,7 +885,15 @@
             // The correct form of this instruction is "xxx RT,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+
+               if (raOpcode == 0 || raOpcode == secodaryOpcode)
+                  {
+                    printf ("bad instruction: raOpcode == 0 || raOpcode == secodaryOpcode \n");
+                    throw BadInstruction();
+                  }
+
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(lwzu,RT,mr);
@@ -845,9 +906,13 @@
             // The correct form of this instruction is "xxx RT,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
-               SgAsmExpression* addressExpr = makeAdd(RA,D);
-               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
+
+            // Compute the signExtended value directly in the disassembly instead of in the emulation.
+            // The signExtend keeps the same type, so it needs to be cast to a 32 bit value.
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
+               SgAsmExpression* addressExpr = raOpcode == 0 ? D : makeAdd(RA,D);
+               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL,SgAsmTypeDoubleWord::createType());
+
                instruction = MAKE_INSN2(lbz,RT,mr);
                break;
              }
@@ -858,7 +923,8 @@
             // The correct form of this instruction is "xxx RT,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(lbzu,RT,mr);
@@ -870,9 +936,16 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
-               SgAsmExpression* addressExpr = makeAdd(RA,D);
-               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
+
+            // Compute the signExtended value directly in the disassembly instead of in the emulation.
+            // The signExtend keeps the same type, so it needs to be cast to a 32 bit value.
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
+
+            // SgAsmExpression* addressExpr = makeAdd(RA,D);
+               SgAsmExpression* addressExpr = raOpcode == 0 ? D : makeAdd(RA,D);
+
+               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL,SgAsmTypeDoubleWord::createType());
+
                instruction = MAKE_INSN2(stw,RS,mr);
                break;
              }
@@ -880,12 +953,18 @@
        // 37
           case 0x25:
              {
-               SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
+               SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
-               SgAsmExpression* addressExpr = makeAdd(RA,D);
-               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
-               instruction = MAKE_INSN2(stwu,RT,mr);
+
+            // Compute the signExtended value directly in the disassembly instead of in the emulation.
+            // The signExtend keeps the same type, so it needs to be cast to a 32 bit value.
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
+
+            // SgAsmExpression* addressExpr = makeAdd(RA,D);
+               SgAsmExpression* addressExpr = raOpcode == 0 ? D : makeAdd(RA,D);
+
+               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL,SgAsmTypeDoubleWord::createType());
+               instruction = MAKE_INSN2(stwu,RS,mr);
                break;
              }
 
@@ -894,7 +973,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(stb,RS,mr);
@@ -906,7 +986,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(stbu,RS,mr);
@@ -919,7 +1000,8 @@
             // The correct form of this instruction is "xxx RT,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(lhz,RT,mr);
@@ -932,7 +1014,8 @@
             // The correct form of this instruction is "xxx RT,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(lhzu,RT,mr);
@@ -945,7 +1028,8 @@
             // The correct form of this instruction is "xxx RT,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(lha,RT,mr);
@@ -957,10 +1041,11 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
-               instruction = MAKE_INSN2(sth,RS,mr);
+               instruction = MAKE_INSN2(lhau,RS,mr);
                break;
              }
 
@@ -969,8 +1054,11 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
-               SgAsmExpression* addressExpr = makeAdd(RA,D);
+            // SgAsmExpression* D = new SgAsmDoubleWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
+            // SgAsmExpression* addressExpr = makeAdd(RA,D);
+               SgAsmExpression* addressExpr = raOpcode == 0 ? D : makeAdd(RA,D);
+
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(sth,RS,mr);
                break;
@@ -981,7 +1069,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(sthu,RS,mr);
@@ -994,7 +1083,8 @@
             // The correct form of this instruction is "xxx RT,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(lmw,RT,mr);
@@ -1006,7 +1096,8 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(stmw,RS,mr);
@@ -1018,7 +1109,8 @@
              {
                SgAsmExpression* FRT = makeRegister(powerpc_regclass_fpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(lfs,FRT,mr);
@@ -1030,7 +1122,15 @@
              {
                SgAsmExpression* FRT = makeRegister(powerpc_regclass_fpr,secodaryOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D = new SgAsmWordValueExpression(lastOpcode);
+
+               if (raOpcode == 0)
+                  {
+                    printf ("bad instruction: raOpcode == 0 case 0x31 = 49 \n");
+                    throw BadInstruction();
+                  }
+
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(lfsu,FRT,mr);
@@ -1043,20 +1143,43 @@
             // The correct form of this instruction is "xxx FRS,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* FRT = makeRegister(powerpc_regclass_fpr,secodaryOpcode);
                SgAsmExpression* RA  = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(lfd,FRT,mr);
                break;
              }
 
+       // 51
+          case 0x33:
+             {
+            // The correct form of this instruction is "xxx FRS,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_fpr,secodaryOpcode);
+               SgAsmExpression* RA  = makeRegister(powerpc_regclass_gpr,raOpcode);
+            // SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+
+               if (raOpcode == 0)
+                  {
+                    printf ("bad instruction: raOpcode == 0 case 0x33 = 51 \n");
+                    throw BadInstruction();
+                  }
+
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
+               SgAsmExpression* addressExpr = makeAdd(RA,D);
+               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
+               instruction = MAKE_INSN2(lfdu,FRT,mr);
+               break;
+             }
+
        // 52
           case 0x34:
              {
             // The correct form of this instruction is "xxx FRS,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* FRS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA  = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(stfs,FRS,mr);
@@ -1069,7 +1192,8 @@
             // The correct form of this instruction is "xxx FRS,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* FRS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA  = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(stfsu,FRS,mr);
@@ -1082,7 +1206,8 @@
             // The correct form of this instruction is "xxx FRS,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* FRS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA  = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(stfd,FRS,mr);
@@ -1095,7 +1220,8 @@
             // The correct form of this instruction is "xxx FRS,D(RA)", so maybe we need a more elaborate way to form "D(RA)" explicitly, perhaps as "(RA) + D".
                SgAsmExpression* FRS = makeRegister(powerpc_regclass_gpr,secodaryOpcode);
                SgAsmExpression* RA  = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+            // SgAsmExpression* D   = new SgAsmWordValueExpression(lastOpcode);
+               SgAsmExpression* D = new SgAsmDoubleWordValueExpression(IntegerOps::signExtend<16,32>(uint32_t(lastOpcode)));
                SgAsmExpression* addressExpr = makeAdd(RA,D);
                SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL);
                instruction = MAKE_INSN2(stfdu,FRS,mr);
@@ -1134,13 +1260,11 @@
   // The primaryOpcode 
      uint8_t primaryOpcode = (insn >> 26) & 0x3F;
 
-  // X-form instructions can be associated with only 2 primary opcodes.
-     ROSE_ASSERT(primaryOpcode == 0x1F || primaryOpcode == 0x3F);
-
   // Get the bits 6-10, next 5 bits
      uint8_t rtOpcode  = (insn >> 21) & 0x1F;
      uint8_t rsOpcode  = rtOpcode;
      uint8_t btOpcode  = rtOpcode;
+     uint8_t toOpcode  = rtOpcode;
 
      uint8_t bfOpcode  = (rtOpcode >> 2) & 0x7;
      uint8_t lOpcode   = (rtOpcode >> 0) & 0x1;
@@ -1148,7 +1272,7 @@
   // Values currently commented out are expected to be used later!
   // uint8_t toOpcode  = rtOpcode;
      uint8_t frtOpcode = rtOpcode;
-  // uint8_t frsOpcode = rtOpcode;
+     uint8_t frsOpcode = rtOpcode;
   // uint8_t boOpcode  = rtOpcode;
 
   // Values currently commented out are expected to be used later!
@@ -1162,6 +1286,8 @@
      uint8_t shOpcode  = rbOpcode;
      uint8_t frbOpcode = rbOpcode;
 
+     uint8_t uOpcode  = (insn >> 12) & 0xF;
+
   // Get the bits 21-30, next 10 bits
      uint16_t xoOpcode = (insn >> 1) & 0x3FF;
 
@@ -1169,9 +1295,12 @@
      uint8_t rcOpcode = (insn >> 0) & 0x1;
 
 #if DEBUG_OPCODES
-     printf ("X-Form instruction opcode = 0x%x xoOpcode = 0x%x \n",insn,xoOpcode);
+     printf ("X-Form instruction opcode = 0x%x primaryOpcode = 0x%x xoOpcode = 0x%x \n",insn,primaryOpcode,xoOpcode);
 #endif
 
+  // X-form instructions can be associated with only 2 primary opcodes (or zero for BGL FP2 instructions).
+     ROSE_ASSERT(primaryOpcode == 0x0 || primaryOpcode == 0x1F || primaryOpcode == 0x3F);
+
      switch(xoOpcode)
         {
        // 0
@@ -1179,7 +1308,7 @@
              {
                if (primaryOpcode == 0x1F)
                   {
-                    SgAsmExpression* BF = makeRegister(powerpc_regclass_gpr,bfOpcode);
+                    SgAsmExpression* BF = makeRegister(powerpc_regclass_cr,bfOpcode,powerpc_condreggranularity_field);
                     SgAsmExpression* L  = new SgAsmByteValueExpression(lOpcode);
                     SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
                     SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
@@ -1188,7 +1317,7 @@
                  else
                   {
                     ROSE_ASSERT(primaryOpcode == 0x3F);
-                    SgAsmExpression* BF = makeRegister(powerpc_regclass_gpr,bfOpcode,powerpc_condreggranularity_bit);
+                    SgAsmExpression* BF = makeRegister(powerpc_regclass_cr,bfOpcode,powerpc_condreggranularity_field);
                     SgAsmExpression* FRA = makeRegister(powerpc_regclass_fpr,fraOpcode);
                     SgAsmExpression* FRB = makeRegister(powerpc_regclass_fpr,frbOpcode);
                     instruction = MAKE_INSN3(fcmpu,BF,FRA,FRB);
@@ -1196,6 +1325,80 @@
                break;
              }
 
+       // 4
+          case 0x4:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* TO = makeRegister(powerpc_regclass_gpr,toOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(tw,TO,RA,RB);
+               break;
+             }
+
+       // 12
+          case 0xC:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x3F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN2(frsp,FRT,FRB);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN2(frsp_record,FRT,FRB);
+                  }
+               break;
+             }
+
+       // 14
+          case 0xE:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x3F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN2(fctiw,FRT,FRB);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN2(fctiw_record,FRT,FRB);
+                  }
+               break;
+             }
+
+       // 15
+          case 0xF:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x3F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN2(fctiwz,FRT,FRB);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN2(fctiwz_record,FRT,FRB);
+                  }
+               break;
+             }
+
+       // 20
+          case 0x14:
+             {
+            // This is a Book II instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* RT = makeRegister(powerpc_regclass_gpr,rtOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(lwarx,RT,RA,RB);
+               break;
+             }
+
        // 21
           case 0x15:
              {
@@ -1292,12 +1495,22 @@
        // 32
           case 0x20:
              {
-               ROSE_ASSERT(primaryOpcode == 0x1F);
-               SgAsmExpression* BF = makeRegister(powerpc_regclass_gpr,bfOpcode);
-               SgAsmExpression* L  = new SgAsmByteValueExpression(lOpcode);
-               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
-               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
-               instruction = MAKE_INSN4(cmpl,BF,L,RA,RB);
+               if (primaryOpcode == 0x1F)
+                  {
+                    ROSE_ASSERT(primaryOpcode == 0x1F);
+                    SgAsmExpression* BF = makeRegister(powerpc_regclass_cr,bfOpcode,powerpc_condreggranularity_field);
+                    SgAsmExpression* L  = new SgAsmByteValueExpression(lOpcode);
+                    SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+                    SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+                    instruction = MAKE_INSN4(cmpl,BF,L,RA,RB);
+                  }
+                 else
+                  {
+                    ROSE_ASSERT(primaryOpcode == 0x0);
+                    SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+                    SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+                    instruction = MAKE_INSN2(fpmr,FRT,FRB);
+                  }
                break;
              }
 
@@ -1317,6 +1530,23 @@
                break;
              }
 
+       // 40
+          case 0x28:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x3F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN2(fneg,FRT,FRB);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN2(fneg_record,FRT,FRB);
+                  }
+               break;
+             }
+
        // 53
           case 0x35:
              {
@@ -1357,6 +1587,17 @@
                break;
              }
 
+       // 68
+          case 0x44:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* TO = makeRegister(powerpc_regclass_gpr,toOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(td,TO,RA,RB);
+               break;
+             }
+
        // 70
           case 0x46:
              {
@@ -1373,6 +1614,23 @@
                break;
              }
 
+       // 72
+          case 0x48:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x3F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN2(fmr,FRT,FRB);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN2(fmr_record,FRT,FRB);
+                  }
+               break;
+             }
+
        // 83
           case 0x53:
              {
@@ -1394,6 +1652,16 @@
                break;
              }
 
+       // 96
+          case 0x60:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fpabs,FRT,FRB);
+               break;
+             }
+
        // 119
           case 0x77:
              {
@@ -1423,6 +1691,54 @@
                break;
              }
 
+       // 134
+          case 0x86:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x3F);
+               SgAsmExpression* BF = makeRegister(powerpc_regclass_cr,bfOpcode,powerpc_condreggranularity_field);
+               SgAsmExpression* U  = new SgAsmByteValueExpression(uOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN2(mtfsfi,BF,U);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN2(mtfsfi_record,BF,U);
+                  }
+               break;
+             }
+
+       // 136
+          case 0x88:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x3F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN2(fnabs,FRT,FRB);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN2(fnabs_record,FRT,FRB);
+                  }
+               break;
+             }
+
+       // 142
+          case 0x8E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfssx,FRT,FRA,FRB);
+               break;
+             }
+
        // 149
           case 0x95:
              {
@@ -1434,6 +1750,17 @@
                break;
              }
 
+       // 150
+          case 0x96:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,rsOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(stwcx_record,RS,RA,RB);
+               break;
+             }
+
        // 151
           case 0x97:
              {
@@ -1445,6 +1772,28 @@
                break;
              }
 
+       // 160
+          case 0xA0:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fpneg,FRT,FRB);
+               break;
+             }
+
+       // 174
+          case 0xAE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfssux,FRT,FRA,FRB);
+               break;
+             }
+
        // 181
           case 0xB5:
              {
@@ -1463,7 +1812,15 @@
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,rsOpcode);
                SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
                SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
-               instruction = MAKE_INSN3(stwux,RS,RA,RB);
+
+            // If raOpcode == 0, this is an illegal instruction
+               ROSE_ASSERT(raOpcode != 0);
+
+               SgAsmExpression* addressExpr = makeAdd(RA,RB);
+
+               SgAsmMemoryReferenceExpression* mr = makeMemoryReference(addressExpr,NULL,SgAsmTypeDoubleWord::createType());
+
+               instruction = MAKE_INSN2(stwux,RS,mr);
                break;
              }
 
@@ -1484,6 +1841,39 @@
                break;
              }
 
+       // 192
+          case 0xC0:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fprsp,FRT,FRB);
+               break;
+             }
+
+       // 206
+          case 0xCE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfsdx,FRT,FRA,FRB);
+               break;
+             }
+
+       // 214
+          case 0xD6:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,rsOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(stdcx_record,RS,RA,RB);
+               break;
+             }
+
        // 215
           case 0xD7:
              {
@@ -1495,6 +1885,28 @@
                break;
              }
 
+       // 224
+          case 0xE0:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fpnabs,FRT,FRB);
+               break;
+             }
+
+       // 238
+          case 0xEE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfsdux,FRT,FRA,FRB);
+               break;
+             }
+
        // 247
           case 0xF7:
              {
@@ -1506,6 +1918,36 @@
                break;
              }
 
+       // 264
+          case 0x108:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x3F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN2(fabs,FRT,FRB);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN2(fabs_record,FRT,FRB);
+                  }
+               break;
+             }
+
+       // 270
+          case 0x10E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfxsx,FRT,FRA,FRB);
+               break;
+             }
+
        // 278
           case 0x116:
              {
@@ -1546,6 +1988,28 @@
                break;
              }
 
+       // 288
+          case 0x120:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fsmr,FRT,FRB);
+               break;
+             }
+
+       // 302
+          case 0x12E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfxsux,FRT,FRA,FRB);
+               break;
+             }
+
        // 311
           case 0x137:
              {
@@ -1575,6 +2039,29 @@
                break;
              }
 
+       // 320
+          case 0x140:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* BF = makeRegister(powerpc_regclass_cr,bfOpcode,powerpc_condreggranularity_field);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lhzux,BF,FRA,FRB);
+               break;
+             }
+
+       // 334
+          case 0x14E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfxdx,FRT,FRA,FRB);
+               break;
+             }
+
        // 341
           case 0x155:
              {
@@ -1597,6 +2084,28 @@
                break;
              }
 
+       // 352
+          case 0x160:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fsabs,FRT,FRB);
+               break;
+             }
+
+       // 366
+          case 0x16E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfxdux,FRT,FRA,FRB);
+               break;
+             }
+
        // 373
           case 0x175:
              {
@@ -1619,6 +2128,18 @@
                break;
              }
 
+       // 398
+          case 0x18E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfpsx,FRT,FRA,FRB);
+               break;
+             }
+
        // 407
           case 0x197:
              {
@@ -1648,6 +2169,28 @@
                break;
              }
 
+       // 416
+          case 0x1A0:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fsneg,FRT,FRB);
+               break;
+             }
+
+       // 430
+          case 0x1AE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfpsux,FRT,FRA,FRB);
+               break;
+             }
+
        // 439
           case 0x1B7:
              {
@@ -1677,6 +2220,18 @@
                break;
              }
 
+       // 462
+          case 0x1CE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfpdx,FRT,FRA,FRB);
+               break;
+             }
+
        // 476
           case 0x1DC:
              {
@@ -1695,6 +2250,40 @@
                break;
              }
 
+       // 480
+          case 0x1E0:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fsnabs,FRT,FRB);
+               break;
+             }
+
+       // 494
+          case 0x1EE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(lfpdux,FRT,FRA,FRB);
+               break;
+             }
+
+       // 526
+          case 0x20E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfpiwx,FRT,FRA,FRB);
+               break;
+             }
+
        // 533
           case 0x215:
              {
@@ -1717,6 +2306,18 @@
                break;
              }
 
+       // 535
+          case 0x217:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(lfsx,FRT,RA,RB);
+               break;
+             }
+
        // 536
           case 0x218:
              {
@@ -1753,6 +2354,28 @@
                break;
              }
 
+       // 544
+          case 0x220:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fxmr,FRT,FRB);
+               break;
+             }
+
+       // 567
+          case 0x237:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(lfsux,FRT,RA,RB);
+               break;
+             }
+
        // 583
           case 0x247:
              {
@@ -1769,6 +2392,16 @@
                break;
              }
 
+       // 576
+          case 0x240:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fpctiw,FRT,FRB);
+               break;
+             }
+
        // 597
           case 0x255:
              {
@@ -1780,6 +2413,42 @@
                break;
              }
 
+       // 599
+          case 0x257:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(lfdx,FRT,RA,RB);
+               break;
+             }
+
+       // 631
+          case 0x277:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(lfdux,FRT,RA,RB);
+               break;
+             }
+
+       // 654
+          case 0x28E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfssx,FRT,FRA,FRB);
+               break;
+             }
+
        // 661
           case 0x295:
              {
@@ -1802,6 +2471,40 @@
                break;
              }
 
+       // 686
+          case 0x2AE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfssux,FRT,FRA,FRB);
+               break;
+             }
+
+       // 704
+          case 0x2C0:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fpctiwz,FRT,FRB);
+               break;
+             }
+
+       // 718
+          case 0x2CE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfsdx,FRT,FRA,FRB);
+               break;
+             }
+
        // 725
            case 0x2D5:
              {
@@ -1813,6 +2516,30 @@
                break;
              }
 
+       // 750
+          case 0x2EE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfsdux,FRT,FRA,FRB);
+               break;
+             }
+
+       // 782
+          case 0x30E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfxsx,FRT,FRA,FRB);
+               break;
+             }
+
        // 790
           case 0x316:
              {
@@ -1860,6 +2587,28 @@
                break;
              }
 
+       // 800
+          case 0x320:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fsmtp,FRT,FRB);
+               break;
+             }
+
+       // 814
+          case 0x32E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfxsux,FRT,FRA,FRB);
+               break;
+             }
+
        // 824
           case 0x338:
              {
@@ -1878,6 +2627,18 @@
                break;
              }
 
+       // 846
+          case 0x34E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfxdx,FRT,FRA,FRB);
+               break;
+             }
+
        // 854
           case 0x356:
              {
@@ -1887,6 +2648,30 @@
                break;
              }
 
+       // 878
+          case 0x36E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfxdux,FRT,FRA,FRB);
+               break;
+             }
+
+       // 910
+          case 0x38E:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfpsx,FRT,FRA,FRB);
+               break;
+             }
+
        // 918
           case 0x396:
              {
@@ -1898,32 +2683,174 @@
                break;
              }
 
+       // 922
+          case 0x39A:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,rsOpcode);
+               SgAsmExpression* SH = new SgAsmByteValueExpression(shOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN3(extsh,RA,RS,SH);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN3(extsh_record,RA,RS,SH);
+                  }
+               break;
+             }
+
+       // 928
+          case 0x3A0:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN2(fsmfp,FRT,FRB);
+               break;
+             }
+
+       // 942
+          case 0x3AE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfpsux,FRT,FRA,FRB);
+               break;
+             }
+
+       // 954
+          case 0x3BA:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,rsOpcode);
+               SgAsmExpression* SH = new SgAsmByteValueExpression(shOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN3(extsb,RA,RS,SH);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN3(extsb_record,RA,RS,SH);
+                  }
+               break;
+             }
+
+       // 974
+          case 0x3CE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfpdx,FRT,FRA,FRB);
+               break;
+             }
+
+       // 983
+          case 0x3D7:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRS = makeRegister(powerpc_regclass_gpr,frsOpcode);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN3(stfiwx,FRS,RA,RB);
+               break;
+             }
+
+       // 986
+          case 0x3DA:
+             {
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,rsOpcode);
+               SgAsmExpression* SH = new SgAsmByteValueExpression(shOpcode);
+               if (rcOpcode == 0)
+                  {
+                    instruction = MAKE_INSN3(extsw,RA,RS,SH);
+                  }
+                 else
+                  {
+                    instruction = MAKE_INSN3(extsw_record,RA,RS,SH);
+                  }
+               break;
+             }
+
+       // 1006
+          case 0x3EE:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               instruction = MAKE_INSN3(stfpdux,FRT,FRA,FRB);
+               break;
+             }
+
+       // 1014
+          case 0x3F6:
+             {
+            // BGL instruction!
+               ROSE_ASSERT(primaryOpcode == 0x1F);
+               SgAsmExpression* RA = makeRegister(powerpc_regclass_gpr,raOpcode);
+               SgAsmExpression* RB = makeRegister(powerpc_regclass_gpr,rbOpcode);
+               instruction = MAKE_INSN2(dcbz,RA,RB);
+               break;
+             }
+
        // BGL specific instructions
+          case 0x2A0: // 672
+             {
+            // These appear to be BGL specific instructions (not a part of the public PowerPC instruction set documentation).
+               ROSE_ASSERT(primaryOpcode == 0x0);
+               instruction = MAKE_INSN0(unknown_instruction);
+               break;
+             }
+
+       // BGL specific instructions
           case 0x36: // 54
           case 0x56: // 86
-          case 0x1CE: // 462
-          case 0x1EE: // 494
+//        case 0x1CE: // 462
+//        case 0x1EE: // 494
           case 0x256: // 598
-          case 0x257: // 599
+//        case 0x257: // 599
           case 0x2D7: // 727
-          case 0x3BA: // 954
+//        case 0x3BA: // 954
           case 0x3BE: // 958
-          case 0x3CE: // 974
-          case 0x3EE: // 1006
+//        case 0x3CE: // 974
+//        case 0x3EE: // 1006
              {
             // These appear to be BGL specific instructions (not a part of the public PowerPC instruction set documentation).
                ROSE_ASSERT(primaryOpcode == 0x1F);
                instruction = MAKE_INSN0(unknown_instruction);
                break;
              }
-
+#if 0
+       // BGL specific instructions
+          case 0x48: // 72
+             {
+            // These appear to be BGL specific instructions (not a part of the public PowerPC instruction set documentation).
+               ROSE_ASSERT(primaryOpcode == 0x3F);
+               instruction = MAKE_INSN0(unknown_instruction);
+               break;
+             }
+#endif
           default:
              {
             // The default case is now used for handling illegal instructions 
             // (during development it was for those not yet implemented).
                printf ("Error: X-Form xoOpcode = %d not handled! \n",xoOpcode);
-               throw BadInstruction();
-            // ROSE_ASSERT(false);
+               ROSE_ASSERT(false);
+
+           // throw BadInstruction();
              }
         }
 
@@ -1984,7 +2911,7 @@
           case 0x10:
              {
                SgAsmExpression* BO = new SgAsmByteValueExpression(boOpcode);
-               SgAsmExpression* BI = makeRegister(powerpc_regclass_gpr,biOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BI = makeRegister(powerpc_regclass_cr,biOpcode,powerpc_condreggranularity_bit);
                SgAsmExpression* BH = new SgAsmByteValueExpression(bhOpcode);
                if (lkOpcode == 0)
                   {
@@ -2007,9 +2934,9 @@
        // 33
           case 0x21:
              {
-               SgAsmExpression* BT = makeRegister(powerpc_regclass_gpr,btOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BA = makeRegister(powerpc_regclass_gpr,baOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BB = makeRegister(powerpc_regclass_gpr,bbOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BT = makeRegister(powerpc_regclass_cr,btOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BA = makeRegister(powerpc_regclass_cr,baOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BB = makeRegister(powerpc_regclass_cr,bbOpcode,powerpc_condreggranularity_bit);
                instruction = MAKE_INSN3(crnor,BT,BA,BB);
                break;
              }
@@ -2017,9 +2944,9 @@
        // 129
           case 0x81:
              {
-               SgAsmExpression* BT = makeRegister(powerpc_regclass_gpr,btOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BA = makeRegister(powerpc_regclass_gpr,baOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BB = makeRegister(powerpc_regclass_gpr,bbOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BT = makeRegister(powerpc_regclass_cr,btOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BA = makeRegister(powerpc_regclass_cr,baOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BB = makeRegister(powerpc_regclass_cr,bbOpcode,powerpc_condreggranularity_bit);
                instruction = MAKE_INSN3(crandc,BT,BA,BB);
                break;
              }
@@ -2027,9 +2954,9 @@
        // 193
           case 0xC1:
              {
-               SgAsmExpression* BT = makeRegister(powerpc_regclass_gpr,btOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BA = makeRegister(powerpc_regclass_gpr,baOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BB = makeRegister(powerpc_regclass_gpr,bbOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BT = makeRegister(powerpc_regclass_cr,btOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BA = makeRegister(powerpc_regclass_cr,baOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BB = makeRegister(powerpc_regclass_cr,bbOpcode,powerpc_condreggranularity_bit);
                instruction = MAKE_INSN3(crxor,BT,BA,BB);
                break;
              }
@@ -2037,9 +2964,9 @@
        // 225
           case 0xE1:
              {
-               SgAsmExpression* BT = makeRegister(powerpc_regclass_gpr,btOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BA = makeRegister(powerpc_regclass_gpr,baOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BB = makeRegister(powerpc_regclass_gpr,bbOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BT = makeRegister(powerpc_regclass_cr,btOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BA = makeRegister(powerpc_regclass_cr,baOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BB = makeRegister(powerpc_regclass_cr,bbOpcode,powerpc_condreggranularity_bit);
                instruction = MAKE_INSN3(crnand,BT,BA,BB);
                break;
              }
@@ -2047,9 +2974,9 @@
        // 257
           case 0x101:
              {
-               SgAsmExpression* BT = makeRegister(powerpc_regclass_gpr,btOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BA = makeRegister(powerpc_regclass_gpr,baOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BB = makeRegister(powerpc_regclass_gpr,bbOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BT = makeRegister(powerpc_regclass_cr,btOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BA = makeRegister(powerpc_regclass_cr,baOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BB = makeRegister(powerpc_regclass_cr,bbOpcode,powerpc_condreggranularity_bit);
                instruction = MAKE_INSN3(crand,BT,BA,BB);
                break;
              }
@@ -2057,9 +2984,9 @@
        // 289
           case 0x121:
              {
-               SgAsmExpression* BT = makeRegister(powerpc_regclass_gpr,btOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BA = makeRegister(powerpc_regclass_gpr,baOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BB = makeRegister(powerpc_regclass_gpr,bbOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BT = makeRegister(powerpc_regclass_cr,btOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BA = makeRegister(powerpc_regclass_cr,baOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BB = makeRegister(powerpc_regclass_cr,bbOpcode,powerpc_condreggranularity_bit);
                instruction = MAKE_INSN3(creqv,BT,BA,BB);
                break;
              }
@@ -2067,9 +2994,9 @@
        // 417
           case 0x1A1:
              {
-               SgAsmExpression* BT = makeRegister(powerpc_regclass_gpr,btOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BA = makeRegister(powerpc_regclass_gpr,baOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BB = makeRegister(powerpc_regclass_gpr,bbOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BT = makeRegister(powerpc_regclass_cr,btOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BA = makeRegister(powerpc_regclass_cr,baOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BB = makeRegister(powerpc_regclass_cr,bbOpcode,powerpc_condreggranularity_bit);
                instruction = MAKE_INSN3(crorc,BT,BA,BB);
                break;
              }
@@ -2077,9 +3004,9 @@
        // 449
           case 0x1C1:
              {
-               SgAsmExpression* BT = makeRegister(powerpc_regclass_gpr,btOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BA = makeRegister(powerpc_regclass_gpr,baOpcode,powerpc_condreggranularity_bit);
-               SgAsmExpression* BB = makeRegister(powerpc_regclass_gpr,bbOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BT = makeRegister(powerpc_regclass_cr,btOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BA = makeRegister(powerpc_regclass_cr,baOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BB = makeRegister(powerpc_regclass_cr,bbOpcode,powerpc_condreggranularity_bit);
                instruction = MAKE_INSN3(cror,BT,BA,BB);
                break;
              }
@@ -2088,7 +3015,7 @@
           case 0x210:
              {
                SgAsmExpression* BO = new SgAsmByteValueExpression(boOpcode);
-               SgAsmExpression* BI = makeRegister(powerpc_regclass_gpr,biOpcode,powerpc_condreggranularity_bit);
+               SgAsmExpression* BI = makeRegister(powerpc_regclass_cr,biOpcode,powerpc_condreggranularity_bit);
                SgAsmExpression* BH = new SgAsmByteValueExpression(bhOpcode);
                if (lkOpcode == 0)
                   {
@@ -2213,7 +3140,7 @@
              {
                SgAsmExpression* RS = makeRegister(powerpc_regclass_gpr,rsOpcode);
                SgAsmExpression* SPR = makeRegister(powerpc_regclass_spr,sprOpcode,powerpc_condreggranularity_whole);
-               instruction = MAKE_INSN2(mfspr,RS,SPR);
+               instruction = MAKE_INSN2(mtspr,RS,SPR);
                break;
              }
 
@@ -2910,13 +3837,129 @@
      uint8_t rcOpcode = (insn >> 0) & 0x1;
 
 #if DEBUG_OPCODES
-     printf ("A-Form instruction opcode = 0x%x frtOpcode = 0x%x fraOpcode = 0x%x frbOpcode = 0x%x frcOpcode = 0x%x xOpcode = 0x%x rcOpcode = 0x%x \n",insn,frtOpcode,fraOpcode,frbOpcode,frcOpcode,xOpcode,rcOpcode);
+     printf ("A-Form instruction opcode = 0x%x primaryOpcode = 0x%x frtOpcode = 0x%x fraOpcode = 0x%x frbOpcode = 0x%x frcOpcode = 0x%x xOpcode = 0x%x rcOpcode = 0x%x \n",insn,primaryOpcode,frtOpcode,fraOpcode,frbOpcode,frcOpcode,xOpcode,rcOpcode);
 #endif
 
      SgAsmExpression* FRT = makeRegister(powerpc_regclass_gpr,frtOpcode);
 
+  // Decode these instructions last, to avoid confusion!
+     ROSE_ASSERT(primaryOpcode != 0x4);
+
      switch(xOpcode)
         {
+       // 5
+          case 0x5:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN4(fpsel,FRT,FRA,FRB,FRC);
+               break;
+             }
+
+       // 8
+          case 0x8:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN3(fpmul,FRT,FRA,FRC);
+               break;
+             }
+
+       // 9
+          case 0x9:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN3(fxmul,FRT,FRA,FRC);
+               break;
+             }
+
+       // 10
+          case 0xA:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN3(fxpmul,FRT,FRA,FRC);
+               break;
+             }
+
+       // 11
+          case 0xB:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN3(fxsmul,FRT,FRA,FRC);
+               break;
+             }
+
+       // 12
+          case 0xC:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN3(fpadd,FRT,FRA,FRB);
+               break;
+             }
+
+       // 13
+          case 0xD:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN3(fpsub,FRT,FRA,FRB);
+               break;
+             }
+
+       // 14
+          case 0xE:
+             {
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN2(fpre,FRT,FRB);
+               break;
+             }
+
+       // 15
+          case 0xF:
+             {
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN2(fprsqrte,FRT,FRB);
+               break;
+             }
+
+       // 16
+          case 0x10:
+             {
+            // FP2 BGL instruction
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN4(fpmadd,FRT,FRA,FRB,FRC);
+               break;
+             }
+
+       // 17
+          case 0x11:
+             {
+            // FP2 BGL instruction
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN4(fxmadd,FRT,FRA,FRB,FRC);
+               break;
+             }
+
        // 18
           case 0x12:
              {
@@ -2926,28 +3969,50 @@
                   {
                     if (rcOpcode == 0)
                        {
-                         instruction = MAKE_INSN3(fdiv,FRT,FRA,FRB);
+                         instruction = MAKE_INSN3(fdivs,FRT,FRA,FRB);
                        }
                       else
                        {
-                         instruction = MAKE_INSN3(fdiv_record,FRT,FRA,FRB);
+                         instruction = MAKE_INSN3(fdivs_record,FRT,FRA,FRB);
                        }
                   }
                  else
                   {
-                    ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
-                    if (rcOpcode == 0)
+                    if (primaryOpcode == 0x3F /*63*/)
                        {
-                         instruction = MAKE_INSN3(fdivs,FRT,FRA,FRB);
+                         ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN3(fdiv,FRT,FRA,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN3(fdiv_record,FRT,FRA,FRB);
+                            }
                        }
                       else
                        {
-                         instruction = MAKE_INSN3(fdivs_record,FRT,FRA,FRB);
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcpmadd,FRT,FRA,FRB,FRC);
                        }
                   }
                break;
              }
 
+       // 19
+          case 0x13:
+             {
+            // FP2 BGL instruction
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+               instruction = MAKE_INSN4(fxcsmadd,FRT,FRA,FRB,FRC);
+               break;
+             }
+
        // 20
           case 0x14:
              {
@@ -2957,23 +4022,33 @@
                   {
                     if (rcOpcode == 0)
                        {
-                         instruction = MAKE_INSN3(fsub,FRT,FRA,FRB);
+                         instruction = MAKE_INSN3(fsubs,FRT,FRA,FRB);
                        }
                       else
                        {
-                         instruction = MAKE_INSN3(fsub_record,FRT,FRA,FRB);
+                         instruction = MAKE_INSN3(fsubs_record,FRT,FRA,FRB);
                        }
                   }
                  else
                   {
-                    ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
-                    if (rcOpcode == 0)
+                    if (primaryOpcode == 0x3F /*63*/)
                        {
-                         instruction = MAKE_INSN3(fsubs,FRT,FRA,FRB);
+                         ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN3(fsub,FRT,FRA,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN3(fsub_record,FRT,FRA,FRB);
+                            }
                        }
                       else
                        {
-                         instruction = MAKE_INSN3(fsubs_record,FRT,FRA,FRB);
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fpnmadd,FRT,FRA,FRB,FRC);
                        }
                   }
                break;
@@ -2988,128 +4063,609 @@
                   {
                     if (rcOpcode == 0)
                        {
-                         instruction = MAKE_INSN3(fadd,FRT,FRA,FRB);
+                         instruction = MAKE_INSN3(fadds,FRT,FRA,FRB);
                        }
                       else
                        {
-                         instruction = MAKE_INSN3(fadd_record,FRT,FRA,FRB);
+                         instruction = MAKE_INSN3(fadds_record,FRT,FRA,FRB);
                        }
                   }
                  else
                   {
-                    ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
-                    if (rcOpcode == 0)
+                    if (primaryOpcode == 0x3F /*63*/)
                        {
-                         instruction = MAKE_INSN3(fadds,FRT,FRA,FRB);
+                         ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN3(fadd,FRT,FRA,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN3(fadd_record,FRT,FRA,FRB);
+                            }
                        }
                       else
                        {
-                         instruction = MAKE_INSN3(fadds_record,FRT,FRA,FRB);
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxnmadd,FRT,FRA,FRB,FRC);
                        }
                   }
                break;
              }
 
-       // 25
-          case 0x19:
+       // 22
+          case 0x16:
              {
-               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
-               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
                if (primaryOpcode == 0x3B /*59*/)
                   {
                     if (rcOpcode == 0)
                        {
-                         instruction = MAKE_INSN3(fmul,FRT,FRA,FRC);
+                         instruction = MAKE_INSN2(fsqrts,FRT,FRB);
                        }
                       else
                        {
-                         instruction = MAKE_INSN3(fmul_record,FRT,FRA,FRC);
+                         instruction = MAKE_INSN2(fsqrts_record,FRT,FRB);
                        }
                   }
                  else
                   {
-                    ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
-                    if (rcOpcode == 0)
+                    if (primaryOpcode == 0x3F /*63*/)
                        {
-                         instruction = MAKE_INSN3(fmuls,FRT,FRA,FRC);
+                         ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fsqrt,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fsqrt_record,FRT,FRB);
+                            }
                        }
                       else
                        {
-                         instruction = MAKE_INSN3(fmuls_record,FRT,FRA,FRC);
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+                         SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcpnmadd,FRT,FRA,FRB,FRC);
                        }
                   }
                break;
              }
 
-       // 28
-          case 0x1C:
+       // 23
+          case 0x17:
              {
                SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
                SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
                SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
-               if (primaryOpcode == 0x3B /*59*/)
+               if (primaryOpcode == 0x3F /*63*/)
                   {
+                    ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
                     if (rcOpcode == 0)
                        {
-                         instruction = MAKE_INSN4(fmsub,FRT,FRA,FRC,FRB);
+                         instruction = MAKE_INSN4(fsel,FRT,FRA,FRC,FRB);
                        }
                       else
                        {
-                         instruction = MAKE_INSN4(fmsub_record,FRT,FRA,FRC,FRB);
+                         instruction = MAKE_INSN4(fsel_record,FRT,FRA,FRC,FRB);
                        }
                   }
                  else
                   {
-                    ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
-                    if (rcOpcode == 0)
+                 // FP2 BGL instruction
+                    ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                    instruction = MAKE_INSN4(fxcsnmadd,FRT,FRA,FRB,FRC);
+                  }
+               break;
+             }
+
+       // 24
+          case 0x18:
+             {
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               switch(primaryOpcode)
+                  {
+                 // 0
+                    case 0x0:
                        {
-                         instruction = MAKE_INSN4(fmsubs,FRT,FRA,FRC,FRB);
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+                         SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fpmsub,FRT,FRA,FRB,FRC);
+                         break;
                        }
-                      else
+
+                 // 4
+                    case 0x4:
                        {
-                         instruction = MAKE_INSN4(fmsubs_record,FRT,FRA,FRC,FRB);
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+                         SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcpnpma,FRT,FRA,FRB,FRC);
+                         break;
                        }
+
+                 // 59
+                    case 0x3B:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fres,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fres_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                 // 63
+                    case 0x3F:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fre,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fre_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                    default:
+                       {
+                      // The default case is now used for handling illegal instructions 
+                      // (during development it was for those not yet implemented).
+                         printf ("Error: A-Form primaryOpcode = %d xOpcode = %d (illegal instruction) \n",primaryOpcode,xOpcode);
+                         ROSE_ASSERT(false);
+                       }
                   }
                break;
              }
 
+       // 25
+          case 0x19:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               switch(primaryOpcode)
+                  {
+                 // 0
+                    case 0x0:
+                       {
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxmsub,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                 // 4
+                    case 0x4:
+                       {
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcsnpma,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                 // 59
+                    case 0x3B:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN3(fmuls,FRT,FRA,FRC);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN3(fmuls_record,FRT,FRA,FRC);
+                            }
+                         break;
+                       }
+
+                 // 63
+                    case 0x3F:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN3(fmul,FRT,FRA,FRC);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN3(fmul_record,FRT,FRA,FRC);
+                            }
+                         break;
+                       }
+
+                    default:
+                       {
+                      // The default case is now used for handling illegal instructions 
+                      // (during development it was for those not yet implemented).
+                         printf ("Error: A-Form primaryOpcode = %d xOpcode = %d (illegal instruction) \n",primaryOpcode,xOpcode);
+                         ROSE_ASSERT(false);
+                       }
+                  }
+               break;
+             }
+
+       // 26
+          case 0x1A:
+             {
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               switch(primaryOpcode)
+                  {
+                 // 0
+                    case 0x0:
+                       {
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+                         SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcpmsub,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                 // 4
+                    case 0x4:
+                       {
+                      // FP2 BGL instruction
+                         SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+                         SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcpnsma,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                 // 59
+                    case 0x3B:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(frsqrtes,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(frsqrtes_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                 // 63
+                    case 0x3F:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(frsqrte,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(frsqrte_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                    default:
+                       {
+                      // The default case is now used for handling illegal instructions 
+                      // (during development it was for those not yet implemented).
+                         printf ("Error: A-Form primaryOpcode = %d xOpcode = %d (illegal instruction) \n",primaryOpcode,xOpcode);
+                         ROSE_ASSERT(false);
+                       }
+                  }
+               break;
+             }
+
+       // 27
+          case 0x1B:
+             {
+            // FP2 BGL instruction
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               switch(primaryOpcode)
+                  {
+                 // 0
+                    case 0x0:
+                       {
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcsmsub,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                 // 4
+                    case 0x4:
+                       {
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x4 /*4*/);
+                         instruction = MAKE_INSN4(fxcsnsma,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                    default:
+                       {
+                      // The default case is now used for handling illegal instructions 
+                      // (during development it was for those not yet implemented).
+                         printf ("Error: A-Form primaryOpcode = %d xOpcode = %d (illegal instruction) \n",primaryOpcode,xOpcode);
+                         ROSE_ASSERT(false);
+                       }
+                  }
+               break;
+             }
+
+       // 28
+          case 0x1C:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               switch(primaryOpcode)
+                  {
+                 // 0
+                    case 0x0:
+                       {
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fpnmsub,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                 // 4
+                    case 0x4:
+                       {
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcxma,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                 // 59
+                    case 0x3B:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fmsubs,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fmsubs_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                 // 63
+                    case 0x3F:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fmsub,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fmsub_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                    default:
+                       {
+                      // The default case is now used for handling illegal instructions 
+                      // (during development it was for those not yet implemented).
+                         printf ("Error: A-Form primaryOpcode = %d xOpcode = %d (illegal instruction) \n",primaryOpcode,xOpcode);
+                         ROSE_ASSERT(false);
+                       }
+                  }
+               break;
+             }
+
        // 29
           case 0x1D:
              {
                SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
                SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
                SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
-               if (primaryOpcode == 0x3B /*59*/)
+               switch(primaryOpcode)
                   {
-                    if (rcOpcode == 0)
+                 // 0
+                    case 0x0:
                        {
-                         instruction = MAKE_INSN4(fmadd,FRT,FRA,FRC,FRB);
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxnmsub,FRT,FRA,FRB,FRC);
+                         break;
                        }
-                      else
+
+                 // 4
+                    case 0x4:
                        {
-                         instruction = MAKE_INSN4(fmadd_record,FRT,FRA,FRC,FRB);
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcxnpma,FRT,FRA,FRB,FRC);
+                         break;
                        }
+
+                 // 59
+                    case 0x3B:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fmadds,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fmadds_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                 // 63
+                    case 0x3F:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fmadd,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fmadd_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                    default:
+                       {
+                      // The default case is now used for handling illegal instructions 
+                      // (during development it was for those not yet implemented).
+                         printf ("Error: A-Form primaryOpcode = %d xOpcode = %d (illegal instruction) \n",primaryOpcode,xOpcode);
+                         ROSE_ASSERT(false);
+                       }
                   }
-                 else
+               break;
+             }
+
+       // 30
+          case 0x1E:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               switch(primaryOpcode)
                   {
-                    ROSE_ASSERT (primaryOpcode == 0x3F /*63*/);
-                    if (rcOpcode == 0)
+                 // 0
+                    case 0x0:
                        {
-                         instruction = MAKE_INSN4(fmadds,FRT,FRA,FRC,FRB);
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcpnmsub,FRT,FRA,FRB,FRC);
+                         break;
                        }
-                      else
+
+                 // 4
+                    case 0x4:
                        {
-                         instruction = MAKE_INSN4(fmadds_record,FRT,FRA,FRC,FRB);
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcxnsma,FRT,FRA,FRB,FRC);
+                         break;
                        }
+
+                 // 59
+                    case 0x3B:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fnmsubs,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fnmsubs_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                 // 63
+                    case 0x3F:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fnmsub,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fnmsub_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                    default:
+                       {
+                      // The default case is now used for handling illegal instructions 
+                      // (during development it was for those not yet implemented).
+                         printf ("Error: A-Form primaryOpcode = %d xOpcode = %d (illegal instruction) \n",primaryOpcode,xOpcode);
+                         ROSE_ASSERT(false);
+                       }
                   }
                break;
              }
 
+       // 31
+          case 0x1F:
+             {
+               SgAsmExpression* FRA = makeRegister(powerpc_regclass_gpr,fraOpcode);
+               SgAsmExpression* FRB = makeRegister(powerpc_regclass_gpr,frbOpcode);
+               SgAsmExpression* FRC = makeRegister(powerpc_regclass_gpr,frcOpcode);
+               switch(primaryOpcode)
+                  {
+                 // 0
+                    case 0x0:
+                       {
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcsnmsub,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                 // 4
+                    case 0x4:
+                       {
+                      // FP2 BGL instruction
+                         ROSE_ASSERT (primaryOpcode == 0x0 /*0*/);
+                         instruction = MAKE_INSN4(fxcxnms,FRT,FRA,FRB,FRC);
+                         break;
+                       }
+
+                 // 59
+                    case 0x3B:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fnmadds,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fnmadds_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                 // 63
+                    case 0x3F:
+                       {
+                         if (rcOpcode == 0)
+                            {
+                              instruction = MAKE_INSN2(fnmadd,FRT,FRB);
+                            }
+                           else
+                            {
+                              instruction = MAKE_INSN2(fnmadd_record,FRT,FRB);
+                            }
+                         break;
+                       }
+
+                    default:
+                       {
+                      // The default case is now used for handling illegal instructions 
+                      // (during development it was for those not yet implemented).
+                         printf ("Error: A-Form primaryOpcode = %d xOpcode = %d (illegal instruction) \n",primaryOpcode,xOpcode);
+                         ROSE_ASSERT(false);
+                       }
+                  }
+               break;
+             }
+
           default:
              {
             // The default case is now used for handling illegal instructions 
             // (during development it was for those not yet implemented).
-               printf ("Error: A-Form primaryOpcode = %d (illegal instruction) \n",xOpcode);
+               printf ("Error: A-Form xOpcode = %d (illegal instruction) \n",xOpcode);
                ROSE_ASSERT(false);
              }
         }

Modified: branches/rice/src/frontend/Disassemblers/x86Disassembler.C
===================================================================
--- branches/rice/src/frontend/Disassemblers/x86Disassembler.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/Disassemblers/x86Disassembler.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -2,16 +2,32 @@
 #include <fcntl.h>
 #include <vector>
 #include "rose.h"
+#include "integerOps.h"
 
-// DQ (8/21/2008): No longer used (using new IR nodes now)
-// #include "freebsd_elf_combined.h"
-// #include "ExecGeneric.h"
-
 using namespace std;
 using namespace SageBuilderAsm;
+using namespace IntegerOps;
 
-// DQ (8/21/2008): No longer used (using new IR nodes now)
-// using namespace Exec;
+// These are macros to make them look like constants while they are really
+// function calls
+#define BYTET (SgAsmTypeByte::createType())
+#define WORDT (SgAsmTypeWord::createType())
+#define DWORDT (SgAsmTypeDoubleWord::createType())
+#define QWORDT (SgAsmTypeQuadWord::createType())
+#define DQWORDT (SgAsmTypeDoubleQuadWord::createType())
+#define FLOATT (SgAsmTypeSingleFloat::createType())
+#define DOUBLET (SgAsmTypeDoubleFloat::createType())
+#define LDOUBLET (SgAsmType80bitFloat::createType())
+#define V8BYTET (SgAsmTypeVector::createType(8, BYTET))
+#define V16BYTET (SgAsmTypeVector::createType(16, BYTET))
+#define V4WORDT (SgAsmTypeVector::createType(4, WORDT))
+#define V8WORDT (SgAsmTypeVector::createType(8, WORDT))
+#define V2DWORDT (SgAsmTypeVector::createType(2, DWORDT))
+#define V4DWORDT (SgAsmTypeVector::createType(4, DWORDT))
+#define V2FLOATT (SgAsmTypeVector::createType(2, FLOATT))
+#define V4FLOATT (SgAsmTypeVector::createType(4, FLOATT))
+#define V2QWORDT (SgAsmTypeVector::createType(2, QWORDT))
+#define V2DOUBLET (SgAsmTypeVector::createType(2, DOUBLET))
 
 namespace X86Disassembler {
 
@@ -61,44 +77,44 @@
       case rmLegacyByte: {
         ref = new SgAsmx86RegisterReferenceExpression(x86_regclass_gpr, fullRegisterNumber % 4);
         ref->set_position_in_register((fullRegisterNumber & 4) ? x86_regpos_high_byte : x86_regpos_low_byte);
-        ref->set_type(SgAsmTypeByte::createType());
+        ref->set_type(BYTET);
         break;
       }
       case rmRexByte: {
         ref = new SgAsmx86RegisterReferenceExpression(x86_regclass_gpr, fullRegisterNumber);
         ref->set_position_in_register(x86_regpos_low_byte);
-        ref->set_type(SgAsmTypeByte::createType());
+        ref->set_type(BYTET);
         break;
       }
       case rmWord: {
         ref = new SgAsmx86RegisterReferenceExpression(x86_regclass_gpr, fullRegisterNumber);
         ref->set_position_in_register(x86_regpos_word);
-        ref->set_type(SgAsmTypeWord::createType());
+        ref->set_type(WORDT);
         break;
       }
       case rmDWord: {
         ref = new SgAsmx86RegisterReferenceExpression(x86_regclass_gpr, fullRegisterNumber);
         ref->set_position_in_register(x86_regpos_dword);
-        ref->set_type(SgAsmTypeDoubleWord::createType());
+        ref->set_type(DWORDT);
         break;
       }
       case rmQWord: {
         ref = new SgAsmx86RegisterReferenceExpression(x86_regclass_gpr, fullRegisterNumber);
         ref->set_position_in_register(x86_regpos_qword);
-        ref->set_type(SgAsmTypeQuadWord::createType());
+        ref->set_type(QWORDT);
         break;
       }
       case rmSegment: {
         if (fullRegisterNumber >= 6) throw BadInstruction();
         ref = new SgAsmx86RegisterReferenceExpression(x86_regclass_segment, fullRegisterNumber);
         ref->set_position_in_register(x86_regpos_all);
-        ref->set_type(SgAsmTypeWord::createType());
+        ref->set_type(WORDT);
         break;
       }
       case rmST: {
         ref = new SgAsmx86RegisterReferenceExpression(x86_regclass_st, fullRegisterNumber);
         ref->set_position_in_register(x86_regpos_all);
-        ref->set_type(SgAsmType80bitFloat::createType());
+        ref->set_type(LDOUBLET);
         break;
       }
       case rmMM: {
@@ -372,7 +388,7 @@
         if (modeField == 0 && rmField == 5) { // Special case
           uint32_t offset;
           getDWord(offset);
-          addressExpr = makeAddrSizeValue((int64_t)(int32_t)offset);
+          addressExpr = makeAddrSizeValue(signExtend<32, 64>((uint64_t)offset));
           if (p.insnSize == x86_insnsize_64) {
             addressExpr = makeAdd(makeIP(), addressExpr);
           }
@@ -387,7 +403,7 @@
             SgAsmExpression* sibBase = NULL;
             if (sibBaseField == 5) {
               switch (modeField) {
-                case 0: {uint32_t offset; getDWord(offset); sibBase = makeAddrSizeValue((int64_t)(int32_t)offset); break;}
+                case 0: {uint32_t offset; getDWord(offset); sibBase = makeAddrSizeValue(signExtend<32, 64>((uint64_t)offset)); break;}
                 case 1: {sibBase = makeRegister((rexB ? 13 : 5), sizeToMode(p.insnSize)); defaultSeg = x86_segreg_ss; break;}
                 case 2: {sibBase = makeRegister((rexB ? 13 : 5), sizeToMode(p.insnSize)); defaultSeg = x86_segreg_ss; break;}
                 default: ROSE_ASSERT (false);
@@ -409,8 +425,8 @@
           }
           switch (modeField) {
             case 0: break; // No offset
-            case 1: {uint8_t offset; getByte(offset); addressExpr = makeAdd(addressExpr, makeAddrSizeValue((int64_t)(int8_t)offset)); break;}
-            case 2: {uint32_t offset; getDWord(offset); addressExpr = makeAdd(addressExpr, makeAddrSizeValue((int64_t)(int32_t)offset)); break;}
+            case 1: {uint8_t offset; getByte(offset); addressExpr = makeAdd(addressExpr, makeAddrSizeValue(signExtend<8, 64>((uint64_t)offset))); break;}
+            case 2: {uint32_t offset; getDWord(offset); addressExpr = makeAdd(addressExpr, makeAddrSizeValue(signExtend<32, 64>((uint64_t)offset))); break;}
             default: ROSE_ASSERT (false);
           }
         }
@@ -453,7 +469,7 @@
     }
 
     SgAsmExpression* getModrmForByte() {
-      return makeModrmNormal(rmLegacyByte, SgAsmTypeByte::createType());
+      return makeModrmNormal(rmLegacyByte, BYTET);
     }
 
     SgAsmExpression* getModrmForXword() {
@@ -461,7 +477,7 @@
     }
 
     SgAsmExpression* getModrmForWord() {
-      return makeModrmNormal(rmWord, SgAsmTypeWord::createType());
+      return makeModrmNormal(rmWord, WORDT);
     }
 
     SgAsmExpression* getModrmForFloat(SgAsmType* t) {
@@ -470,9 +486,6 @@
 
     SgAsmx86Instruction* makeNullaryInstruction(const string& mnemonic, X86InstructionKind kind) {
       SgAsmx86Instruction* newInsn = makeInstructionWithoutOperands(p.ip, mnemonic, kind, p.insnSize, effectiveOperandSize(), effectiveAddressSize(), lock);
-
-   // DQ (8/30/2008): IR node now uses a SgUnsignedCharList instead of a std::string.
-   // newInsn->set_raw_bytes(string(insn + positionInVector, insn + positionInVector + positionInInstruction));
       newInsn->set_raw_bytes(SgUnsignedCharList(insn + positionInVector, insn + positionInVector + positionInInstruction));
 
       SgAsmOperandList* operands = new SgAsmOperandList();
@@ -605,7 +618,7 @@
         case x86_insnsize_64: {
           uint32_t val;
           getDWord(val);
-          return makeQWordValue((int64_t)(int32_t)val);
+          return makeQWordValue(signExtend<32, 64>((uint64_t)val));
         }
         default: ROSE_ASSERT (false);
       }
@@ -624,37 +637,39 @@
       uint8_t val;
       getByte(val);
       switch (effectiveOperandSize()) {
-        case x86_insnsize_16: return makeWordValue((int16_t)(int8_t)val);
-        case x86_insnsize_32: return makeDWordValue((int32_t)(int8_t)val);
-        case x86_insnsize_64: return makeQWordValue((int64_t)(int8_t)val);
+        case x86_insnsize_16: return makeWordValue(signExtend<8, 16>((uint64_t)val));
+        case x86_insnsize_32: return makeDWordValue(signExtend<8, 32>((uint64_t)val));
+        case x86_insnsize_64: return makeQWordValue(signExtend<8, 64>((uint64_t)val));
         default: ROSE_ASSERT (false);
       }
     }
 
     SgAsmExpression* getImmJb() {
-      int8_t val;
-      getByte((uint8_t&)val);
+      uint8_t val;
+      getByte(val);
+      uint64_t target = p.ip + positionInInstruction + signExtend<8, 64>((uint64_t)val);
       if (knownSuccessorsReturn) {
-        knownSuccessorsReturn->insert(p.ip + positionInInstruction + (int64_t)(int8_t)val);
+        knownSuccessorsReturn->insert(target);
       }
-      return makeQWordValue(p.ip + positionInInstruction + (int64_t)(int8_t)val);
+      return makeQWordValue(target);
     }
 
     SgAsmExpression* getImmJz() {
-      int64_t val;
+      uint64_t val;
       if (effectiveOperandSize() == x86_insnsize_16) {
         uint16_t val2;
         getWord(val2);
-        val = (int64_t)(int16_t)val2;
+        val = signExtend<16, 64>((uint64_t)val2);
       } else {
         uint32_t val2;
         getDWord(val2);
-        val = (int64_t)(int32_t)val2;
+        val = signExtend<32, 64>((uint64_t)val2);
       }
+      uint64_t target = p.ip + positionInInstruction + val;
       if (knownSuccessorsReturn) {
-        knownSuccessorsReturn->insert(p.ip + positionInInstruction + val);
+        knownSuccessorsReturn->insert(target);
       }
-      return makeQWordValue(p.ip + positionInInstruction + val);
+      return makeQWordValue(target);
     }
 
     SgAsmExpression* getImmForAddr() {
@@ -682,65 +697,65 @@
     getByte(opcode);
     SgAsmx86Instruction* insn = 0;
     switch (opcode) {
-      case 0x00: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(add, add, modrm, reg); goto done;}
+      case 0x00: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(add, add, modrm, reg); goto done;}
       case 0x01: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(add, add, modrm, reg); goto done;}
-      case 0x02: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(add, add, reg, modrm); goto done;}
+      case 0x02: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(add, add, reg, modrm); goto done;}
       case 0x03: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(add, add, reg, modrm); goto done;}
       case 0x04: {SgAsmExpression* imm = getImmByteAsIv(); insn = MAKE_INSN2(add, add, makeRegister(0, rmLegacyByte), imm); goto done;}
       case 0x05: {SgAsmExpression* imm = getImmIzAsIv(); insn = MAKE_INSN2(add, add, makeRegisterEffective(0), imm); goto done;}
       case 0x06: {not64(); insn = MAKE_INSN1(push, push, makeRegister(0, rmSegment)); goto done;}
       case 0x07: {not64(); insn = MAKE_INSN1(pop, pop, makeRegister(0, rmSegment)); goto done;}
-      case 0x08: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(or, or, modrm, reg); goto done;}
+      case 0x08: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(or, or, modrm, reg); goto done;}
       case 0x09: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(or, or, modrm, reg); goto done;}
-      case 0x0A: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(or, or, reg, modrm); goto done;}
+      case 0x0A: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(or, or, reg, modrm); goto done;}
       case 0x0B: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(or, or, reg, modrm); goto done;}
       case 0x0C: {SgAsmExpression* imm = getImmByteAsIv(); insn = MAKE_INSN2(or, or, makeRegister(0, rmLegacyByte), imm); goto done;}
       case 0x0D: {SgAsmExpression* imm = getImmIzAsIv(); insn = MAKE_INSN2(or, or, makeRegisterEffective(0), imm); goto done;}
       case 0x0E: {not64(); insn = MAKE_INSN1(push, push, makeRegister(1, rmSegment)); goto done;}
       case 0x0F: {insn = decodeOpcode0F(); goto done;}
-      case 0x10: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(adc, adc, modrm, reg); goto done;}
+      case 0x10: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(adc, adc, modrm, reg); goto done;}
       case 0x11: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(adc, adc, modrm, reg); goto done;}
-      case 0x12: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(adc, adc, reg, modrm); goto done;}
+      case 0x12: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(adc, adc, reg, modrm); goto done;}
       case 0x13: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(adc, adc, reg, modrm); goto done;}
       case 0x14: {SgAsmExpression* imm = getImmByteAsIv(); insn = MAKE_INSN2(adc, adc, makeRegister(0, rmLegacyByte), imm); goto done;}
       case 0x15: {SgAsmExpression* imm = getImmIzAsIv(); insn = MAKE_INSN2(adc, adc, makeRegisterEffective(0), imm); goto done;}
       case 0x16: {not64(); insn = MAKE_INSN1(push, push, makeRegister(2, rmSegment)); goto done;}
       case 0x17: {not64(); insn = MAKE_INSN1(pop, pop, makeRegister(2, rmSegment)); goto done;}
-      case 0x18: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(sbb, sbb, modrm, reg); goto done;}
+      case 0x18: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(sbb, sbb, modrm, reg); goto done;}
       case 0x19: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(sbb, sbb, modrm, reg); goto done;}
-      case 0x1A: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(sbb, sbb, reg, modrm); goto done;}
+      case 0x1A: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(sbb, sbb, reg, modrm); goto done;}
       case 0x1B: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(sbb, sbb, reg, modrm); goto done;}
       case 0x1C: {SgAsmExpression* imm = getImmByteAsIv(); insn = MAKE_INSN2(sbb, sbb, makeRegister(0, rmLegacyByte), imm); goto done;}
       case 0x1D: {SgAsmExpression* imm = getImmIzAsIv(); insn = MAKE_INSN2(sbb, sbb, makeRegisterEffective(0), imm); goto done;}
       case 0x1E: {not64(); insn = MAKE_INSN1(push, push, makeRegister(3, rmSegment)); goto done;}
       case 0x1F: {not64(); insn = MAKE_INSN1(pop, pop, makeRegister(3, rmSegment)); goto done;}
-      case 0x20: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(and, and, modrm, reg); goto done;}
+      case 0x20: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(and, and, modrm, reg); goto done;}
       case 0x21: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(and, and, modrm, reg); goto done;}
-      case 0x22: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(and, and, reg, modrm); goto done;}
+      case 0x22: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(and, and, reg, modrm); goto done;}
       case 0x23: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(and, and, reg, modrm); goto done;}
       case 0x24: {SgAsmExpression* imm = getImmByteAsIv(); insn = MAKE_INSN2(and, and, makeRegister(0, rmLegacyByte), imm); goto done;}
       case 0x25: {SgAsmExpression* imm = getImmIzAsIv(); insn = MAKE_INSN2(and, and, makeRegisterEffective(0), imm); goto done;}
       case 0x26: {segOverride = x86_segreg_es; insn = disassemble(); goto done;}
       case 0x27: {not64(); insn = MAKE_INSN0(daa, daa); goto done;}
-      case 0x28: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(sub, sub, modrm, reg); goto done;}
+      case 0x28: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(sub, sub, modrm, reg); goto done;}
       case 0x29: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(sub, sub, modrm, reg); goto done;}
-      case 0x2A: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(sub, sub, reg, modrm); goto done;}
+      case 0x2A: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(sub, sub, reg, modrm); goto done;}
       case 0x2B: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(sub, sub, reg, modrm); goto done;}
       case 0x2C: {SgAsmExpression* imm = getImmByteAsIv(); insn = MAKE_INSN2(sub, sub, makeRegister(0, rmLegacyByte), imm); goto done;}
       case 0x2D: {SgAsmExpression* imm = getImmIzAsIv(); insn = MAKE_INSN2(sub, sub, makeRegisterEffective(0), imm); goto done;}
       case 0x2E: {segOverride = x86_segreg_cs; branchPrediction = x86_branch_prediction_not_taken; insn = disassemble(); goto done;}
       case 0x2F: {not64(); insn = MAKE_INSN0(das, das); goto done;}
-      case 0x30: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(xor, xor, modrm, reg); goto done;}
+      case 0x30: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(xor, xor, modrm, reg); goto done;}
       case 0x31: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(xor, xor, modrm, reg); goto done;}
-      case 0x32: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(xor, xor, reg, modrm); goto done;}
+      case 0x32: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(xor, xor, reg, modrm); goto done;}
       case 0x33: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(xor, xor, reg, modrm); goto done;}
       case 0x34: {SgAsmExpression* imm = getImmByteAsIv(); insn = MAKE_INSN2(xor, xor, makeRegister(0, rmLegacyByte), imm); goto done;}
       case 0x35: {SgAsmExpression* imm = getImmIzAsIv(); insn = MAKE_INSN2(xor, xor, makeRegisterEffective(0), imm); goto done;}
       case 0x36: {segOverride = x86_segreg_ss; insn = disassemble(); goto done;}
       case 0x37: {not64(); insn = MAKE_INSN0(aaa, aaa); goto done;}
-      case 0x38: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(cmp, cmp, modrm, reg); goto done;}
+      case 0x38: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(cmp, cmp, modrm, reg); goto done;}
       case 0x39: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(cmp, cmp, modrm, reg); goto done;}
-      case 0x3A: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(cmp, cmp, reg, modrm); goto done;}
+      case 0x3A: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(cmp, cmp, reg, modrm); goto done;}
       case 0x3B: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(cmp, cmp, reg, modrm); goto done;}
       case 0x3C: {SgAsmExpression* imm = getImmByteAsIv(); insn = MAKE_INSN2(cmp, cmp, makeRegister(0, rmLegacyByte), imm); goto done;}
       case 0x3D: {SgAsmExpression* imm = getImmIzAsIv(); insn = MAKE_INSN2(cmp, cmp, makeRegisterEffective(0), imm); goto done;}
@@ -781,7 +796,7 @@
       case 0x60: {not64(); if (effectiveOperandSize() == x86_insnsize_32) insn = MAKE_INSN0(pushad, pushad); else insn = MAKE_INSN0(pusha, pusha); goto done;}
       case 0x61: {not64(); if (effectiveOperandSize() == x86_insnsize_32) insn = MAKE_INSN0(popad, popad); else insn = MAKE_INSN0(popa, popa); goto done;}
       case 0x62: {not64(); getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); requireMemory(); insn = MAKE_INSN2(bound, bound, reg, modrm); goto done;}
-      case 0x63: {if (longMode()) {getModRegRM(effectiveOperandMode(), rmDWord, SgAsmTypeDoubleWord::createType()); insn = MAKE_INSN2(movsxd, movsxd, reg, modrm); goto done;} else {getModRegRM(rmWord, rmWord, SgAsmTypeWord::createType()); insn = MAKE_INSN2(arpl, arpl, modrm, reg); goto done;}}
+      case 0x63: {if (longMode()) {getModRegRM(effectiveOperandMode(), rmDWord, DWORDT); insn = MAKE_INSN2(movsxd, movsxd, reg, modrm); goto done;} else {getModRegRM(rmWord, rmWord, WORDT); insn = MAKE_INSN2(arpl, arpl, modrm, reg); goto done;}}
       case 0x64: {segOverride = x86_segreg_fs; insn = disassemble(); goto done;}
       case 0x65: {segOverride = x86_segreg_gs; insn = disassemble(); goto done;}
       case 0x66: {operandSizeOverride = true; insn = disassemble(); goto done;}
@@ -840,37 +855,37 @@
           default: ROSE_ASSERT (false);
         }
       }
-      case 0x70: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jo , jo , /* prediction, */ imm); goto done;}
-      case 0x71: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jno, jno, /* prediction, */ imm); goto done;}
-      case 0x72: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jb , jb , /* prediction, */ imm); goto done;}
-      case 0x73: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jae, jae, /* prediction, */ imm); goto done;}
-      case 0x74: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(je , je , /* prediction, */ imm); goto done;}
-      case 0x75: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jne, jne, /* prediction, */ imm); goto done;}
-      case 0x76: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jbe, jbe, /* prediction, */ imm); goto done;}
-      case 0x77: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(ja , ja , /* prediction, */ imm); goto done;}
-      case 0x78: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(js , js , /* prediction, */ imm); goto done;}
-      case 0x79: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jns, jns, /* prediction, */ imm); goto done;}
-      case 0x7A: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jpe, jpe, /* prediction, */ imm); goto done;}
-      case 0x7B: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jpo, jpo, /* prediction, */ imm); goto done;}
-      case 0x7C: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jl , jl , /* prediction, */ imm); goto done;}
-      case 0x7D: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jge, jge, /* prediction, */ imm); goto done;}
-      case 0x7E: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jle, jle, /* prediction, */ imm); goto done;}
-      case 0x7F: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jg , jg , /* prediction, */ imm); goto done;}
-      case 0x80: {getModRegRM(rmReturnNull, rmLegacyByte, SgAsmTypeByte::createType()); SgAsmExpression* imm = getImmByte(); insn = decodeGroup1(imm); goto done;}
+      case 0x70: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jo , jo , imm); goto done;}
+      case 0x71: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jno, jno, imm); goto done;}
+      case 0x72: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jb , jb , imm); goto done;}
+      case 0x73: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jae, jae, imm); goto done;}
+      case 0x74: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(je , je , imm); goto done;}
+      case 0x75: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jne, jne, imm); goto done;}
+      case 0x76: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jbe, jbe, imm); goto done;}
+      case 0x77: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(ja , ja , imm); goto done;}
+      case 0x78: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(js , js , imm); goto done;}
+      case 0x79: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jns, jns, imm); goto done;}
+      case 0x7A: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jpe, jpe, imm); goto done;}
+      case 0x7B: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jpo, jpo, imm); goto done;}
+      case 0x7C: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jl , jl , imm); goto done;}
+      case 0x7D: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jge, jge, imm); goto done;}
+      case 0x7E: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jle, jle, imm); goto done;}
+      case 0x7F: {SgAsmExpression* imm = getImmJb(); branchPredictionEnabled = true; insn = MAKE_INSN1(jg , jg , imm); goto done;}
+      case 0x80: {getModRegRM(rmReturnNull, rmLegacyByte, BYTET); SgAsmExpression* imm = getImmByte(); insn = decodeGroup1(imm); goto done;}
       case 0x81: {getModRegRM(rmReturnNull, effectiveOperandMode(), effectiveOperandType()); SgAsmExpression* imm = getImmIzAsIv(); insn = decodeGroup1(imm); goto done;}
-      case 0x82: {not64(); getModRegRM(rmReturnNull, rmLegacyByte, SgAsmTypeByte::createType()); SgAsmExpression* imm = getImmByte(); insn = decodeGroup1(imm); goto done;}
+      case 0x82: {not64(); getModRegRM(rmReturnNull, rmLegacyByte, BYTET); SgAsmExpression* imm = getImmByte(); insn = decodeGroup1(imm); goto done;}
       case 0x83: {getModRegRM(rmReturnNull, effectiveOperandMode(), effectiveOperandType()); SgAsmExpression* imm = getImmByteAsIv(); insn = decodeGroup1(imm); goto done;}
-      case 0x84: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(test, test, modrm, reg); goto done;}
+      case 0x84: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(test, test, modrm, reg); goto done;}
       case 0x85: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(test, test, modrm, reg); goto done;}
-      case 0x86: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(xchg, xchg, modrm, reg); goto done;}
+      case 0x86: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(xchg, xchg, modrm, reg); goto done;}
       case 0x87: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(xchg, xchg, modrm, reg); goto done;}
-      case 0x88: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(mov, mov, modrm, reg); goto done;}
+      case 0x88: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(mov, mov, modrm, reg); goto done;}
       case 0x89: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(mov, mov, modrm, reg); goto done;}
-      case 0x8A: {getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); insn = MAKE_INSN2(mov, mov, reg, modrm); goto done;}
+      case 0x8A: {getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); insn = MAKE_INSN2(mov, mov, reg, modrm); goto done;}
       case 0x8B: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); insn = MAKE_INSN2(mov, mov, reg, modrm); goto done;}
-      case 0x8C: {getModRegRM(rmSegment, effectiveOperandMode(), SgAsmTypeWord::createType()); insn = MAKE_INSN2(mov, mov, modrm, reg); goto done;}
+      case 0x8C: {getModRegRM(rmSegment, effectiveOperandMode(), WORDT); insn = MAKE_INSN2(mov, mov, modrm, reg); goto done;}
       case 0x8D: {getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); requireMemory(); insn = MAKE_INSN2(lea, lea, reg, modrm); goto done;}
-      case 0x8E: {getModRegRM(rmSegment, rmWord, SgAsmTypeWord::createType()); insn = MAKE_INSN2(mov, mov, reg, modrm); goto done;}
+      case 0x8E: {getModRegRM(rmSegment, rmWord, WORDT); insn = MAKE_INSN2(mov, mov, reg, modrm); goto done;}
       case 0x8F: {getModRegRM(rmReturnNull, effectiveOperandMode(), effectiveOperandType()); insn = decodeGroup1a(); goto done;}
       case 0x90: {
         if (rexB) {
@@ -927,9 +942,9 @@
       }
       case 0x9E: {insn = MAKE_INSN0(sahf, sahf); goto done;}
       case 0x9F: {insn = MAKE_INSN0(lahf, lahf); goto done;}
-      case 0xA0: {SgAsmExpression* addr = getImmForAddr(); insn = MAKE_INSN2(mov, mov, makeRegister(0, rmLegacyByte), makeMemoryReference(addr, currentDataSegment(), SgAsmTypeByte::createType())); goto done;}
+      case 0xA0: {SgAsmExpression* addr = getImmForAddr(); insn = MAKE_INSN2(mov, mov, makeRegister(0, rmLegacyByte), makeMemoryReference(addr, currentDataSegment(), BYTET)); goto done;}
       case 0xA1: {SgAsmExpression* addr = getImmForAddr(); insn = MAKE_INSN2(mov, mov, makeRegisterEffective(0), makeMemoryReference(addr, currentDataSegment(), effectiveOperandType())); goto done;}
-      case 0xA2: {SgAsmExpression* addr = getImmForAddr(); insn = MAKE_INSN2(mov, mov, makeMemoryReference(addr, currentDataSegment(), SgAsmTypeByte::createType()), makeRegister(0, rmLegacyByte)); goto done;}
+      case 0xA2: {SgAsmExpression* addr = getImmForAddr(); insn = MAKE_INSN2(mov, mov, makeMemoryReference(addr, currentDataSegment(), BYTET), makeRegister(0, rmLegacyByte)); goto done;}
       case 0xA3: {SgAsmExpression* addr = getImmForAddr(); insn = MAKE_INSN2(mov, mov, makeMemoryReference(addr, currentDataSegment(), effectiveOperandType()), makeRegisterEffective(0)); goto done;}
       case 0xA4: {
         switch (repeatPrefix) {
@@ -1107,13 +1122,13 @@
       case 0xBD: {SgAsmExpression* imm = getImmIv(); insn = MAKE_INSN2(mov, mov, makeRegisterEffective(rexB, 5), imm); goto done;}
       case 0xBE: {SgAsmExpression* imm = getImmIv(); insn = MAKE_INSN2(mov, mov, makeRegisterEffective(rexB, 6), imm); goto done;}
       case 0xBF: {SgAsmExpression* imm = getImmIv(); insn = MAKE_INSN2(mov, mov, makeRegisterEffective(rexB, 7), imm); goto done;}
-      case 0xC0: {getModRegRM(rmReturnNull, rmLegacyByte, SgAsmTypeByte::createType()); SgAsmExpression* imm = getImmByte(); insn = decodeGroup2(imm); goto done;}
+      case 0xC0: {getModRegRM(rmReturnNull, rmLegacyByte, BYTET); SgAsmExpression* imm = getImmByte(); insn = decodeGroup2(imm); goto done;}
       case 0xC1: {getModRegRM(rmReturnNull, effectiveOperandMode(), effectiveOperandType()); SgAsmExpression* imm = getImmByteAsIv(); insn = decodeGroup2(imm); goto done;}
       case 0xC2: {isUnconditionalJump = true; SgAsmExpression* imm = getImmWord(); insn = MAKE_INSN1(ret, ret, imm); goto done;}
       case 0xC3: {isUnconditionalJump = true; insn = MAKE_INSN0(ret, ret); goto done;}
       case 0xC4: {not64(); getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); requireMemory(); insn = MAKE_INSN2(les, les, reg, modrm); goto done;}
       case 0xC5: {not64(); getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); requireMemory(); insn = MAKE_INSN2(lds, lds, reg, modrm); goto done;}
-      case 0xC6: {getModRegRM(rmReturnNull, rmLegacyByte, SgAsmTypeByte::createType()); SgAsmExpression* imm = getImmByte(); insn = decodeGroup11(imm); goto done;}
+      case 0xC6: {getModRegRM(rmReturnNull, rmLegacyByte, BYTET); SgAsmExpression* imm = getImmByte(); insn = decodeGroup11(imm); goto done;}
       case 0xC7: {getModRegRM(rmReturnNull, effectiveOperandMode(), effectiveOperandType()); SgAsmExpression* imm = getImmIzAsIv(); insn = decodeGroup11(imm); goto done;}
       case 0xC8: {SgAsmExpression* immw; {SgAsmExpression* imm = getImmWord(); immw = imm;} SgAsmExpression* imm = getImmByte(); insn = MAKE_INSN2(enter, enter, immw, imm); goto done;}
       case 0xC9: {insn = MAKE_INSN0(leave, leave); goto done;}
@@ -1123,9 +1138,9 @@
       case 0xCD: {SgAsmExpression* imm = getImmByte(); insn = MAKE_INSN1(int, int, imm); goto done;}
       case 0xCE: {not64(); insn = MAKE_INSN0(into, into); goto done;}
       case 0xCF: {isUnconditionalJump = true; insn = MAKE_INSN0(iret, iret); goto done;}
-      case 0xD0: {getModRegRM(rmReturnNull, rmLegacyByte, SgAsmTypeByte::createType()); insn = decodeGroup2(makeByteValue(1)); goto done;}
+      case 0xD0: {getModRegRM(rmReturnNull, rmLegacyByte, BYTET); insn = decodeGroup2(makeByteValue(1)); goto done;}
       case 0xD1: {getModRegRM(rmReturnNull, effectiveOperandMode(), effectiveOperandType()); insn = decodeGroup2(makeByteValue(1)); goto done;}
-      case 0xD2: {getModRegRM(rmReturnNull, rmLegacyByte, SgAsmTypeByte::createType()); insn = decodeGroup2(makeRegister(1, rmLegacyByte)); goto done;}
+      case 0xD2: {getModRegRM(rmReturnNull, rmLegacyByte, BYTET); insn = decodeGroup2(makeRegister(1, rmLegacyByte)); goto done;}
       case 0xD3: {getModRegRM(rmReturnNull, effectiveOperandMode(), effectiveOperandType()); insn = decodeGroup2(makeRegister(1, rmLegacyByte)); goto done;}
       case 0xD4: {not64(); SgAsmExpression* imm = getImmByte(); insn = MAKE_INSN1(aam, aam, imm); goto done;}
       case 0xD5: {not64(); SgAsmExpression* imm = getImmByte(); insn = MAKE_INSN1(aad, aad, imm); goto done;}
@@ -1139,16 +1154,16 @@
       case 0xDD: {insn = decodeX87InstructionDD(); goto done;}
       case 0xDE: {insn = decodeX87InstructionDE(); goto done;}
       case 0xDF: {insn = decodeX87InstructionDF(); goto done;}
-      case 0xE0: {SgAsmExpression* imm = getImmJb(); insn = MAKE_INSN1(loopnz, loopnz, /* prediction, */ imm); goto done;}
-      case 0xE1: {SgAsmExpression* imm = getImmJb(); insn = MAKE_INSN1(loopz, loopz, /* prediction, */ imm); goto done;}
-      case 0xE2: {SgAsmExpression* imm = getImmJb(); insn = MAKE_INSN1(loop, loop, /* prediction, */ imm); goto done;}
+      case 0xE0: {SgAsmExpression* imm = getImmJb(); insn = MAKE_INSN1(loopnz, loopnz, imm); goto done;}
+      case 0xE1: {SgAsmExpression* imm = getImmJb(); insn = MAKE_INSN1(loopz, loopz, imm); goto done;}
+      case 0xE2: {SgAsmExpression* imm = getImmJb(); insn = MAKE_INSN1(loop, loop, imm); goto done;}
       case 0xE3: {
         SgAsmExpression* imm = getImmJb();
         branchPredictionEnabled = true;
         switch (effectiveOperandSize()) {
-          case x86_insnsize_16: insn = MAKE_INSN1(jcxz, jcxz, /* prediction, */ imm); goto done;
-          case x86_insnsize_32: insn = MAKE_INSN1(jecxz, jecxz, /* prediction, */ imm); goto done;
-          case x86_insnsize_64: insn = MAKE_INSN1(jrcxz, jrcxz, /* prediction, */ imm); goto done;
+          case x86_insnsize_16: insn = MAKE_INSN1(jcxz, jcxz, imm); goto done;
+          case x86_insnsize_32: insn = MAKE_INSN1(jecxz, jecxz, imm); goto done;
+          case x86_insnsize_64: insn = MAKE_INSN1(jrcxz, jrcxz, imm); goto done;
           default: ROSE_ASSERT (false);
         }
       }
@@ -1170,7 +1185,7 @@
       case 0xF3: {repeatPrefix = rpRepe; insn = disassemble(); goto done;}
       case 0xF4: {insn = MAKE_INSN0(hlt, hlt); isUnconditionalJump = true; goto done;}
       case 0xF5: {insn = MAKE_INSN0(cmc, cmc); goto done;}
-      case 0xF6: {getModRegRM(rmReturnNull, rmLegacyByte, SgAsmTypeByte::createType()); SgAsmExpression* immMaybe = NULL; if (regField <= 1) {SgAsmExpression* imm = getImmByteAsIv(); immMaybe = imm;}; insn = decodeGroup3(immMaybe); goto done;}
+      case 0xF6: {getModRegRM(rmReturnNull, rmLegacyByte, BYTET); SgAsmExpression* immMaybe = NULL; if (regField <= 1) {SgAsmExpression* imm = getImmByteAsIv(); immMaybe = imm;}; insn = decodeGroup3(immMaybe); goto done;}
       case 0xF7: {getModRegRM(rmReturnNull, effectiveOperandMode(), effectiveOperandType()); SgAsmExpression* immMaybe = NULL; if (regField <= 1) {SgAsmExpression* imm = getImmIzAsIv(); immMaybe = imm;}; insn = decodeGroup3(immMaybe); goto done;}
       case 0xF8: {insn = MAKE_INSN0(clc, clc); goto done;}
       case 0xF9: {insn = MAKE_INSN0(stc, stc); goto done;}
@@ -1178,7 +1193,7 @@
       case 0xFB: {insn = MAKE_INSN0(sti, sti); goto done;}
       case 0xFC: {insn = MAKE_INSN0(cld, cld); goto done;}
       case 0xFD: {insn = MAKE_INSN0(std, std); goto done;}
-      case 0xFE: {getModRegRM(rmReturnNull, rmLegacyByte, SgAsmTypeByte::createType()); insn = decodeGroup4(); goto done;}
+      case 0xFE: {getModRegRM(rmReturnNull, rmLegacyByte, BYTET); insn = decodeGroup4(); goto done;}
       case 0xFF: {
         getModRegRM(rmReturnNull, rmReturnNull, NULL);
         if (regField >= 2 && regField <= 6) {sizeMustBe64Bit = true;}
@@ -1196,9 +1211,9 @@
   }
 
   SgAsmx86Instruction* SingleInstructionDisassembler::decodeX87InstructionD8() {
-    getModRegRM(rmReturnNull, rmST, SgAsmTypeSingleFloat::createType());
+    getModRegRM(rmReturnNull, rmST, FLOATT);
     if (isSgAsmMemoryReferenceExpression(modrm)) {
-      isSgAsmMemoryReferenceExpression(modrm)->set_type(SgAsmTypeSingleFloat::createType());
+      isSgAsmMemoryReferenceExpression(modrm)->set_type(FLOATT);
     }
     if (modregrmByte < 0xC0) { // Using memory
       switch (regField) {
@@ -1233,14 +1248,14 @@
       SgAsmMemoryReferenceExpression* mr = isSgAsmMemoryReferenceExpression(modrm);
       ROSE_ASSERT (mr);
       switch (regField) {
-        case 0: mr->set_type(SgAsmTypeSingleFloat::createType()); return MAKE_INSN1(fld, fld, modrm);
+        case 0: mr->set_type(FLOATT); return MAKE_INSN1(fld, fld, modrm);
         case 1: throw BadInstruction();
-        case 2: mr->set_type(SgAsmTypeSingleFloat::createType()); return MAKE_INSN1(fst, fst, modrm);
-        case 3: mr->set_type(SgAsmTypeSingleFloat::createType()); return MAKE_INSN1(fstp, fstp, modrm);
-        case 4: mr->set_type(SgAsmTypeByte::createType()); return MAKE_INSN1(fldenv, fldenv, modrm);
-        case 5: mr->set_type(SgAsmTypeWord::createType()); return MAKE_INSN1(fldcw, fldcw, modrm);
-        case 6: mr->set_type(SgAsmTypeByte::createType()); return MAKE_INSN1(fnstenv, fnstenv, modrm);
-        case 7: mr->set_type(SgAsmTypeWord::createType()); return MAKE_INSN1(fnstcw, fnstcw, modrm);
+        case 2: mr->set_type(FLOATT); return MAKE_INSN1(fst, fst, modrm);
+        case 3: mr->set_type(FLOATT); return MAKE_INSN1(fstp, fstp, modrm);
+        case 4: mr->set_type(BYTET); return MAKE_INSN1(fldenv, fldenv, modrm);
+        case 5: mr->set_type(WORDT); return MAKE_INSN1(fldcw, fldcw, modrm);
+        case 6: mr->set_type(BYTET); return MAKE_INSN1(fnstenv, fnstenv, modrm);
+        case 7: mr->set_type(WORDT); return MAKE_INSN1(fnstcw, fnstcw, modrm);
         default: ROSE_ASSERT (false);
       }
     } else if (regField == 0 || regField == 1) { // FLD and FXCH on registers
@@ -1286,7 +1301,7 @@
   }
 
   SgAsmx86Instruction* SingleInstructionDisassembler::decodeX87InstructionDA() {
-    getModRegRM(rmReturnNull, rmReturnNull, SgAsmTypeDoubleWord::createType());
+    getModRegRM(rmReturnNull, rmReturnNull, DWORDT);
     if (modeField < 3) {
       switch (regField) {
         case 0: return MAKE_INSN1(fiadd, fiadd, modrm);
@@ -1322,9 +1337,9 @@
       SgAsmMemoryReferenceExpression* mr = isSgAsmMemoryReferenceExpression(modrm);
       ROSE_ASSERT (mr);
       if (regField <= 3) {
-        mr->set_type(SgAsmTypeDoubleWord::createType());
+        mr->set_type(DWORDT);
       } else {
-        mr->set_type(SgAsmType80bitFloat::createType());
+        mr->set_type(LDOUBLET);
       }
       switch (regField) {
         case 0: return MAKE_INSN1(fild, fild, modrm);
@@ -1358,7 +1373,7 @@
   }
 
   SgAsmx86Instruction* SingleInstructionDisassembler::decodeX87InstructionDC() {
-    getModRegRM(rmReturnNull, rmST, SgAsmTypeDoubleFloat::createType());
+    getModRegRM(rmReturnNull, rmST, DOUBLET);
     if (modeField < 3) { // Using memory
       switch (regField & 7) {
         case 0: return MAKE_INSN1(fadd, fadd, modrm);
@@ -1392,14 +1407,14 @@
       SgAsmMemoryReferenceExpression* mr = isSgAsmMemoryReferenceExpression(modrm);
       ROSE_ASSERT (mr);
       switch (regField) {
-        case 0: mr->set_type(SgAsmTypeDoubleFloat::createType()); return MAKE_INSN1(fld, fld, modrm);
-        case 1: mr->set_type(SgAsmTypeQuadWord::createType()); return MAKE_INSN1(fisttp, fisttp, modrm);
-        case 2: mr->set_type(SgAsmTypeDoubleFloat::createType()); return MAKE_INSN1(fst, fst, modrm);
-        case 3: mr->set_type(SgAsmTypeDoubleFloat::createType()); return MAKE_INSN1(fstp, fstp, modrm);
-        case 4: mr->set_type(SgAsmTypeByte::createType()); return MAKE_INSN1(frstor, frstor, modrm);
+        case 0: mr->set_type(DOUBLET); return MAKE_INSN1(fld, fld, modrm);
+        case 1: mr->set_type(QWORDT); return MAKE_INSN1(fisttp, fisttp, modrm);
+        case 2: mr->set_type(DOUBLET); return MAKE_INSN1(fst, fst, modrm);
+        case 3: mr->set_type(DOUBLET); return MAKE_INSN1(fstp, fstp, modrm);
+        case 4: mr->set_type(BYTET); return MAKE_INSN1(frstor, frstor, modrm);
         case 5: throw BadInstruction();
-        case 6: mr->set_type(SgAsmTypeByte::createType()); return MAKE_INSN1(fnsave, fnsave, modrm);
-        case 7: mr->set_type(SgAsmTypeWord::createType()); return MAKE_INSN1(fnstsw, fnstsw, modrm);
+        case 6: mr->set_type(BYTET); return MAKE_INSN1(fnsave, fnsave, modrm);
+        case 7: mr->set_type(WORDT); return MAKE_INSN1(fnstsw, fnstsw, modrm);
         default: ROSE_ASSERT (false);
       }
     } else { // Register forms
@@ -1418,7 +1433,7 @@
   }
 
   SgAsmx86Instruction* SingleInstructionDisassembler::decodeX87InstructionDE() {
-    getModRegRM(rmReturnNull, rmST, SgAsmTypeWord::createType());
+    getModRegRM(rmReturnNull, rmST, WORDT);
     if (modeField < 3) { // Using memory
       switch (regField & 7) {
         case 0: return MAKE_INSN1(fiadd, fiadd, modrm);
@@ -1457,14 +1472,14 @@
       SgAsmMemoryReferenceExpression* mr = isSgAsmMemoryReferenceExpression(modrm);
       ROSE_ASSERT (mr);
       switch (regField) {
-        case 0: mr->set_type(SgAsmTypeWord::createType()); return MAKE_INSN1(fild, fild, modrm);
-        case 1: mr->set_type(SgAsmTypeWord::createType()); return MAKE_INSN1(fisttp, fisttp, modrm);
-        case 2: mr->set_type(SgAsmTypeWord::createType()); return MAKE_INSN1(fist, fist, modrm);
-        case 3: mr->set_type(SgAsmTypeWord::createType()); return MAKE_INSN1(fistp, fistp, modrm);
-        case 4: mr->set_type(SgAsmTypeByte::createType()); return MAKE_INSN1(fbld, fbld, modrm);
-        case 5: mr->set_type(SgAsmTypeQuadWord::createType()); return MAKE_INSN1(fild, fild, modrm);
-        case 6: mr->set_type(SgAsmTypeByte::createType()); return MAKE_INSN1(fbstp, fbstp, modrm);
-        case 7: mr->set_type(SgAsmTypeQuadWord::createType()); return MAKE_INSN1(fistp, fistp, modrm);
+        case 0: mr->set_type(WORDT); return MAKE_INSN1(fild, fild, modrm);
+        case 1: mr->set_type(WORDT); return MAKE_INSN1(fisttp, fisttp, modrm);
+        case 2: mr->set_type(WORDT); return MAKE_INSN1(fist, fist, modrm);
+        case 3: mr->set_type(WORDT); return MAKE_INSN1(fistp, fistp, modrm);
+        case 4: mr->set_type(BYTET); return MAKE_INSN1(fbld, fbld, modrm);
+        case 5: mr->set_type(QWORDT); return MAKE_INSN1(fild, fild, modrm);
+        case 6: mr->set_type(BYTET); return MAKE_INSN1(fbstp, fbstp, modrm);
+        case 7: mr->set_type(QWORDT); return MAKE_INSN1(fistp, fistp, modrm);
         default: ROSE_ASSERT (false);
       }
     } else {
@@ -1493,10 +1508,10 @@
     uint8_t opcode;
     getByte(opcode);
     switch (opcode) {
-      case 0x00: {getModRegRM(rmReturnNull, rmWord, SgAsmTypeWord::createType()); return decodeGroup6();}
+      case 0x00: {getModRegRM(rmReturnNull, rmWord, WORDT); return decodeGroup6();}
       case 0x01: return decodeGroup7();
-      case 0x02: {getModRegRM(rmWord, rmWord, SgAsmTypeWord::createType()); return MAKE_INSN2(lar, lar, reg, modrm);}
-      case 0x03: {getModRegRM(rmWord, rmWord, SgAsmTypeWord::createType()); return MAKE_INSN2(lsl, lsl, reg, modrm);}
+      case 0x02: {getModRegRM(rmWord, rmWord, WORDT); return MAKE_INSN2(lar, lar, reg, modrm);}
+      case 0x03: {getModRegRM(rmWord, rmWord, WORDT); return MAKE_INSN2(lsl, lsl, reg, modrm);}
       case 0x04: throw BadInstruction();
       case 0x05: return MAKE_INSN0(syscall, syscall);
       case 0x06: return MAKE_INSN0(clts, clts);
@@ -1515,30 +1530,30 @@
         if (thirdOpcodeByte < 0x80) { // Conversions
           switch (thirdOpcodeByte) {
             case 0x0C: {
-              fillInModRM(rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); 
-              reg = makeModrmRegister(rmMM, SgAsmTypeVector::createType(2, SgAsmTypeSingleFloat::createType()));
+              fillInModRM(rmMM, V4WORDT); 
+              reg = makeModrmRegister(rmMM, V2FLOATT);
               return MAKE_INSN2(pi2fw, pi2fw, reg, modrm);
             }
             case 0x0D: {
-              fillInModRM(rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); 
-              reg = makeModrmRegister(rmMM, SgAsmTypeVector::createType(2, SgAsmTypeSingleFloat::createType()));
+              fillInModRM(rmMM, V2DWORDT); 
+              reg = makeModrmRegister(rmMM, V2FLOATT);
               return MAKE_INSN2(pi2fd, pi2fd, reg, modrm);
             }
             case 0x1C: {
-              fillInModRM(rmMM, SgAsmTypeVector::createType(2, SgAsmTypeSingleFloat::createType())); 
-              reg = makeModrmRegister(rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType()));
+              fillInModRM(rmMM, V2FLOATT); 
+              reg = makeModrmRegister(rmMM, V4WORDT);
               return MAKE_INSN2(pf2iw, pf2iw, reg, modrm);
             }
             case 0x1D: {
-              fillInModRM(rmMM, SgAsmTypeVector::createType(2, SgAsmTypeSingleFloat::createType())); 
-              reg = makeModrmRegister(rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()));
+              fillInModRM(rmMM, V2FLOATT); 
+              reg = makeModrmRegister(rmMM, V2DWORDT);
               return MAKE_INSN2(pf2id, pf2id, reg, modrm);
             }
             default: throw BadInstruction();
           }
         } else if (thirdOpcodeByte < 0xB7) { // Floating-point operations
-          fillInModRM(rmMM, SgAsmTypeVector::createType(2, SgAsmTypeSingleFloat::createType()));
-          reg = makeModrmRegister(rmMM, SgAsmTypeVector::createType(2, SgAsmTypeSingleFloat::createType()));
+          fillInModRM(rmMM, V2FLOATT);
+          reg = makeModrmRegister(rmMM, V2FLOATT);
           switch (thirdOpcodeByte) {
             case 0x8A: return MAKE_INSN2(pfnacc, pfnacc, reg, modrm);
             case 0x8E: return MAKE_INSN2(pfpnacc, pfpnacc, reg, modrm);
@@ -1561,78 +1576,78 @@
           }
         } else { // Extra integer operations
           switch (thirdOpcodeByte) {
-            case 0xB7: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(pmulhrw, pmulhrw, reg, modrm);
-            case 0xBB: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(pswapd, pswapd, reg, modrm);
-            case 0xBF: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(pavgusb, pavgusb, reg, modrm);
+            case 0xB7: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(pmulhrw, pmulhrw, reg, modrm);
+            case 0xBB: getModRegRM(rmMM, rmMM, V2DWORDT); return MAKE_INSN2(pswapd, pswapd, reg, modrm);
+            case 0xBF: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(pavgusb, pavgusb, reg, modrm);
             default: throw BadInstruction();
           }
         }
       }
       case 0x10: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(movups, movups, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(movss, movss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(movupd, movupd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(movsd_sse, movsd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(movups, movups, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(movss, movss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(movupd, movupd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(movsd_sse, movsd, reg, modrm);
         }
       }
       case 0x11: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(movups, movups, modrm, reg);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(movss, movss, modrm, reg);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(movupd, movupd, modrm, reg);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(movsd_sse, movsd, modrm, reg);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(movups, movups, modrm, reg);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(movss, movss, modrm, reg);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(movupd, movupd, modrm, reg);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(movsd_sse, movsd, modrm, reg);
         }
       }
       case 0x12: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); if (modeField == 3) return MAKE_INSN2(movhlps, movhlps, reg, modrm); else return MAKE_INSN2(movlps, movlps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(movsldup, movsldup, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); requireMemory(); return MAKE_INSN2(movlpd, movlpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(movddup, movddup, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); if (modeField == 3) return MAKE_INSN2(movhlps, movhlps, reg, modrm); else return MAKE_INSN2(movlps, movlps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(movsldup, movsldup, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DOUBLET); requireMemory(); return MAKE_INSN2(movlpd, movlpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(movddup, movddup, reg, modrm);
         }
       }
       case 0x13: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); requireMemory(); return MAKE_INSN2(movlps, movlps, modrm, reg);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); requireMemory(); return MAKE_INSN2(movlps, movlps, modrm, reg);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); requireMemory(); return MAKE_INSN2(movlpd, movlpd, modrm, reg);
+          case mm66: getModRegRM(rmXMM, rmXMM, DOUBLET); requireMemory(); return MAKE_INSN2(movlpd, movlpd, modrm, reg);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x14: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeSingleFloat::createType()), SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(unpcklps, unpcklps, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V2FLOATT, V4FLOATT); return MAKE_INSN2(unpcklps, unpcklps, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType(), SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(unpcklpd, unpcklpd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DOUBLET, V2DOUBLET); return MAKE_INSN2(unpcklpd, unpcklpd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x15: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeSingleFloat::createType()), SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(unpckhps, unpckhps, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V2FLOATT, V4FLOATT); return MAKE_INSN2(unpckhps, unpckhps, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType(), SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(unpckhpd, unpckhpd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DOUBLET, V2DOUBLET); return MAKE_INSN2(unpckhpd, unpckhpd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x16: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); if (modeField == 3) return MAKE_INSN2(movlhps, movlhps, reg, modrm); else return MAKE_INSN2(movhps, movhps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(movshdup, movshdup, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); requireMemory(); return MAKE_INSN2(movhpd, movhpd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); if (modeField == 3) return MAKE_INSN2(movlhps, movlhps, reg, modrm); else return MAKE_INSN2(movhps, movhps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(movshdup, movshdup, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DOUBLET); requireMemory(); return MAKE_INSN2(movhpd, movhpd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x17: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); requireMemory(); return MAKE_INSN2(movhps, movhps, modrm, reg);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); requireMemory(); return MAKE_INSN2(movhps, movhps, modrm, reg);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); requireMemory(); return MAKE_INSN2(movhpd, movhpd, modrm, reg);
+          case mm66: getModRegRM(rmXMM, rmXMM, DOUBLET); requireMemory(); return MAKE_INSN2(movhpd, movhpd, modrm, reg);
           case mmF2: throw BadInstruction();
         }
       }
-      case 0x18: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return decodeGroup16();
+      case 0x18: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return decodeGroup16();
       case 0x19: getModRegRM(rmReturnNull, rmReturnNull, NULL); return MAKE_INSN0(nop, nop);
       case 0x1A: getModRegRM(rmReturnNull, rmReturnNull, NULL); return MAKE_INSN0(nop, nop);
       case 0x1B: getModRegRM(rmReturnNull, rmReturnNull, NULL); return MAKE_INSN0(nop, nop);
@@ -1650,66 +1665,66 @@
       case 0x27: throw BadInstruction();
       case 0x28: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(movaps, movaps, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(movaps, movaps, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(movapd, movapd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(movapd, movapd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x29: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(movaps, movaps, modrm, reg);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(movaps, movaps, modrm, reg);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(movapd, movapd, modrm, reg);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(movapd, movapd, modrm, reg);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x2A: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()), SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(cvtpi2ps, cvtpi2ps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, effectiveOperandMode(), effectiveOperandType(), SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(cvtsi2ss, cvtsi2ss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(cvtpi2pd, cvtpi2pd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, effectiveOperandMode(), effectiveOperandType(), SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(cvtsi2sd, cvtsi2sd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmMM, V2DWORDT, V4FLOATT); return MAKE_INSN2(cvtpi2ps, cvtpi2ps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, effectiveOperandMode(), effectiveOperandType(), V4FLOATT); return MAKE_INSN2(cvtsi2ss, cvtsi2ss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmMM, V2DWORDT, V2DOUBLET); return MAKE_INSN2(cvtpi2pd, cvtpi2pd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, effectiveOperandMode(), effectiveOperandType(), V2DOUBLET); return MAKE_INSN2(cvtsi2sd, cvtsi2sd, reg, modrm);
         }
       }
       case 0x2B: {
         requireMemory();
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(movntps, movntps, modrm, reg);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(movntss, movntss, modrm, reg);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(movntpd, movntpd, modrm, reg);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(movntsd, movntsd, modrm, reg);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(movntps, movntps, modrm, reg);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(movntss, movntss, modrm, reg);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(movntpd, movntpd, modrm, reg);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(movntsd, movntsd, modrm, reg);
         }
       }
       case 0x2C: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(cvttps2pi, cvttps2pi, reg, modrm);
-          case mmF3: getModRegRM(effectiveOperandMode(), rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType()), effectiveOperandType()); return MAKE_INSN2(cvttss2si, cvttss2si, reg, modrm);
-          case mm66: getModRegRM(rmMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(cvttpd2pi, cvttpd2pi, reg, modrm);
-          case mmF2: getModRegRM(effectiveOperandMode(), rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType()), effectiveOperandType()); return MAKE_INSN2(cvttsd2si, cvttsd2si, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmXMM, V4FLOATT, V2DWORDT); return MAKE_INSN2(cvttps2pi, cvttps2pi, reg, modrm);
+          case mmF3: getModRegRM(effectiveOperandMode(), rmXMM, V4FLOATT, effectiveOperandType()); return MAKE_INSN2(cvttss2si, cvttss2si, reg, modrm);
+          case mm66: getModRegRM(rmMM, rmXMM, V2DOUBLET, V2DWORDT); return MAKE_INSN2(cvttpd2pi, cvttpd2pi, reg, modrm);
+          case mmF2: getModRegRM(effectiveOperandMode(), rmXMM, V2DOUBLET, effectiveOperandType()); return MAKE_INSN2(cvttsd2si, cvttsd2si, reg, modrm);
         }
       }
       case 0x2D: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(cvtps2pi, cvtps2pi, reg, modrm);
-          case mmF3: getModRegRM(effectiveOperandMode(), rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType()), effectiveOperandType()); return MAKE_INSN2(cvtss2si, cvtss2si, reg, modrm);
-          case mm66: getModRegRM(rmMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(cvtpd2pi, cvtpd2pi, reg, modrm);
-          case mmF2: getModRegRM(effectiveOperandMode(), rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType()), effectiveOperandType()); return MAKE_INSN2(cvtsd2si, cvtsd2si, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmXMM, V4FLOATT, V2DWORDT); return MAKE_INSN2(cvtps2pi, cvtps2pi, reg, modrm);
+          case mmF3: getModRegRM(effectiveOperandMode(), rmXMM, V4FLOATT, effectiveOperandType()); return MAKE_INSN2(cvtss2si, cvtss2si, reg, modrm);
+          case mm66: getModRegRM(rmMM, rmXMM, V2DOUBLET, V2DWORDT); return MAKE_INSN2(cvtpd2pi, cvtpd2pi, reg, modrm);
+          case mmF2: getModRegRM(effectiveOperandMode(), rmXMM, V2DOUBLET, effectiveOperandType()); return MAKE_INSN2(cvtsd2si, cvtsd2si, reg, modrm);
         }
       }
       case 0x2E: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(ucomiss, ucomiss, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(ucomiss, ucomiss, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(ucomisd, ucomisd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(ucomisd, ucomisd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x2F: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(comiss, comiss, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(comiss, comiss, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(comisd, comisd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(comisd, comisd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
@@ -1747,225 +1762,225 @@
       case 0x4F: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); return MAKE_INSN2(cmovg, cmovg, reg, modrm);
       case 0x50: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmDWord, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); if (modeField == 3) return MAKE_INSN2(movmskps, movmskps, reg, modrm); else throw BadInstruction();
+          case mmNone: getModRegRM(rmDWord, rmXMM, V4FLOATT); if (modeField == 3) return MAKE_INSN2(movmskps, movmskps, reg, modrm); else throw BadInstruction();
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmDWord, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); if (modeField == 3) return MAKE_INSN2(movmskpd, movmskpd, reg, modrm); else throw BadInstruction();
+          case mm66: getModRegRM(rmDWord, rmXMM, V2DOUBLET); if (modeField == 3) return MAKE_INSN2(movmskpd, movmskpd, reg, modrm); else throw BadInstruction();
           case mmF2: throw BadInstruction();
         }
       }
       case 0x51: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(sqrtps, sqrtps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(sqrtss, sqrtss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(sqrtpd, sqrtpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(sqrtsd, sqrtsd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(sqrtps, sqrtps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(sqrtss, sqrtss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(sqrtpd, sqrtpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(sqrtsd, sqrtsd, reg, modrm);
         }
       }
       case 0x52: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(rsqrtps, rsqrtps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(rsqrtss, rsqrtss, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(rsqrtps, rsqrtps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(rsqrtss, rsqrtss, reg, modrm);
           case mm66: throw BadInstruction();
           case mmF2: throw BadInstruction();
         }
       }
       case 0x53: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(rcpps, rcpps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(rcpss, rcpss, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(rcpps, rcpps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(rcpss, rcpss, reg, modrm);
           case mm66: throw BadInstruction();
           case mmF2: throw BadInstruction();
         }
       }
       case 0x54: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(andps, andps, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(andps, andps, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(andpd, andpd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(andpd, andpd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x55: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(andnps, andnps, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(andnps, andnps, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(andnpd, andnpd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(andnpd, andnpd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x56: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(orps, orps, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(orps, orps, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(orpd, orpd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(orpd, orpd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x57: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(xorps, xorps, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(xorps, xorps, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(xorpd, xorpd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(xorpd, xorpd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x58: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(addps, addps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(addss, addss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(addpd, addpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(addsd, addsd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(addps, addps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(addss, addss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(addpd, addpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(addsd, addsd, reg, modrm);
         }
       }
       case 0x59: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(mulps, mulps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(mulss, mulss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(mulpd, mulpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(mulsd, mulsd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(mulps, mulps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(mulss, mulss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(mulpd, mulpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(mulsd, mulsd, reg, modrm);
         }
       }
       case 0x5A: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(cvtps2pd, cvtps2pd, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType(), SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(cvtss2sd, cvtss2sd, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType()), SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(cvtpd2ps, cvtpd2ps, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType(), SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(cvtsd2ss, cvtsd2ss, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT, V2DOUBLET); return MAKE_INSN2(cvtps2pd, cvtps2pd, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT, V2DOUBLET); return MAKE_INSN2(cvtss2sd, cvtss2sd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET, V4FLOATT); return MAKE_INSN2(cvtpd2ps, cvtpd2ps, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET, V4FLOATT); return MAKE_INSN2(cvtsd2ss, cvtsd2ss, reg, modrm);
         }
       }
       case 0x5B: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType()), SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(cvtdq2ps, cvtdq2ps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType()), SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(cvttps2dq, cvttps2dq, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType()), SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(cvtps2dq, cvtps2dq, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4DWORDT, V4FLOATT); return MAKE_INSN2(cvtdq2ps, cvtdq2ps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, V4FLOATT, V4DWORDT); return MAKE_INSN2(cvttps2dq, cvttps2dq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4FLOATT, V4DWORDT); return MAKE_INSN2(cvtps2dq, cvtps2dq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x5C: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(subps, subps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(subss, subss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(subpd, subpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(subsd, subsd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(subps, subps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(subss, subss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(subpd, subpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(subsd, subsd, reg, modrm);
         }
       }
       case 0x5D: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(minps, minps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(minss, minss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(minpd, minpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(minsd, minsd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(minps, minps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(minss, minss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(minpd, minpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(minsd, minsd, reg, modrm);
         }
       }
       case 0x5E: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(divps, divps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(divss, divss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(divpd, divpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(divsd, divsd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(divps, divps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(divss, divss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(divpd, divpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(divsd, divsd, reg, modrm);
         }
       }
       case 0x5F: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(maxps, maxps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(maxss, maxss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(maxpd, maxpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(maxsd, maxsd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(maxps, maxps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(maxss, maxss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(maxpd, maxpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(maxsd, maxsd, reg, modrm);
         }
       }
       case 0x60: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType()), SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(punpcklbw, punpcklbw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET, V4WORDT); return MAKE_INSN2(punpcklbw, punpcklbw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType()), SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(punpcklbw, punpcklbw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET, V8WORDT); return MAKE_INSN2(punpcklbw, punpcklbw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x61: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(punpcklwd, punpcklwd, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT, V2DWORDT); return MAKE_INSN2(punpcklwd, punpcklwd, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(punpcklwd, punpcklwd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT, V4DWORDT); return MAKE_INSN2(punpcklwd, punpcklwd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x62: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()), SgAsmTypeQuadWord::createType()); return MAKE_INSN2(punpckldq, punpckldq, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT, QWORDT); return MAKE_INSN2(punpckldq, punpckldq, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType()), SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(punpckldq, punpckldq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT, V2QWORDT); return MAKE_INSN2(punpckldq, punpckldq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x63: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(packsswb, packsswb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT, V8BYTET); return MAKE_INSN2(packsswb, packsswb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(packsswb, packsswb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT, V16BYTET); return MAKE_INSN2(packsswb, packsswb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x64: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(pcmpgtb, pcmpgtb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(pcmpgtb, pcmpgtb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(pcmpgtb, pcmpgtb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(pcmpgtb, pcmpgtb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x65: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(pcmpgtw, pcmpgtw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(pcmpgtw, pcmpgtw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(pcmpgtw, pcmpgtw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(pcmpgtw, pcmpgtw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x66: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(pcmpgtd, pcmpgtd, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT); return MAKE_INSN2(pcmpgtd, pcmpgtd, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(pcmpgtd, pcmpgtd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT); return MAKE_INSN2(pcmpgtd, pcmpgtd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x67: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(packuswb, packuswb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT, V8BYTET); return MAKE_INSN2(packuswb, packuswb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(packuswb, packuswb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT, V16BYTET); return MAKE_INSN2(packuswb, packuswb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x68: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType()), SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(punpckhbw, punpckhbw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET, V4WORDT); return MAKE_INSN2(punpckhbw, punpckhbw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType()), SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(punpckhbw, punpckhbw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET, V8WORDT); return MAKE_INSN2(punpckhbw, punpckhbw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x69: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(punpckhwd, punpckhwd, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT, V2DWORDT); return MAKE_INSN2(punpckhwd, punpckhwd, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(punpckhwd, punpckhwd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT, V4DWORDT); return MAKE_INSN2(punpckhwd, punpckhwd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x6A: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()), SgAsmTypeQuadWord::createType()); return MAKE_INSN2(punpckhdq, punpckhdq, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT, QWORDT); return MAKE_INSN2(punpckhdq, punpckhdq, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType()), SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(punpckhdq, punpckhdq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT, V2QWORDT); return MAKE_INSN2(punpckhdq, punpckhdq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x6B: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()), SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(packssdw, packssdw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT, V4WORDT); return MAKE_INSN2(packssdw, packssdw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType()), SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(packssdw, packssdw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT, V8WORDT); return MAKE_INSN2(packssdw, packssdw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
@@ -1973,7 +1988,7 @@
         switch (mmPrefix()) {
           case mmNone: throw BadInstruction();
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType()), SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(punpcklqdq, punpcklqdq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2QWORDT, DQWORDT); return MAKE_INSN2(punpcklqdq, punpcklqdq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
@@ -1981,38 +1996,38 @@
         switch (mmPrefix()) {
           case mmNone: throw BadInstruction();
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType()), SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(punpckhqdq, punpckhqdq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2QWORDT, DQWORDT); return MAKE_INSN2(punpckhqdq, punpckhqdq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x6E: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, effectiveOperandMode(), effectiveOperandType(), (effectiveOperandSize() == x86_insnsize_64 ? (SgAsmType*)SgAsmTypeQuadWord::createType() : SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()))); return MAKE_INSN2(movd, movd, reg, modrm);
+          case mmNone: getModRegRM(rmMM, effectiveOperandMode(), effectiveOperandType(), (effectiveOperandSize() == x86_insnsize_64 ? (SgAsmType*)QWORDT : V2DWORDT)); return MAKE_INSN2(movd, movd, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, effectiveOperandMode(), effectiveOperandType(), (effectiveOperandSize() == x86_insnsize_64 ? SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType()) : SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType()))); return MAKE_INSN2(movd, movd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, effectiveOperandMode(), effectiveOperandType(), (effectiveOperandSize() == x86_insnsize_64 ? V2QWORDT : V4DWORDT)); return MAKE_INSN2(movd, movd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x6F: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(movq, movq, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(movdqu, movdqu, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(movdqa, movdqa, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(movq, movq, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, DQWORDT); return MAKE_INSN2(movdqu, movdqu, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DQWORDT); return MAKE_INSN2(movdqa, movdqa, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x70: {
         switch (mmPrefix()) {
-          case mmNone: {getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); SgAsmExpression* shufConstant = getImmByte(); return MAKE_INSN3(pshufw, pshufw, reg, modrm, shufConstant);}
-          case mmF3: {getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); SgAsmExpression* shufConstant = getImmByte(); return MAKE_INSN3(pshufhw, pshufhw, reg, modrm, shufConstant);}
-          case mm66: {getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); SgAsmExpression* shufConstant = getImmByte(); return MAKE_INSN3(pshufd, pshufd, reg, modrm, shufConstant);}
-          case mmF2: {getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); SgAsmExpression* shufConstant = getImmByte(); return MAKE_INSN3(pshuflw, pshuflw, reg, modrm, shufConstant);}
+          case mmNone: {getModRegRM(rmMM, rmMM, V4WORDT); SgAsmExpression* shufConstant = getImmByte(); return MAKE_INSN3(pshufw, pshufw, reg, modrm, shufConstant);}
+          case mmF3: {getModRegRM(rmXMM, rmXMM, V8WORDT); SgAsmExpression* shufConstant = getImmByte(); return MAKE_INSN3(pshufhw, pshufhw, reg, modrm, shufConstant);}
+          case mm66: {getModRegRM(rmXMM, rmXMM, V4DWORDT); SgAsmExpression* shufConstant = getImmByte(); return MAKE_INSN3(pshufd, pshufd, reg, modrm, shufConstant);}
+          case mmF2: {getModRegRM(rmXMM, rmXMM, V8WORDT); SgAsmExpression* shufConstant = getImmByte(); return MAKE_INSN3(pshuflw, pshuflw, reg, modrm, shufConstant);}
         }
       }
       case 0x71: { // Group 12
         switch (mmPrefix()) {
           case mmNone: {
-            getModRegRM(rmReturnNull, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType()));
+            getModRegRM(rmReturnNull, rmMM, V4WORDT);
             if (modeField != 3) throw BadInstruction();
             SgAsmExpression* shiftAmount = getImmByte();
             switch (regField) {
@@ -2029,7 +2044,7 @@
           }
           case mmF3: throw BadInstruction();
           case mm66: {
-            getModRegRM(rmReturnNull, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType()));
+            getModRegRM(rmReturnNull, rmXMM, V8WORDT);
             if (modeField != 3) throw BadInstruction();
             SgAsmExpression* shiftAmount = getImmByte();
             switch (regField) {
@@ -2050,7 +2065,7 @@
       case 0x72: { // Group 13
         switch (mmPrefix()) {
           case mmNone: {
-            getModRegRM(rmReturnNull, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()));
+            getModRegRM(rmReturnNull, rmMM, V2DWORDT);
             if (modeField != 3) throw BadInstruction();
             SgAsmExpression* shiftAmount = getImmByte();
             switch (regField) {
@@ -2067,7 +2082,7 @@
           }
           case mmF3: throw BadInstruction();
           case mm66: {
-            getModRegRM(rmReturnNull, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType()));
+            getModRegRM(rmReturnNull, rmXMM, V4DWORDT);
             if (modeField != 3) throw BadInstruction();
             SgAsmExpression* shiftAmount = getImmByte();
             switch (regField) {
@@ -2088,7 +2103,7 @@
       case 0x73: { // Group 14
         switch (mmPrefix()) {
           case mmNone: {
-            getModRegRM(rmReturnNull, rmMM, SgAsmTypeQuadWord::createType());
+            getModRegRM(rmReturnNull, rmMM, QWORDT);
             if (modeField != 3) throw BadInstruction();
             SgAsmExpression* shiftAmount = getImmByte();
             switch (regField) {
@@ -2105,18 +2120,18 @@
           }
           case mmF3: throw BadInstruction();
           case mm66: {
-            getModRegRM(rmReturnNull, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType()));
+            getModRegRM(rmReturnNull, rmXMM, V2QWORDT);
             if (modeField != 3) throw BadInstruction();
             SgAsmExpression* shiftAmount = getImmByte();
             switch (regField) {
               case 0: throw BadInstruction();
               case 1: throw BadInstruction();
               case 2: return MAKE_INSN2(psrlq, psrlq, modrm, shiftAmount);
-              case 3: isSgAsmx86RegisterReferenceExpression(modrm)->set_type(SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(psrldq, psrldq, modrm, shiftAmount);
+              case 3: isSgAsmx86RegisterReferenceExpression(modrm)->set_type(DQWORDT); return MAKE_INSN2(psrldq, psrldq, modrm, shiftAmount);
               case 4: throw BadInstruction();
               case 5: throw BadInstruction();
               case 6: return MAKE_INSN2(psllq, psllq, modrm, shiftAmount);
-              case 7: isSgAsmx86RegisterReferenceExpression(modrm)->set_type(SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(pslldq, pslldq, modrm, shiftAmount);
+              case 7: isSgAsmx86RegisterReferenceExpression(modrm)->set_type(DQWORDT); return MAKE_INSN2(pslldq, pslldq, modrm, shiftAmount);
               default: ROSE_ASSERT (false);
             }
           }
@@ -2125,25 +2140,25 @@
       }
       case 0x74: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(pcmpeqb, pcmpeqb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(pcmpeqb, pcmpeqb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(pcmpeqb, pcmpeqb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(pcmpeqb, pcmpeqb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x75: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(pcmpeqw, pcmpeqw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(pcmpeqw, pcmpeqw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(pcmpeqw, pcmpeqw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(pcmpeqw, pcmpeqw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x76: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(pcmpeqd, pcmpeqd, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT); return MAKE_INSN2(pcmpeqd, pcmpeqd, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(pcmpeqd, pcmpeqd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT); return MAKE_INSN2(pcmpeqd, pcmpeqd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
@@ -2160,7 +2175,7 @@
           case mmNone: ROSE_ASSERT (!"vmread not supported");
           case mmF3: throw BadInstruction();
           case mm66: { // Group 17
-            getModRegRM(rmReturnNull, rmXMM, SgAsmTypeDoubleQuadWord::createType());
+            getModRegRM(rmReturnNull, rmXMM, DQWORDT);
             SgAsmExpression* imm1 = getImmByte();
             SgAsmExpression* imm2 = getImmByte();
             switch (regField) {
@@ -2173,7 +2188,7 @@
             }
           }
           case mmF2: {
-            getModRegRM(rmXMM, rmXMM, SgAsmTypeQuadWord::createType(), SgAsmTypeDoubleQuadWord::createType());
+            getModRegRM(rmXMM, rmXMM, QWORDT, DQWORDT);
             SgAsmExpression* imm1 = getImmByte();
             SgAsmExpression* imm2 = getImmByte();
             if (modeField == 3)
@@ -2187,8 +2202,8 @@
         switch (mmPrefix()) {
           case mmNone: ROSE_ASSERT (!"vmwrite not supported");
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeQuadWord::createType(), SgAsmTypeDoubleQuadWord::createType()); if (modeField == 3) return MAKE_INSN2(extrq, extrq, reg, modrm); else throw BadInstruction();
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); if (modeField == 3) return MAKE_INSN2(insertq, insertq, reg, modrm); else throw BadInstruction();
+          case mm66: getModRegRM(rmXMM, rmXMM, QWORDT, DQWORDT); if (modeField == 3) return MAKE_INSN2(extrq, extrq, reg, modrm); else throw BadInstruction();
+          case mmF2: getModRegRM(rmXMM, rmXMM, DQWORDT); if (modeField == 3) return MAKE_INSN2(insertq, insertq, reg, modrm); else throw BadInstruction();
         }
       }
       case 0x7A: throw BadInstruction();
@@ -2197,66 +2212,66 @@
         switch (mmPrefix()) {
           case mmNone: throw BadInstruction();
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(haddpd, haddpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(haddps, haddps, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(haddpd, haddpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(haddps, haddps, reg, modrm);
         }
       }
       case 0x7D: {
         switch (mmPrefix()) {
           case mmNone: throw BadInstruction();
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(hsubpd, hsubpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(hsubps, hsubps, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(hsubpd, hsubpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(hsubps, hsubps, reg, modrm);
         }
       }
       case 0x7E: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, effectiveOperandMode(), effectiveOperandType(), (effectiveOperandSize() == x86_insnsize_64 ? (SgAsmType*)SgAsmTypeQuadWord::createType() : SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()))); return MAKE_INSN2(movd, movd, modrm, reg);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(movq, movq, reg, modrm);
-          case mm66: getModRegRM(rmXMM, effectiveOperandMode(), effectiveOperandType(), (effectiveOperandSize() == x86_insnsize_64 ? SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType()) : SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType()))); return MAKE_INSN2(movd, movd, modrm, reg);
+          case mmNone: getModRegRM(rmMM, effectiveOperandMode(), effectiveOperandType(), (effectiveOperandSize() == x86_insnsize_64 ? (SgAsmType*)QWORDT : V2DWORDT)); return MAKE_INSN2(movd, movd, modrm, reg);
+          case mmF3: getModRegRM(rmXMM, rmXMM, V2QWORDT); return MAKE_INSN2(movq, movq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, effectiveOperandMode(), effectiveOperandType(), (effectiveOperandSize() == x86_insnsize_64 ? V2QWORDT : V4DWORDT)); return MAKE_INSN2(movd, movd, modrm, reg);
           case mmF2: throw BadInstruction();
         }
       }
       case 0x7F: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(movq, movq, modrm, reg);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(movdqu, movdqu, modrm, reg);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(movdqa, movdqa, modrm, reg);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(movq, movq, modrm, reg);
+          case mmF3: getModRegRM(rmXMM, rmXMM, DQWORDT); return MAKE_INSN2(movdqu, movdqu, modrm, reg);
+          case mm66: getModRegRM(rmXMM, rmXMM, DQWORDT); return MAKE_INSN2(movdqa, movdqa, modrm, reg);
           case mmF2: throw BadInstruction();
         }
       }
-      case 0x80: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jo , jo, /* prediction, */ imm);}
-      case 0x81: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jno, jno, /* prediction, */ imm);}
-      case 0x82: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jb,  jb, /* prediction, */ imm);}
-      case 0x83: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jae, jae, /* prediction, */ imm);}
-      case 0x84: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(je,  je, /* prediction, */ imm);}
-      case 0x85: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jne, jne, /* prediction, */ imm);}
-      case 0x86: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jbe, jbe, /* prediction, */ imm);}
-      case 0x87: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(ja,  ja, /* prediction, */ imm);}
-      case 0x88: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(js , js, /* prediction, */ imm);}
-      case 0x89: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jns, jns, /* prediction, */ imm);}
-      case 0x8A: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jpe, jpe, /* prediction, */ imm);}
-      case 0x8B: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jpo, jpo, /* prediction, */ imm);}
-      case 0x8C: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jl,  jl, /* prediction, */ imm);}
-      case 0x8D: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jge, jge, /* prediction, */ imm);}
-      case 0x8E: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jle, jle, /* prediction, */ imm);}
-      case 0x8F: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jg,  jg, /* prediction, */ imm);}
-      case 0x90: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(seto,  seto, modrm);
-      case 0x91: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setno, setno, modrm);
-      case 0x92: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setb,  setb, modrm);
-      case 0x93: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setae, setae, modrm);
-      case 0x94: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(sete,  sete, modrm);
-      case 0x95: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setne, setne, modrm);
-      case 0x96: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setbe, setbe, modrm);
-      case 0x97: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(seta,  seta, modrm);
-      case 0x98: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(sets,  sets, modrm);
-      case 0x99: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setns, setns, modrm);
-      case 0x9A: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setpe, setpe, modrm);
-      case 0x9B: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setpo, setpo, modrm);
-      case 0x9C: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setl,  setl, modrm);
-      case 0x9D: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setge, setge, modrm);
-      case 0x9E: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setle, setle, modrm);
-      case 0x9F: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN1(setg,  setg, modrm);
+      case 0x80: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jo , jo, imm);}
+      case 0x81: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jno, jno, imm);}
+      case 0x82: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jb,  jb, imm);}
+      case 0x83: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jae, jae, imm);}
+      case 0x84: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(je,  je, imm);}
+      case 0x85: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jne, jne, imm);}
+      case 0x86: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jbe, jbe, imm);}
+      case 0x87: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(ja,  ja, imm);}
+      case 0x88: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(js , js, imm);}
+      case 0x89: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jns, jns, imm);}
+      case 0x8A: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jpe, jpe, imm);}
+      case 0x8B: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jpo, jpo, imm);}
+      case 0x8C: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jl,  jl, imm);}
+      case 0x8D: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jge, jge, imm);}
+      case 0x8E: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jle, jle, imm);}
+      case 0x8F: {SgAsmExpression* imm = getImmJz(); branchPredictionEnabled = true; return MAKE_INSN1(jg,  jg, imm);}
+      case 0x90: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(seto,  seto, modrm);
+      case 0x91: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setno, setno, modrm);
+      case 0x92: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setb,  setb, modrm);
+      case 0x93: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setae, setae, modrm);
+      case 0x94: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(sete,  sete, modrm);
+      case 0x95: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setne, setne, modrm);
+      case 0x96: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setbe, setbe, modrm);
+      case 0x97: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(seta,  seta, modrm);
+      case 0x98: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(sets,  sets, modrm);
+      case 0x99: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setns, setns, modrm);
+      case 0x9A: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setpe, setpe, modrm);
+      case 0x9B: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setpo, setpo, modrm);
+      case 0x9C: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setl,  setl, modrm);
+      case 0x9D: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setge, setge, modrm);
+      case 0x9E: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setle, setle, modrm);
+      case 0x9F: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN1(setg,  setg, modrm);
       case 0xA0: return MAKE_INSN1(push, push, makeRegister(4, rmSegment));
       case 0xA1: return MAKE_INSN1(pop, pop, makeRegister(4, rmSegment));
       case 0xA2: return MAKE_INSN0(cpuid, cpuid);
@@ -2273,14 +2288,14 @@
       case 0xAD: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); return MAKE_INSN3(shrd, shrd, modrm, reg, makeRegister(1, rmLegacyByte));
       case 0xAE: return decodeGroup15();
       case 0xAF: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); return MAKE_INSN2(imul, imul, reg, modrm);
-      case 0xB0: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN2(cmpxchg, cmpxchg, modrm, reg);
+      case 0xB0: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN2(cmpxchg, cmpxchg, modrm, reg);
       case 0xB1: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); return MAKE_INSN2(cmpxchg, cmpxchg, modrm, reg);
       case 0xB2: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); requireMemory(); return MAKE_INSN2(lss, lss, reg, modrm);
       case 0xB3: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); return MAKE_INSN2(bts, bts, modrm, reg);
       case 0xB4: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); requireMemory(); return MAKE_INSN2(lfs, lfs, reg, modrm);
       case 0xB5: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); requireMemory(); return MAKE_INSN2(lgs, lgs, reg, modrm);
-      case 0xB6: getModRegRM(effectiveOperandMode(), rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN2(movzx, movzx, reg, modrm);
-      case 0xB7: getModRegRM(effectiveOperandMode(), rmWord, SgAsmTypeWord::createType()); return MAKE_INSN2(movzx, movzx, reg, modrm);
+      case 0xB6: getModRegRM(effectiveOperandMode(), rmLegacyByte, BYTET); return MAKE_INSN2(movzx, movzx, reg, modrm);
+      case 0xB7: getModRegRM(effectiveOperandMode(), rmWord, WORDT); return MAKE_INSN2(movzx, movzx, reg, modrm);
       case 0xB8: {
         getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType());
         switch (mmPrefix()) {
@@ -2294,16 +2309,16 @@
       case 0xBB: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); return MAKE_INSN2(btc, btc, modrm, reg);
       case 0xBC: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); return MAKE_INSN2(bsf, bsf, reg, modrm);
       case 0xBD: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); if (repeatPrefix == rpRepe) return MAKE_INSN2(lzcnt, lzcnt, reg, modrm); else return MAKE_INSN2(bsr, bsr, reg, modrm);
-      case 0xBE: getModRegRM(effectiveOperandMode(), rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN2(movsx, movsx, reg, modrm);
-      case 0xBF: getModRegRM(effectiveOperandMode(), rmWord, SgAsmTypeWord::createType()); return MAKE_INSN2(movsx, movsx, reg, modrm);
-      case 0xC0: getModRegRM(rmLegacyByte, rmLegacyByte, SgAsmTypeByte::createType()); return MAKE_INSN2(xadd, xadd, modrm, reg);
+      case 0xBE: getModRegRM(effectiveOperandMode(), rmLegacyByte, BYTET); return MAKE_INSN2(movsx, movsx, reg, modrm);
+      case 0xBF: getModRegRM(effectiveOperandMode(), rmWord, WORDT); return MAKE_INSN2(movsx, movsx, reg, modrm);
+      case 0xC0: getModRegRM(rmLegacyByte, rmLegacyByte, BYTET); return MAKE_INSN2(xadd, xadd, modrm, reg);
       case 0xC1: getModRegRM(effectiveOperandMode(), effectiveOperandMode(), effectiveOperandType()); return MAKE_INSN2(xadd, xadd, modrm, reg);
       case 0xC2: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(cmpps, cmpps, reg, modrm);
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeSingleFloat::createType()); return MAKE_INSN2(cmpss, cmpss, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(cmppd, cmppd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleFloat::createType()); return MAKE_INSN2(cmpsd, cmpsd, reg, modrm);
+          case mmNone: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(cmpps, cmpps, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, FLOATT); return MAKE_INSN2(cmpss, cmpss, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(cmppd, cmppd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DOUBLET); return MAKE_INSN2(cmpsd, cmpsd, reg, modrm);
         }
       }
       case 0xC3: {
@@ -2317,13 +2332,13 @@
       case 0xC4: {
         switch (mmPrefix()) {
           case mmNone: {
-            getModRegRM(rmMM, rmWord, SgAsmTypeWord::createType(), SgAsmTypeQuadWord::createType());
+            getModRegRM(rmMM, rmWord, WORDT, QWORDT);
             SgAsmExpression* imm = getImmByte();
             return MAKE_INSN3(pinsrw, pinsrw, reg, modrm, imm);
           }
           case mmF3: throw BadInstruction();
           case mm66: {
-            getModRegRM(rmXMM, rmWord, SgAsmTypeWord::createType(), SgAsmTypeDoubleQuadWord::createType());
+            getModRegRM(rmXMM, rmWord, WORDT, DQWORDT);
             SgAsmExpression* imm = getImmByte();
             return MAKE_INSN3(pinsrw, pinsrw, reg, modrm, imm);
           }
@@ -2333,13 +2348,13 @@
       case 0xC5: {
         switch (mmPrefix()) {
           case mmNone: {
-            getModRegRM(rmDWord, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType()), SgAsmTypeDoubleWord::createType());
+            getModRegRM(rmDWord, rmMM, V4WORDT, DWORDT);
             SgAsmExpression* imm = getImmByte();
             if (modeField == 3) return MAKE_INSN3(pextrw, pextrw, reg, modrm, imm); else throw BadInstruction();
           }
           case mmF3: throw BadInstruction();
           case mm66: {
-            getModRegRM(rmDWord, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType()), SgAsmTypeDoubleWord::createType());
+            getModRegRM(rmDWord, rmXMM, V8WORDT, DWORDT);
             SgAsmExpression* imm = getImmByte();
             if (modeField == 3) return MAKE_INSN3(pextrw, pextrw, reg, modrm, imm); else throw BadInstruction();
           }
@@ -2349,13 +2364,13 @@
       case 0xC6: {
         switch (mmPrefix()) {
           case mmNone: {
-            getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType()));
+            getModRegRM(rmXMM, rmXMM, V4FLOATT);
             SgAsmExpression* shufConstant = getImmByte();
             return MAKE_INSN3(shufps, shufps, reg, modrm, shufConstant);
           }
           case mmF3: throw BadInstruction();
           case mm66: {
-            getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType()));
+            getModRegRM(rmXMM, rmXMM, V2DOUBLET);
             SgAsmExpression* shufConstant = getImmByte();
             return MAKE_INSN3(shufpd, shufpd, reg, modrm, shufConstant);
           }
@@ -2368,15 +2383,15 @@
         switch (regField) {
           case 1: {
             if (effectiveOperandSize() == x86_insnsize_64) {
-              fillInModRM(rmReturnNull, SgAsmTypeDoubleQuadWord::createType());
+              fillInModRM(rmReturnNull, DQWORDT);
               return MAKE_INSN1(cmpxchg16b, cmpxchg16b, modrm);
             } else {
-              fillInModRM(rmReturnNull, SgAsmTypeQuadWord::createType());
+              fillInModRM(rmReturnNull, QWORDT);
               return MAKE_INSN1(cmpxchg8b, cmpxchg8b, modrm);
             }
           }
           case 6: {
-            fillInModRM(rmReturnNull, SgAsmTypeQuadWord::createType());
+            fillInModRM(rmReturnNull, QWORDT);
             switch (mmPrefix()) {
               case mmNone: return MAKE_INSN1(vmptrld, vmptrld, modrm);
               case mmF3: return MAKE_INSN1(vmxon, vmxon, modrm);
@@ -2385,7 +2400,7 @@
             }
           }
           case 7: {
-            fillInModRM(rmReturnNull, SgAsmTypeQuadWord::createType());
+            fillInModRM(rmReturnNull, QWORDT);
             return MAKE_INSN1(vmptrst, vmptrst, modrm);
           }
           default: throw BadInstruction();
@@ -2403,255 +2418,255 @@
         switch (mmPrefix()) {
           case mmNone: throw BadInstruction();
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(addsubpd, addsubpd, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeSingleFloat::createType())); return MAKE_INSN2(addsubps, addsubps, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET); return MAKE_INSN2(addsubpd, addsubpd, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, V4FLOATT); return MAKE_INSN2(addsubps, addsubps, reg, modrm);
         }
       }
       case 0xD1: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(psrlw, psrlw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(psrlw, psrlw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(psrlw, psrlw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(psrlw, psrlw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xD2: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(psrld, psrld, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT); return MAKE_INSN2(psrld, psrld, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(psrld, psrld, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT); return MAKE_INSN2(psrld, psrld, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xD3: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(psrlq, psrlq, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(psrlq, psrlq, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(psrlq, psrlq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2QWORDT); return MAKE_INSN2(psrlq, psrlq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xD4: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(paddq, paddq, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(paddq, paddq, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(paddq, paddq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2QWORDT); return MAKE_INSN2(paddq, paddq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xD5: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(pmullw, pmullw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(pmullw, pmullw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(pmullw, pmullw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(pmullw, pmullw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xD6: {
         switch (mmPrefix()) {
           case mmNone: throw BadInstruction();
-          case mmF3: getModRegRM(rmMM, rmXMM, SgAsmTypeQuadWord::createType(), SgAsmTypeDoubleQuadWord::createType()); if (modeField == 3) return MAKE_INSN2(movq2dq, movq2dq, reg, modrm); else throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(movq, movq, modrm, reg);
-          case mmF2: getModRegRM(rmXMM, rmMM, SgAsmTypeDoubleQuadWord::createType(), SgAsmTypeQuadWord::createType()); if (modeField == 3) return MAKE_INSN2(movdq2q, movdq2q, reg, modrm); else throw BadInstruction();
+          case mmF3: getModRegRM(rmMM, rmXMM, QWORDT, DQWORDT); if (modeField == 3) return MAKE_INSN2(movq2dq, movq2dq, reg, modrm); else throw BadInstruction();
+          case mm66: getModRegRM(rmXMM, rmXMM, QWORDT); return MAKE_INSN2(movq, movq, modrm, reg);
+          case mmF2: getModRegRM(rmXMM, rmMM, DQWORDT, QWORDT); if (modeField == 3) return MAKE_INSN2(movdq2q, movdq2q, reg, modrm); else throw BadInstruction();
         }
       }
       case 0xD7: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmDWord, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType()), SgAsmTypeDoubleWord::createType()); if (modeField == 3) return MAKE_INSN2(pmovmskb, pmovmskb, reg, modrm); else throw BadInstruction();
+          case mmNone: getModRegRM(rmDWord, rmMM, V8BYTET, DWORDT); if (modeField == 3) return MAKE_INSN2(pmovmskb, pmovmskb, reg, modrm); else throw BadInstruction();
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmDWord, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType()), SgAsmTypeDoubleWord::createType()); if (modeField == 3) return MAKE_INSN2(pmovmskb, pmovmskb, reg, modrm); else throw BadInstruction();
+          case mm66: getModRegRM(rmDWord, rmXMM, V16BYTET, DWORDT); if (modeField == 3) return MAKE_INSN2(pmovmskb, pmovmskb, reg, modrm); else throw BadInstruction();
           case mmF2: throw BadInstruction();
         }
       }
       case 0xD8: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(psubusb, psubusb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(psubusb, psubusb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(psubusb, psubusb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(psubusb, psubusb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xD9: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(psubusw, psubusw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(psubusw, psubusw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(psubusw, psubusw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(psubusw, psubusw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xDA: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(pminub, pminub, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(pminub, pminub, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(pminub, pminub, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(pminub, pminub, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xDB: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(pand, pand, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(pand, pand, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(pand, pand, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DQWORDT); return MAKE_INSN2(pand, pand, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xDC: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(paddusb, paddusb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(paddusb, paddusb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(paddusb, paddusb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(paddusb, paddusb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xDD: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(paddusw, paddusw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(paddusw, paddusw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(paddusw, paddusw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(paddusw, paddusw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xDE: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(pmaxub, pmaxub, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(pmaxub, pmaxub, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(pmaxub, pmaxub, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(pmaxub, pmaxub, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xDF: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(pandn, pandn, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(pandn, pandn, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(pandn, pandn, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DQWORDT); return MAKE_INSN2(pandn, pandn, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xE0: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(pavgb, pavgb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(pavgb, pavgb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(pavgb, pavgb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(pavgb, pavgb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xE1: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(psraw, psraw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(psraw, psraw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(psraw, psraw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(psraw, psraw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xE2: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(psrad, psrad, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT); return MAKE_INSN2(psrad, psrad, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(psrad, psrad, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT); return MAKE_INSN2(psrad, psrad, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xE3: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(pavgw, pavgw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(pavgw, pavgw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(pavgw, pavgw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(pavgw, pavgw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xE4: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(pmulhuw, pmulhuw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(pmulhuw, pmulhuw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(pmulhuw, pmulhuw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(pmulhuw, pmulhuw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xE5: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(pmulhw, pmulhw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(pmulhw, pmulhw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(pmulhw, pmulhw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(pmulhw, pmulhw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xE6: {
         switch (mmPrefix()) {
           case mmNone: throw BadInstruction();
-          case mmF3: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType())); return MAKE_INSN2(cvtdq2pd, cvtdq2pd, reg, modrm);
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType()), SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(cvttpd2dq, cvttpd2dq, reg, modrm);
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleFloat::createType()), SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(cvtpd2dq, cvtpd2dq, reg, modrm);
+          case mmF3: getModRegRM(rmXMM, rmXMM, V2QWORDT, V2DOUBLET); return MAKE_INSN2(cvtdq2pd, cvtdq2pd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2DOUBLET, V2QWORDT); return MAKE_INSN2(cvttpd2dq, cvttpd2dq, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, V2DOUBLET, V2QWORDT); return MAKE_INSN2(cvtpd2dq, cvtpd2dq, reg, modrm);
         }
       }
       case 0xE7: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); requireMemory(); return MAKE_INSN2(movntq, movntq, modrm, reg);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); requireMemory(); return MAKE_INSN2(movntq, movntq, modrm, reg);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); requireMemory(); return MAKE_INSN2(movntdq, movntdq, modrm, reg);
+          case mm66: getModRegRM(rmXMM, rmXMM, DQWORDT); requireMemory(); return MAKE_INSN2(movntdq, movntdq, modrm, reg);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xE8: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(psubsb, psubsb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(psubsb, psubsb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(psubsb, psubsb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(psubsb, psubsb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xE9: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(psubsw, psubsw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(psubsw, psubsw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(psubsw, psubsw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(psubsw, psubsw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xEA: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(pminsw, pminsw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(pminsw, pminsw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(pminsw, pminsw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(pminsw, pminsw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xEB: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(por, por, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(por, por, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(por, por, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DQWORDT); return MAKE_INSN2(por, por, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xEC: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(paddsb, paddsb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(paddsb, paddsb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(paddsb, paddsb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(paddsb, paddsb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xED: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(paddsw, paddsw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(paddsw, paddsw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(paddsw, paddsw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(paddsw, paddsw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xEE: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(pmaxsw, pmaxsw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(pmaxsw, pmaxsw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(pmaxsw, pmaxsw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(pmaxsw, pmaxsw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xEF: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(pxor, pxor, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(pxor, pxor, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); return MAKE_INSN2(pxor, pxor, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, DQWORDT); return MAKE_INSN2(pxor, pxor, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
@@ -2660,118 +2675,118 @@
           case mmNone: throw BadInstruction();
           case mmF3: throw BadInstruction();
           case mm66: throw BadInstruction();
-          case mmF2: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); requireMemory(); return MAKE_INSN2(lddqu, lddqu, reg, modrm);
+          case mmF2: getModRegRM(rmXMM, rmXMM, DQWORDT); requireMemory(); return MAKE_INSN2(lddqu, lddqu, reg, modrm);
         }
       }
       case 0xF1: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(psllw, psllw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(psllw, psllw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(psllw, psllw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(psllw, psllw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xF2: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(pslld, pslld, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT); return MAKE_INSN2(pslld, pslld, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(pslld, pslld, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT); return MAKE_INSN2(pslld, pslld, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xF3: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(psllq, psllq, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(psllq, psllq, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(psllq, psllq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2QWORDT); return MAKE_INSN2(psllq, psllq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xF4: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType()), SgAsmTypeQuadWord::createType()); return MAKE_INSN2(pmuludq, pmuludq, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT, QWORDT); return MAKE_INSN2(pmuludq, pmuludq, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType()), SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(pmuludq, pmuludq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT, V2QWORDT); return MAKE_INSN2(pmuludq, pmuludq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xF5: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(pmaddwd, pmaddwd, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT, V2DWORDT); return MAKE_INSN2(pmaddwd, pmaddwd, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType()), SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(pmaddwd, pmaddwd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT, V4DWORDT); return MAKE_INSN2(pmaddwd, pmaddwd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xF6: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType()), SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(psadbw, psadbw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET, V4WORDT); return MAKE_INSN2(psadbw, psadbw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType()), SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(psadbw, psadbw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET, V8WORDT); return MAKE_INSN2(psadbw, psadbw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xF7: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); if (modeField == 3) return MAKE_INSN2(movntq, movntq, reg, modrm); else throw BadInstruction();
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); if (modeField == 3) return MAKE_INSN2(movntq, movntq, reg, modrm); else throw BadInstruction();
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeDoubleQuadWord::createType()); if (modeField == 3) return MAKE_INSN2(movntdq, movntdq, reg, modrm); else throw BadInstruction();
+          case mm66: getModRegRM(rmXMM, rmXMM, DQWORDT); if (modeField == 3) return MAKE_INSN2(movntdq, movntdq, reg, modrm); else throw BadInstruction();
           case mmF2: throw BadInstruction();
         }
       }
       case 0xF8: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(psubb, psubb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(psubb, psubb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(psubb, psubb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(psubb, psubb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xF9: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(psubw, psubw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(psubw, psubw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(psubw, psubw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(psubw, psubw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xFA: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(psubd, psubd, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT); return MAKE_INSN2(psubd, psubd, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(psubd, psubd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT); return MAKE_INSN2(psubd, psubd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xFB: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeQuadWord::createType()); return MAKE_INSN2(psubq, psubq, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, QWORDT); return MAKE_INSN2(psubq, psubq, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(2, SgAsmTypeQuadWord::createType())); return MAKE_INSN2(psubq, psubq, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V2QWORDT); return MAKE_INSN2(psubq, psubq, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xFC: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(8, SgAsmTypeByte::createType())); return MAKE_INSN2(paddb, paddb, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V8BYTET); return MAKE_INSN2(paddb, paddb, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(16, SgAsmTypeByte::createType())); return MAKE_INSN2(paddb, paddb, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V16BYTET); return MAKE_INSN2(paddb, paddb, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xFD: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(4, SgAsmTypeWord::createType())); return MAKE_INSN2(paddw, paddw, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V4WORDT); return MAKE_INSN2(paddw, paddw, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(8, SgAsmTypeWord::createType())); return MAKE_INSN2(paddw, paddw, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V8WORDT); return MAKE_INSN2(paddw, paddw, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
       case 0xFE: {
         switch (mmPrefix()) {
-          case mmNone: getModRegRM(rmMM, rmMM, SgAsmTypeVector::createType(2, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(paddd, paddd, reg, modrm);
+          case mmNone: getModRegRM(rmMM, rmMM, V2DWORDT); return MAKE_INSN2(paddd, paddd, reg, modrm);
           case mmF3: throw BadInstruction();
-          case mm66: getModRegRM(rmXMM, rmXMM, SgAsmTypeVector::createType(4, SgAsmTypeDoubleWord::createType())); return MAKE_INSN2(paddd, paddd, reg, modrm);
+          case mm66: getModRegRM(rmXMM, rmXMM, V4DWORDT); return MAKE_INSN2(paddd, paddd, reg, modrm);
           case mmF2: throw BadInstruction();
         }
       }
@@ -2876,7 +2891,7 @@
             default: throw BadInstruction();
           }
         } else {
-          fillInModRM(rmReturnNull, SgAsmTypeByte::createType() /* pseudo-descriptor */ );
+          fillInModRM(rmReturnNull, BYTET /* pseudo-descriptor */ );
           return MAKE_INSN1(sgdt, sgdt, modrm);
         }
       }
@@ -2888,7 +2903,7 @@
             default: throw BadInstruction();
           }
         } else {
-          fillInModRM(rmReturnNull, SgAsmTypeByte::createType() /* pseudo-descriptor */ );
+          fillInModRM(rmReturnNull, BYTET /* pseudo-descriptor */ );
           return MAKE_INSN1(sidt, sidt, modrm);
         }
       }
@@ -2900,7 +2915,7 @@
             default: throw BadInstruction();
           }
         } else {
-          fillInModRM(rmReturnNull, SgAsmTypeByte::createType() /* pseudo-descriptor */ );
+          fillInModRM(rmReturnNull, BYTET /* pseudo-descriptor */ );
           return MAKE_INSN1(lgdt, lgdt, modrm);
         }
       }
@@ -2918,17 +2933,17 @@
             default: ROSE_ASSERT (false);
           }
         } else {
-          fillInModRM(rmReturnNull, SgAsmTypeByte::createType() /* pseudo-descriptor */ );
+          fillInModRM(rmReturnNull, BYTET /* pseudo-descriptor */ );
           return MAKE_INSN1(lidt, lidt, modrm);
         }
       }
       case 4: {
-        fillInModRM(effectiveOperandMode(), SgAsmTypeWord::createType());
+        fillInModRM(effectiveOperandMode(), WORDT);
         return MAKE_INSN1(smsw, smsw, modrm);
       }
       case 5: throw BadInstruction();
       case 6: {
-        fillInModRM(rmWord, SgAsmTypeWord::createType());
+        fillInModRM(rmWord, WORDT);
         return MAKE_INSN1(lmsw, lmsw, modrm);
       }
       case 7: {
@@ -2939,7 +2954,7 @@
             default: throw BadInstruction();
           }
         } else {
-          fillInModRM(rmReturnNull, SgAsmTypeByte::createType());
+          fillInModRM(rmReturnNull, BYTET);
           return MAKE_INSN1(invlpg, invlpg, modrm);
         }
       }
@@ -2971,11 +2986,11 @@
   SgAsmx86Instruction* SingleInstructionDisassembler::decodeGroup15() {
     getModRegRM(rmReturnNull, rmReturnNull, NULL);
     switch (regField) {
-      case 0: requireMemory(); fillInModRM(rmReturnNull, SgAsmTypeByte::createType()); return MAKE_INSN1(fxsave, fxsave, modrm);
-      case 1: requireMemory(); fillInModRM(rmReturnNull, SgAsmTypeByte::createType()); return MAKE_INSN1(fxrstor, fxrstor, modrm);
-      case 2: requireMemory(); fillInModRM(rmReturnNull, SgAsmTypeDoubleWord::createType()); return MAKE_INSN1(ldmxcsr, ldmxcsr, modrm);
-      case 3: requireMemory(); fillInModRM(rmReturnNull, SgAsmTypeDoubleWord::createType()); return MAKE_INSN1(stmxcsr, stmxcsr, modrm);
-      case 4: requireMemory(); fillInModRM(rmReturnNull, SgAsmTypeByte::createType()); return MAKE_INSN1(xsave, xsave, modrm);
+      case 0: requireMemory(); fillInModRM(rmReturnNull, BYTET); return MAKE_INSN1(fxsave, fxsave, modrm);
+      case 1: requireMemory(); fillInModRM(rmReturnNull, BYTET); return MAKE_INSN1(fxrstor, fxrstor, modrm);
+      case 2: requireMemory(); fillInModRM(rmReturnNull, DWORDT); return MAKE_INSN1(ldmxcsr, ldmxcsr, modrm);
+      case 3: requireMemory(); fillInModRM(rmReturnNull, DWORDT); return MAKE_INSN1(stmxcsr, stmxcsr, modrm);
+      case 4: requireMemory(); fillInModRM(rmReturnNull, BYTET); return MAKE_INSN1(xsave, xsave, modrm);
       case 5: if (modeField == 3) return MAKE_INSN0(lfence, lfence); else return MAKE_INSN1(xrstor, xrstor, modrm);
       case 6: if (modeField == 3) return MAKE_INSN0(mfence, mfence); else throw BadInstruction();
       case 7: if (modeField == 3) return MAKE_INSN0(sfence, sfence); else return MAKE_INSN1(clflush, clflush, modrm);
@@ -2995,7 +3010,7 @@
   }
 
   SgAsmx86Instruction* SingleInstructionDisassembler::decodeGroupP() {
-    getModRegRM(rmReturnNull, rmLegacyByte, SgAsmTypeByte::createType());
+    getModRegRM(rmReturnNull, rmLegacyByte, BYTET);
     requireMemory();
     switch (regField) {
       case 0: return MAKE_INSN1(prefetch, prefetch, modrm);
@@ -3005,29 +3020,6 @@
     }
   }
 
-  static bool is_mov_edi_edi(SgAsmStatement* insnx) {
-    SgAsmx86Instruction* insn = isSgAsmx86Instruction(insnx);
-    if (!insn) return false;
-    if (insn->get_kind() != x86_mov) return false;
-    const SgAsmExpressionPtrList& operands = insn->get_operandList()->get_operands();
-    if (operands.size() != 2) return false;
-    SgAsmx86RegisterReferenceExpression* rr0 = isSgAsmx86RegisterReferenceExpression(operands[0]);
-    if (!rr0) return false;
-    SgAsmx86RegisterReferenceExpression* rr1 = isSgAsmx86RegisterReferenceExpression(operands[1]);
-    if (!rr1) return false;
-    if (rr0->get_register_class() != x86_regclass_gpr ||
-        rr0->get_register_number() != x86_gpr_di ||
-        (rr0->get_position_in_register() != x86_regpos_all &&
-         rr0->get_position_in_register() != x86_regpos_dword))
-      return false;
-    if (rr1->get_register_class() != x86_regclass_gpr ||
-        rr1->get_register_number() != x86_gpr_di ||
-        (rr1->get_position_in_register() != x86_regpos_all &&
-         rr1->get_position_in_register() != x86_regpos_dword))
-      return false;
-    return true;
-  }
-
   static bool is_push_ebp(SgAsmStatement* insnx, bool reg64) {
     SgAsmx86Instruction* insn = isSgAsmx86Instruction(insnx);
     if (!insn) return false;

Modified: branches/rice/src/frontend/ExecFormats/ROSE_ExecELF.C
===================================================================
--- branches/rice/src/frontend/ExecFormats/ROSE_ExecELF.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/ExecFormats/ROSE_ExecELF.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -225,11 +225,8 @@
         break;
       default:
         /*FIXME: There's a whole lot more. See Dan's Elf reader. */
-
-     // DQ (10/12/2008): Need more information to address PowerPC support.
-        printf ("Warning: p_e_machine = %lu = 0x%lx \n",p_e_machine,p_e_machine);
-
-
+        // DQ (10/12/2008): Need more information to address PowerPC support.
+        fprintf(stderr, "Warning: SgAsmElfFileHeader::ctor::p_e_machine = 0x%lx (%lu)\n", p_e_machine, p_e_machine);
         set_isa(ISA_OTHER);
         break;
     }
@@ -257,19 +254,32 @@
     return 4*1024;
 }
 
-/* Override ROSETTA version of accessors so the set_* functions check that we're still parsing. It should not be possible to
- * modify these values after parsing. */
-void
-SgAsmElfFileHeader::set_e_shoff(addr_t addr)
+/* Get the list of sections defined in the ELF Section Table */
+SgAsmGenericSectionPtrList
+SgAsmElfFileHeader::get_sectab_sections()
 {
-    ROSE_ASSERT(!get_congealed()); /*must be still parsing*/
-    p_e_shoff = addr;
+    SgAsmGenericSectionPtrList retval;
+    SgAsmGenericSectionPtrList sections = get_sections()->get_sections();
+    for (size_t i=0; i<sections.size(); i++) {
+        SgAsmElfSection *elfsec = dynamic_cast<SgAsmElfSection*>(sections[i]);
+        if (elfsec && elfsec->get_section_entry()!=NULL)
+            retval.push_back(elfsec);
+    }
+    return retval;
 }
-void
-SgAsmElfFileHeader::set_e_phoff(addr_t addr)
+
+/* Get the list of sections defined in the ELF Segment Table */
+SgAsmGenericSectionPtrList
+SgAsmElfFileHeader::get_segtab_sections()
 {
-    ROSE_ASSERT(!get_congealed()); /*must be still parsing*/
-    p_e_phoff = addr;
+    SgAsmGenericSectionPtrList retval;
+    SgAsmGenericSectionPtrList sections = get_sections()->get_sections();
+    for (size_t i=0; i<sections.size(); i++) {
+        SgAsmElfSection *elfsec = dynamic_cast<SgAsmElfSection*>(sections[i]);
+        if (elfsec && elfsec->get_segment_entry()!=NULL)
+            retval.push_back(elfsec);
+    }
+    return retval;
 }
 
 /* Encode Elf header disk structure */
@@ -369,26 +379,32 @@
     return disk;
 }
 
-/* Change size of ELF header based on word size */
+/* Update prior to parsing */
 bool
 SgAsmElfFileHeader::reallocate()
 {
+
+    /* Reallocate superclass. This also calls reallocate() for all the sections associated with this ELF File Header. */
     bool reallocated = SgAsmGenericHeader::reallocate();
 
-    addr_t newsize;
+    /* Resize header based on current word size */
+    addr_t need;
     if (4==get_word_size()) {
-        newsize = sizeof(Elf32FileHeader_disk);
+        need = sizeof(Elf32FileHeader_disk);
     } else if (8==get_word_size()) {
-        newsize = sizeof(Elf64FileHeader_disk);
+        need = sizeof(Elf64FileHeader_disk);
     } else {
         throw FormatError("unsupported ELF word size");
     }
-
-    if (newsize > get_size()) {
-        ROSE_ASSERT(!"increasing ELF header size not supported yet"); /*FIXME*/
+    if (need < get_size()) {
+        if (is_mapped()) {
+            ROSE_ASSERT(get_mapped_size()==get_size());
+            set_mapped_size(need);
+        }
+        set_size(need);
         reallocated = true;
-    } else if (newsize < get_size()) {
-        set_size(newsize);
+    } else if (need > get_size()) {
+        get_file()->shift_extend(this, 0, need-get_size(), SgAsmGenericFile::ADDRSP_ALL, SgAsmGenericFile::ELASTIC_HOLE);
         reallocated = true;
     }
 
@@ -410,14 +426,12 @@
     if (p_segment_table) {
         ROSE_ASSERT(p_segment_table->get_header()==this);
         p_segment_table->unparse(f);
-        p_e_phoff = p_segment_table->get_offset();
     }
 
     /* Write the ELF section table and, indirectly, the sections themselves. */
     if (p_section_table) {
         ROSE_ASSERT(p_section_table->get_header()==this);
         p_section_table->unparse(f);
-        p_e_shoff = p_section_table->get_offset();
     }
     
     /* Encode and write the ELF file header */
@@ -631,26 +645,36 @@
     return calculate_sizes(0, 0, std::vector<size_t>(), entsize, required, optional, entcount);
 }
 
-/* Resize the section based on ELF word size. This is a no-op unless the section was defined in the ELF Section Table. */
+/* Called prior to unparse to make things consistent. */
 bool
 SgAsmElfSection::reallocate()
 {
-    if (get_section_entry()==NULL)
-        return false;
+    bool reallocated = false;
+    SgAsmElfSectionTableEntry *sechdr = get_section_entry();
+    SgAsmElfSegmentTableEntry *seghdr = get_segment_entry();
 
-    bool reallocated = false;
-    addr_t need = calculate_sizes(NULL, NULL, NULL, NULL);
-    if (need < get_size()) {
-        if (is_mapped()) {
-            ROSE_ASSERT(get_mapped_size()==get_size());
-            set_mapped_size(need);
+    /* Change section size if this section was defined in the ELF Section Table */
+    if (sechdr!=NULL) {
+        addr_t need = calculate_sizes(NULL, NULL, NULL, NULL);
+        if (need < get_size()) {
+            if (is_mapped()) {
+                ROSE_ASSERT(get_mapped_size()==get_size());
+                set_mapped_size(need);
+            }
+            set_size(need);
+            reallocated = true;
+        } else if (need > get_size()) {
+            get_file()->shift_extend(this, 0, need-get_size(), SgAsmGenericFile::ADDRSP_ALL, SgAsmGenericFile::ELASTIC_HOLE);
+            reallocated = true;
         }
-        set_size(need);
-        reallocated = true;
+    }
 
-    } else if (need > get_size()) {
-        ROSE_ASSERT(!"can't expand word size yet"); /*FIXME*/
-    }
+    /* Update entry in the ELF Section Table and/or ELF Segment Table */
+    if (sechdr)
+        sechdr->update_from_section(this);
+    if (seghdr)
+        seghdr->update_from_section(this);
+    
     return reallocated;
 }
 
@@ -704,7 +728,10 @@
 bool
 SgAsmElfStringSection::reallocate()
 {
-    return get_strtab()->reallocate(false);
+    bool reallocated = SgAsmElfSection::reallocate();
+    if (get_strtab()->reallocate(false))
+        reallocated = true;
+    return reallocated;
 }
 
 /* Unparse an ElfStringSection by unparsing the ElfStrtab */
@@ -1187,12 +1214,15 @@
     }
 }
 
-/* Resize the section table based on ELF word size */
+/* Pre-unparsing updates */
 bool
 SgAsmElfSectionTable::reallocate()
 {
     bool reallocated = false;
-    addr_t need = calculate_sizes(NULL, NULL, NULL, NULL);
+
+    /* Resize based on word size from ELF File Header */
+    size_t opt_size, nentries;
+    addr_t need = calculate_sizes(NULL, NULL, &opt_size, &nentries);
     if (need < get_size()) {
         if (is_mapped()) {
             ROSE_ASSERT(get_mapped_size()==get_size());
@@ -1202,8 +1232,16 @@
         reallocated = true;
         
     } else if (need > get_size()) {
-        ROSE_ASSERT(!"can't expand word size yet"); /*FIXME*/
+        get_file()->shift_extend(this, 0, need-get_size(), SgAsmGenericFile::ADDRSP_ALL, SgAsmGenericFile::ELASTIC_HOLE);
+        reallocated = true;
     }
+
+    /* Update data members in the ELF File Header. No need to return true for these changes. */
+    SgAsmElfFileHeader *fhdr = dynamic_cast<SgAsmElfFileHeader*>(get_header());
+    fhdr->set_e_shoff(get_offset());
+    fhdr->set_shextrasz(opt_size);
+    fhdr->set_e_shnum(nentries);
+
     return reallocated;
 }
 
@@ -1216,49 +1254,48 @@
     SgAsmElfFileHeader *fhdr = dynamic_cast<SgAsmElfFileHeader*>(get_header());
     ROSE_ASSERT(fhdr!=NULL);
     ByteOrder sex = fhdr->get_sex();
-    SgAsmGenericSectionPtrList sections = fhdr->get_sections()->get_sections();
+    SgAsmGenericSectionPtrList sections = fhdr->get_sectab_sections();
 
     /* Write the sections first */
-    for (size_t i=0; i<sections.size(); i++) {
-        if (sections[i]->get_id() >= 0) {
-            sections[i]->unparse(f);
-        }
-    }
+    for (size_t i=0; i<sections.size(); i++)
+        sections[i]->unparse(f);
 
-    /* Calculate sizes and update the ELF File Header */
+    /* Calculate sizes. The ELF File Header should have been updated in reallocate() prior to unparsing. */
     size_t ent_size, struct_size, opt_size, nentries;
     calculate_sizes(&ent_size, &struct_size, &opt_size, &nentries);
-    fhdr->set_shextrasz(opt_size);
-    fhdr->set_e_shnum(nentries);
+    ROSE_ASSERT(fhdr->get_e_shoff()==get_offset());
+    ROSE_ASSERT(fhdr->get_shextrasz()==opt_size);
+    ROSE_ASSERT(fhdr->get_e_shnum()==nentries);
     
     /* Write the section table entries */
     for (size_t i=0; i<sections.size(); ++i) {
         SgAsmElfSection *section = dynamic_cast<SgAsmElfSection*>(sections[i]);
-        SgAsmElfSectionTableEntry *shdr = section ? section->get_section_entry() : NULL;
-        if (shdr) {
-            shdr->update_from_section(section);
-            int id = section->get_id();
-            ROSE_ASSERT(id>=0 && (size_t)id<nentries);
+        ROSE_ASSERT(section!=NULL);
+        SgAsmElfSectionTableEntry *shdr = section->get_section_entry();
+        ROSE_ASSERT(shdr!=NULL);
+        ROSE_ASSERT(shdr->get_sh_offset()==section->get_offset()); /*section table entry should have been updated in reallocate()*/
 
-            SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk disk32;
-            SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk disk64;
-            void *disk  = NULL;
+        int id = section->get_id();
+        ROSE_ASSERT(id>=0 && (size_t)id<nentries);
 
-            if (4==fhdr->get_word_size()) {
-                disk = shdr->encode(sex, &disk32);
-            } else if (8==fhdr->get_word_size()) {
-                disk = shdr->encode(sex, &disk64);
-            } else {
-                ROSE_ASSERT(!"invalid word size");
-            }
+        SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk disk32;
+        SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk disk64;
+        void *disk  = NULL;
 
-            /* The disk struct */
-            addr_t spos = write(f, id*ent_size, struct_size, disk);
-            if (shdr->get_extra().size() > 0) {
-                ROSE_ASSERT(shdr->get_extra().size()<=opt_size);
-                write(f, spos, shdr->get_extra());
-            }
+        if (4==fhdr->get_word_size()) {
+            disk = shdr->encode(sex, &disk32);
+        } else if (8==fhdr->get_word_size()) {
+            disk = shdr->encode(sex, &disk64);
+        } else {
+            ROSE_ASSERT(!"invalid word size");
         }
+
+        /* The disk struct */
+        addr_t spos = write(f, id*ent_size, struct_size, disk);
+        if (shdr->get_extra().size() > 0) {
+            ROSE_ASSERT(shdr->get_extra().size()<=opt_size);
+            write(f, spos, shdr->get_extra());
+        }
     }
 
     unparse_holes(f);
@@ -1408,21 +1445,38 @@
     std::string s;
 
     switch (kind) {
-      case SgAsmElfSegmentTableEntry::PT_NULL:    s = "PT_NULL";    break;
-      case SgAsmElfSegmentTableEntry::PT_LOAD:    s = "PT_LOAD";    break;
-      case SgAsmElfSegmentTableEntry::PT_DYNAMIC: s = "PT_DYNAMIC"; break;
-      case SgAsmElfSegmentTableEntry::PT_INTERP:  s = "PT_INTERP";  break;
-      case SgAsmElfSegmentTableEntry::PT_NOTE:    s = "PT_NOTE";    break;
-      case SgAsmElfSegmentTableEntry::PT_SHLIB:   s = "PT_SHLIB";   break;
-      case SgAsmElfSegmentTableEntry::PT_PHDR:    s = "PT_PHDR";    break;
-      case SgAsmElfSegmentTableEntry::PT_LOPROC:  s = "PT_LOPROC";  break;
-      case SgAsmElfSegmentTableEntry::PT_HIPROC:  s = "PT_HIPROC";  break;
+      case SgAsmElfSegmentTableEntry::PT_NULL:    s = "PT_NULL";    break; // 0
+      case SgAsmElfSegmentTableEntry::PT_LOAD:    s = "PT_LOAD";    break; // 1
+      case SgAsmElfSegmentTableEntry::PT_DYNAMIC: s = "PT_DYNAMIC"; break; // 2
+      case SgAsmElfSegmentTableEntry::PT_INTERP:  s = "PT_INTERP";  break; // 3
+      case SgAsmElfSegmentTableEntry::PT_NOTE:    s = "PT_NOTE";    break; // 4
+      case SgAsmElfSegmentTableEntry::PT_SHLIB:   s = "PT_SHLIB";   break; // 5
+      case SgAsmElfSegmentTableEntry::PT_PHDR:    s = "PT_PHDR";    break; // 6
 
+   // DQ (10/31/2008): Added mising enum values to prevent run-time warnings
+   /* OS- and Processor-specific ranges */
+      case SgAsmElfSegmentTableEntry::PT_LOOS: s = "PT_LOOS";  break; // 0x60000000, Values reserved for OS-specific semantics
+      case SgAsmElfSegmentTableEntry::PT_HIOS: s = "PT_HIOS";  break; // 0x6fffffff,
+
+   /* Values reserved for processor-specific semantics */
+      case SgAsmElfSegmentTableEntry::PT_LOPROC: s = "PT_LOPROC";  break;
+      case SgAsmElfSegmentTableEntry::PT_HIPROC: s = "PT_HIPROC";  break;
+
+	 /* OS-specific values for GNU/Linux */
+      case SgAsmElfSegmentTableEntry::PT_GNU_EH_FRAME: s = "PT_GNU_EH_FRAME"; break; // 0x6474e550, /* GCC .eh_frame_hdr segment */
+      case SgAsmElfSegmentTableEntry::PT_GNU_STACK:    s = "PT_GNU_STACK";    break; // 0x6474e551, /* Indicates stack executability */
+      case SgAsmElfSegmentTableEntry::PT_GNU_RELRO:    s = "PT_GNU_RELRO";    break; // 0x6474e552, /* Read-only after relocation */
+      case SgAsmElfSegmentTableEntry::PT_PAX_FLAGS:    s = "PT_PAX_FLAGS";    break; // 0x65041580, /* Indicates PaX flag markings */
+
+	  /* OS-specific values for Sun */
+      case SgAsmElfSegmentTableEntry::PT_SUNWBSS:      s = "PT_SUNWBSS";   break; // 0x6ffffffa, /* Sun Specific segment */
+      case SgAsmElfSegmentTableEntry::PT_SUNWSTACK:    s = "PT_SUNWSTACK"; break; // 0x6ffffffb  /* Stack segment */
+
       default:
       {
           s = "error";
 
-          // DQ (8/29/2008): This case is exercised frequently, I think it warrants only a warning, instead of an error.
+       // DQ (8/29/2008): This case is exercised frequently, I think it warrants only a warning, instead of an error.
           printf ("Warning: default reached for SgAsmElfSegmentTableEntry::stringifyType = 0x%x \n",kind);
       }
     }
@@ -1567,12 +1621,15 @@
     return entry_size * nentries;
 }
 
-/* Resize the segment table based on ELF word size */
+/* Pre-unparsing updates */
 bool
 SgAsmElfSegmentTable::reallocate()
 {
     bool reallocated = false;
-    addr_t need = calculate_sizes(NULL, NULL, NULL, NULL);
+
+    /* Resize based on word size from ELF File Header */
+    size_t opt_size, nentries;
+    addr_t need = calculate_sizes(NULL, NULL, &opt_size, &nentries);
     if (need < get_size()) {
         if (is_mapped()) {
             ROSE_ASSERT(get_mapped_size()==get_size());
@@ -1580,10 +1637,17 @@
         }
         set_size(need);
         reallocated = true;
-
     } else if (need > get_size()) {
-        ROSE_ASSERT(!"can't expand word size yet"); /*FIXME*/
+        get_file()->shift_extend(this, 0, need-get_size(), SgAsmGenericFile::ADDRSP_ALL, SgAsmGenericFile::ELASTIC_HOLE);
+        reallocated = true;
     }
+
+    /* Update data members in the ELF File Header. No need to return true for these changes. */
+    SgAsmElfFileHeader *fhdr = dynamic_cast<SgAsmElfFileHeader*>(get_header());
+    fhdr->set_e_phoff(get_offset());
+    fhdr->set_phextrasz(opt_size);
+    fhdr->set_e_phnum(nentries);
+
     return reallocated;
 }
 
@@ -1596,48 +1660,46 @@
     SgAsmElfFileHeader *fhdr = dynamic_cast<SgAsmElfFileHeader*>(get_header());
     ROSE_ASSERT(fhdr!=NULL);
     ByteOrder sex = fhdr->get_sex();
-    SgAsmGenericSectionPtrList sections = fhdr->get_sections()->get_sections();
+    SgAsmGenericSectionPtrList sections = fhdr->get_segtab_sections();
 
     /* Write the segments first */
-    for (size_t i=0; i<sections.size(); i++) {
-        SgAsmElfSection *section = dynamic_cast<SgAsmElfSection*>(sections[i]);
-        if (section && section->get_segment_entry()) {
-            section->unparse(f);
-        }
-    }
+    for (size_t i=0; i<sections.size(); i++)
+        sections[i]->unparse(f);
 
     /* Calculate sizes and update the ELF File Header */
     size_t ent_size, struct_size, opt_size, nentries;
     calculate_sizes(&ent_size, &struct_size, &opt_size, &nentries);
-    fhdr->set_phextrasz(opt_size);
-    fhdr->set_e_phnum(nentries);
+    ROSE_ASSERT(fhdr->get_e_phoff()==get_offset());
+    ROSE_ASSERT(fhdr->get_phextrasz()==opt_size);
+    ROSE_ASSERT(fhdr->get_e_phnum()==nentries);
     
     /* Write the segment table entries */
     for (size_t i=0; i < sections.size(); ++i) {
         SgAsmElfSection *section = dynamic_cast<SgAsmElfSection*>(sections[i]);
-        SgAsmElfSegmentTableEntry *shdr = section ? section->get_segment_entry() : NULL;
-        if (shdr) {
-            shdr->update_from_section(section);
-            int id = shdr->get_index();
-            ROSE_ASSERT(id>=0 && (size_t)id<nentries);
+        ROSE_ASSERT(section!=NULL);
+        SgAsmElfSegmentTableEntry *shdr = section->get_segment_entry();
+        ROSE_ASSERT(shdr!=NULL);
+        ROSE_ASSERT(shdr->get_offset()==section->get_offset()); /*segment table entry should have been updated in reallocate()*/
+
+        int id = shdr->get_index();
+        ROSE_ASSERT(id>=0 && (size_t)id<nentries);
             
-            SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk disk32;
-            SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk disk64;
-            void *disk = NULL;
+        SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk disk32;
+        SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk disk64;
+        void *disk = NULL;
         
-            if (4==fhdr->get_word_size()) {
-                disk = shdr->encode(sex, &disk32);
-            } else if (8==fhdr->get_word_size()) {
-                disk = shdr->encode(sex, &disk64);
-            } else {
-                ROSE_ASSERT(!"invalid word size");
-            }
+        if (4==fhdr->get_word_size()) {
+            disk = shdr->encode(sex, &disk32);
+        } else if (8==fhdr->get_word_size()) {
+            disk = shdr->encode(sex, &disk64);
+        } else {
+            ROSE_ASSERT(!"invalid word size");
+        }
         
-            /* The disk struct */
-            addr_t spos = write(f, id*ent_size, struct_size, disk);
-            if (shdr->get_extra().size() > 0)
-                write(f, spos, shdr->get_extra());
-        }
+        /* The disk struct */
+        addr_t spos = write(f, id*ent_size, struct_size, disk);
+        if (shdr->get_extra().size() > 0)
+            write(f, spos, shdr->get_extra());
     }
 
     unparse_holes(f);
@@ -1976,7 +2038,7 @@
     strcpy(label, stringify_tag(p_d_tag));
     for (char *s=label; *s; s++) *s = tolower(*s);
 
-    fprintf(f, "%s%-*s = 0x%08"PRIx64" (%"PRIu64")\n", p, w, label, p_d_val.get_rva(), p_d_val.get_rva());
+    fprintf(f, "%s%-*s = %s\n", p, w, label, p_d_val.to_string().c_str());
     if (p_extra.size()>0) {
         fprintf(f, "%s%-*s = %zu bytes\n", p, w, "extra", p_extra.size());
         hexdump(f, 0, std::string(p)+"extra at ", p_extra);
@@ -2541,10 +2603,7 @@
 
     /* Associate the entry point with a particular section. */
     ROSE_ASSERT(fhdr->get_entry_rvas().size()==1);
-    addr_t entry_va = fhdr->get_entry_rvas()[0].get_rva() + fhdr->get_base_va();
-    SgAsmGenericSection *secbind = fhdr->get_best_section_by_va(entry_va);
-    fhdr->get_entry_rvas()[0].set_section(secbind);
-    ROSE_ASSERT(fhdr->get_entry_rvas()[0].get_section()==secbind);
+    fhdr->get_entry_rvas()[0].set_section(fhdr);
 
     /* Use symbols from either ".symtab" or ".dynsym" */
     SgAsmElfSymbolSection *symtab = dynamic_cast<SgAsmElfSymbolSection*>(ef->get_section_by_name(".symtab"));

Modified: branches/rice/src/frontend/ExecFormats/ROSE_ExecGeneric.C
===================================================================
--- branches/rice/src/frontend/ExecFormats/ROSE_ExecGeneric.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/ExecFormats/ROSE_ExecGeneric.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -20,6 +20,13 @@
 // A rose_rva_t is optionally tied to an SgAsmGenericSection so that if the mapped address of the section is modified then
 // the RVA stored in the rose_rva_t object is also adjusted.  The section-relative offset is always treated as an unsigned
 // quantity, but negative offsets can be accommodated via integer overflow.
+//
+// Be careful about adjusting the RVA (the address or section) using ROSETTA's accessors.
+//     symbol.p_address.set_section(section);          // this works
+//     symbol.get_address().set_section(section);      // using ROSETTA accessor modifies a temporary copy of the RVA
+// But if ROSETTA returns a vector then we can modify the RVA:
+//     symbol.p_addresses[0].set_section(section);     // this works
+//     symbol.get_addresses()[0].set_section(section); // so does this.
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 rose_addr_t
@@ -30,12 +37,13 @@
     return rva;
 }
 
-void
+rose_rva_t&
 rose_rva_t::set_rva(rose_addr_t rva)
 {
     addr = rva;
     if (section)
         addr -= section->get_mapped_rva();
+    return *this;
 }
 
 SgAsmGenericSection *
@@ -44,7 +52,7 @@
     return section;
 }
 
-void
+rose_rva_t&
 rose_rva_t::set_section(SgAsmGenericSection *new_section)
 {
     if (section) {
@@ -55,12 +63,54 @@
         addr -= new_section->get_mapped_rva();
     }
     section = new_section;
+    return *this;
 }
 
+/* Set the section to the section that best (most specifically) describes the virtual address */
+rose_rva_t&
+rose_rva_t::set_section(SgAsmGenericHeader *fhdr)
+{
+    rose_addr_t va = get_rva() + fhdr->get_base_va();
+    SgAsmGenericSection *secbind = fhdr->get_best_section_by_va(va);
+    return set_section(secbind);
+}
+
+/* Return address relative to currently bound section */
+rose_addr_t
+rose_rva_t::get_rel() const
+{
+    return addr;
+}
+
+/* Return address relative to specified section */
+rose_addr_t
+rose_rva_t::get_rel(SgAsmGenericSection *s)
+{
+    ROSE_ASSERT(s!=NULL);
+    ROSE_ASSERT(s->is_mapped());
+    ROSE_ASSERT(get_rva() >= s->get_mapped_rva());
+    return get_rva() - s->get_mapped_rva();
+}
+
+/* Convert to a string representation */
+std::string
+rose_rva_t::to_string() const
+{
+    char s[1024];
+    sprintf(s, "0x%08"PRIx64" (%"PRIu64")", get_rva(), get_rva());
+    std::string ss = s;
+
+    if (get_section()) {
+        sprintf(s, " + 0x%08"PRIx64" (%"PRIu64")", get_rel(), get_rel());
+        ss += " <" + get_section()->get_name()->get_string() + s + ">";
+    }
+    return ss;
+}
+
 std::ostream &
 operator<<(std::ostream &os, const rose_rva_t &rva)
 {
-    os << rva.get_rva();
+    os << rva.to_string();
     return os;
 }
 
@@ -399,7 +449,7 @@
         ROSE_ASSERT(!recursive);
         recursive = reallocated = true;
         try {
-            container->get_file()->shift_extend(container, 0, extend_size, true, true);
+            container->get_file()->shift_extend(container, 0, extend_size);
             reallocate(false);
             recursive = false;
         } catch (...) {
@@ -550,7 +600,7 @@
 }
     
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// ExecFile
+// SgAsmGenericFile
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 /* Constructs by mapping file contents into memory */
@@ -698,13 +748,14 @@
 
 /* Returns list of all sections in the file (including headers, holes, etc). */
 SgAsmGenericSectionPtrList
-SgAsmGenericFile::get_sections()
+SgAsmGenericFile::get_sections(bool include_holes)
 {
     SgAsmGenericSectionPtrList retval;
 
     /* Start with headers and holes */
     retval.insert(retval.end(), p_headers->get_headers().begin(), p_headers->get_headers().end());
-    retval.insert(retval.end(), p_holes->get_sections().begin(), p_holes->get_sections().end());
+    if (include_holes)
+        retval.insert(retval.end(), p_holes->get_sections().begin(), p_holes->get_sections().end());
 
     /* Add sections pointed to by headers. */
     for (SgAsmGenericHeaderPtrList::iterator i=p_headers->get_headers().begin(); i!=p_headers->get_headers().end(); ++i) {
@@ -714,6 +765,19 @@
     return retval;
 }
 
+/* Returns list of all sections in the file that are memory mapped, including headers and holes. */
+SgAsmGenericSectionPtrList
+SgAsmGenericFile::get_mapped_sections()
+{
+    SgAsmGenericSectionPtrList retval;
+    SgAsmGenericSectionPtrList all = get_sections(true);
+    for (size_t i=0; i<all.size(); i++) {
+        if (all[i]->is_mapped())
+            retval.push_back(all[i]);
+    }
+    return retval;
+}
+
 /* Returns sections having specified ID across all headers, including headers and holes. */
 SgAsmGenericSectionPtrList
 SgAsmGenericFile::get_sections_by_id(int id)
@@ -928,6 +992,8 @@
 SgAsmGenericSection *
 SgAsmGenericFile::best_section_by_va(const SgAsmGenericSectionPtrList &sections, addr_t va)
 {
+    if (0==sections.size())
+        return NULL;
     if (1==sections.size()) 
         return sections[0];
     SgAsmGenericSection *best = sections[0];
@@ -1043,11 +1109,19 @@
  * The neighborhood(S) is S itself and the set of all sections that overlap or are adjacent to the neighborhood of S,
  * recursively.
  *
- * A "hole" is an area of the address space that is not occupied by any section (including sections named "hole"
- * that are synthesized to occupy otherwise unreferenced file extents).  In general, making a modification to S will affect
- * sections not entirely to the left of S. However, if there's a hole to the right of neighborhood(S) and the "elastic"
- * argument is true then we utilize the hole's address space in order to limit the effect of sections right of the hole.
+ * The address space can be partitioned into three categories:
+ *     - Section: part of an address space that is referenced by an SgAsmGenericSection other than a "hole" section.
+ *     - Hole:    part of an address space that is referenced only by a "hole" section.
+ *     - Unref:   part of an address space that is not used by any section, including any "hole" section.
+ * 
+ * The last two categories define parts of the address space that can be optionally elastic--they expand or contract
+ * to take up slack or provide space for neighboring sections. This is controlled by the "elasticity" argument.
  *
+ * Note that when elasticity is ELASTIC_HOLE we simply ignore the "hole" sections, effectively removing their addresses from
+ * the range of addresses under consideration. This avoids complications that arise when a "hole" overlaps with a real section
+ * (due to someone changing offsets in an incompatible manner), but causes the hole offset and size to remain fixed.
+ * (FIXME RPM 2008-10-20)
+ *
  * When section S is shifted by 'Sa' bytes and/or enlarged by 'Sn' bytes, other sections are affected as follows:
  *     Cat L:  Not affected
  *     Cat R:  Shifted by Sa+Sn if they are in neighborhood(S). Otherwise the amount of shifting depends on the size of the
@@ -1059,45 +1133,90 @@
  *     Cat B:  Not shifted, but enlarged Sn
  *     Cat E:  Shifted Sa and enlarged Sn
  *
- * If 'filespace' is set then offsets and sizes are file offsets and sizes, otherwise they are memory offsets and sizes.
- * Modifying file space also modifies the memory space.
+ * Generally speaking, the "space" argument should be SgAsmGenericFile::ADDRSP_ALL in order to adjust both file and memory
+ * offsets and sizes in a consistent manner.
  *
- * NOTE: To change the address and/or size of S without regard to other sections in the same file, use set_offset() and
- *       set_size() (for file address space) or set_mapped_rva() and set_mapped_size() (for memory address space).
+ * To change the address and/or size of S without regard to other sections in the same file, use set_offset() and set_size()
+ * (for file address space) or set_mapped_rva() and set_mapped_size() (for memory address space).
  */
 void
-SgAsmGenericFile::shift_extend(SgAsmGenericSection *s, addr_t sa, addr_t sn, bool filespace, bool elastic_holes)
+SgAsmGenericFile::shift_extend(SgAsmGenericSection *s, addr_t sa, addr_t sn, AddressSpace space, Elasticity elasticity)
 {
     ROSE_ASSERT(s!=NULL);
     ROSE_ASSERT(s->get_file()==this);
     ROSE_ASSERT(s->get_congealed()==true); /* must be done parsing */
+    ROSE_ASSERT(space & (ADDRSP_FILE|ADDRSP_MEMORY) != 0);
 
     const bool debug = false;
     static size_t ncalls=0;
     char p[256];
 
     if (debug) {
+        const char *space_s="unknown";
+        if (space & ADDRSP_FILE) {
+            space_s = "file";
+        } else if (space & ADDRSP_MEMORY) {
+            space_s = "memory";
+        }
         sprintf(p, "SgAsmGenericFile::shift_extend[%zu]: ", ncalls++);
         fprintf(stderr, "%s    -- START --\n", p);
         fprintf(stderr, "%s    S = [%d] \"%s\"\n", p, s->get_id(), s->get_name()->c_str());
-        fprintf(stderr, "%s    %s Sa=0x%08"PRIx64" (%"PRIu64"), Sn=0x%08"PRIx64" (%"PRIu64")\n",
-                p, filespace ? "file" : "memory", sa, sa, sn, sn);
+        fprintf(stderr, "%s    %s Sa=0x%08"PRIx64" (%"PRIu64"), Sn=0x%08"PRIx64" (%"PRIu64")\n", p, space_s, sa, sa, sn, sn);
+        fprintf(stderr, "%s    elasticity = %s\n", p, (ELASTIC_NONE==elasticity ? "none" :
+                                                       ELASTIC_UNREF==elasticity ? "unref" :
+                                                       ELASTIC_HOLE==elasticity ? "unref+holes" :
+                                                       "unknown"));
     }
+
+    /* No-op case */
+    if (0==sa && 0==sn) {
+        if (debug) {
+            fprintf(stderr, "%s    No change necessary.\n", p);
+            fprintf(stderr, "%s    -- END --\n", p);
+        }
+        return;
+    }
     
+    bool filespace = (space & ADDRSP_FILE)!=0;
+    bool memspace = (space & ADDRSP_MEMORY)!=0;
     addr_t align=1, aligned_sa, aligned_sasn;
-    SgAsmGenericSectionPtrList all = get_sections();
     SgAsmGenericSectionPtrList neighbors, villagers;
     ExtentMap amap; /* address mappings for all extents */
-    ExtentPair nhs; /* neighborhood of S */
     ExtentPair sp;
 
+    /* Get a list of all sections that may need to be adjusted. */
+    SgAsmGenericSectionPtrList all;
+    switch (elasticity) {
+      case ELASTIC_NONE:
+      case ELASTIC_UNREF:
+        all = filespace ? get_sections() : get_mapped_sections();
+        break;
+      case ELASTIC_HOLE:
+        all = filespace ? get_sections(false) : get_mapped_sections();
+        break;
+    }
+    if (debug) {
+        fprintf(stderr, "%s    Following sections are in 'all' set:\n", p);
+        for (size_t i=0; i<all.size(); i++) {
+            ExtentPair ep;
+            if (filespace) {
+                ep = all[i]->get_file_extent();
+            } else {
+                ROSE_ASSERT(all[i]->is_mapped());
+                ep = all[i]->get_mapped_extent();
+            }
+            fprintf(stderr, "%s        0x%08"PRIx64" 0x%08"PRIx64" 0x%08"PRIx64" [%d] \"%s\"\n",
+                    p, ep.first, ep.second, ep.first+ep.second, all[i]->get_id(), all[i]->get_name()->c_str());
+        }
+    }
+
     for (size_t pass=0; pass<2; pass++) {
         if (debug) fprintf(stderr, "%s    -- PASS %zu --\n", p, pass);
 
         /* S offset and size in file or memory address space */
         if (filespace) {
             sp = s->get_file_extent();
-        } else if (!s->is_mapped()) {
+        } else if (!memspace || !s->is_mapped()) {
             return; /*nothing to do*/
         } else {
             sp = s->get_mapped_extent();
@@ -1107,21 +1226,37 @@
         for (size_t i=0; i<all.size(); i++) {
             if (filespace) {
                 amap.insert(all[i]->get_file_extent());
-            } else if (all[i]->is_mapped()) {
+            } else {
+                ROSE_ASSERT(all[i]->is_mapped());
                 amap.insert(all[i]->get_mapped_extent());
             }
         }
-
+        if (debug) {
+            fprintf(stderr, "%s    Address map:\n", p);
+            amap.dump_extents(stderr, (std::string(p)+"        ").c_str(), "amap");
+            fprintf(stderr, "%s    Extent of S:\n", p);
+            fprintf(stderr, "%s        start=0x%08"PRIx64" size=0x%08"PRIx64" end=0x%08"PRIx64"\n",
+                    p, sp.first, sp.second, sp.first+sp.second);
+        }
+        
         /* Neighborhood (nhs) of S is a single extent */
         ExtentMap nhs_map = amap.overlap_with(sp);
+        if (debug) {
+            fprintf(stderr, "%s    Neighborhood of S:\n", p);
+            nhs_map.dump_extents(stderr, (std::string(p)+"        ").c_str(), "nhs_map");
+        }
         ROSE_ASSERT(nhs_map.size()==1);
-        nhs = *(nhs_map.begin());
+        ExtentPair nhs = *(nhs_map.begin());
 
         /* What sections are in the neighborhood (including S), and right of the neighborhood? */
         neighbors.clear(); /*sections in neighborhood*/
+        neighbors.push_back(s);
         villagers.clear(); /*sections right of neighborhood*/
+        if (debug)
+            fprintf(stderr, "%s    Ignoring left (L) sections:\n", p);
         for (size_t i=0; i<all.size(); i++) {
             SgAsmGenericSection *a = all[i];
+            if (a==s) continue; /*already pushed onto neighbors*/
             ExtentPair ap;
             if (filespace) {
                 ap = a->get_file_extent();
@@ -1132,12 +1267,15 @@
             }
             switch (ExtentMap::category(ap, nhs)) {
               case 'L':
+                if (debug)
+                    fprintf(stderr, "%s        L 0x%08"PRIx64" 0x%08"PRIx64" 0x%08"PRIx64" [%d] \"%s\"\n", 
+                            p, ap.first, ap.second, ap.first+ap.second, a->get_id(), a->get_name()->c_str());
                 break;
               case 'R':
                 /* If holes are elastic then treat things right of the hole as being part of the right village; otherwise
                  * add those sections to the neighborhood of S even though they fall outside 'nhs' (it's OK because this
                  * partitioning of sections is the only thing we use 'nhs' for anyway. */
-                if (elastic_holes) {
+                if (elasticity!=ELASTIC_NONE) {
                     villagers.push_back(a);
                 } else if ('L'!=ExtentMap::category(ap, sp)) { /*ignore sections left of S*/
                     neighbors.push_back(a);
@@ -1227,7 +1365,7 @@
             fprintf(stderr, "%s    Calling recursively to increase hole size by 0x%08"PRIx64" (%"PRIu64") bytes\n",
                     p, need_more, need_more);
         }
-        shift_extend(after_hole, need_more, 0, filespace, elastic_holes);
+        shift_extend(after_hole, need_more, 0, space, elasticity);
         if (debug) fprintf(stderr, "%s    Returned from recursive call\n", p);
     }
 
@@ -1252,8 +1390,8 @@
             if (filespace) {
                 a->set_offset(a->get_offset()+aligned_sa);
                 a->set_size(a->get_size()+sn);
-                if (!resized_mem && a->is_mapped()) {
-                    shift_extend(a, 0, sn, false, elastic_holes);
+                if (memspace && !resized_mem && a->is_mapped()) {
+                    shift_extend(a, 0, sn, ADDRSP_MEMORY, elasticity);
                     resized_mem = true;
                 }
             } else {
@@ -1273,8 +1411,8 @@
             } else {
                 if (filespace) {
                     a->set_size(a->get_size()+aligned_sasn);
-                    if (!resized_mem && a->is_mapped()) {
-                        shift_extend(a, 0, aligned_sasn, false, elastic_holes);
+                    if (memspace && !resized_mem && a->is_mapped()) {
+                        shift_extend(a, 0, aligned_sasn, ADDRSP_MEMORY, elasticity);
                         resized_mem = true;
                     }
                 } else {
@@ -1292,8 +1430,8 @@
           case 'B':
             if (filespace) {
                 a->set_size(a->get_size()+sn);
-                if (!resized_mem && a->is_mapped()) {
-                    shift_extend(a, 0, sn, false, elastic_holes);
+                if (memspace && !resized_mem && a->is_mapped()) {
+                    shift_extend(a, 0, sn, ADDRSP_MEMORY, elasticity);
                     resized_mem = true;
                 }
             } else {
@@ -1530,7 +1668,7 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// ExecSection
+// GenericSection
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 /* Constructor.
@@ -2183,7 +2321,7 @@
 {
     ExtentMap result;
     for (const_iterator i=begin(); i!=end(); ++i) {
-        if ((*i).first < offset+size && (*i).first+(*i).second > offset)
+        if ((*i).first <= offset+size && (*i).first+(*i).second > offset)
             result.super::insert(value_type((*i).first, (*i).second));
     }
     return result;
@@ -2289,8 +2427,12 @@
         if (!label) label = "Extent";
         sprintf(p, "%s%s[%zd]", prefix, label, idx);
         int w = std::max(1, DUMP_FIELD_WIDTH-(int)strlen(p));
-        fprintf(f, "%s%-*s = offset 0x%08"PRIx64" (%"PRIu64"), for 0x%08"PRIx64" (%"PRIu64") byte%s\n",
-                p, w, "", (*i).first, (*i).first, (*i).second, (*i).second, 1==(*i).second?"":"s");
+        fprintf(f, "%s%-*s = offset 0x%08"PRIx64" (%"PRIu64"),"
+                " for 0x%08"PRIx64" (%"PRIu64") byte%s,"
+                " ending at 0x%08"PRIx64" (%"PRIu64")\n",
+                p, w, "", (*i).first, (*i).first,
+                (*i).second, (*i).second, 1==(*i).second?"":"s", 
+                (*i).first+(*i).second, (*i).first+(*i).second);
     }
 }
 
@@ -2464,6 +2606,19 @@
     p_symbols->get_symbols().back()->set_parent(p_symbols);
 }
 
+/* Returns the list of sections that are memory mapped */
+SgAsmGenericSectionPtrList
+SgAsmGenericHeader::get_mapped_sections()
+{
+    SgAsmGenericSectionPtrList retval;
+    for (SgAsmGenericSectionPtrList::iterator i=p_sections->get_sections().begin(); i!=p_sections->get_sections().end(); ++i) {
+        if ((*i)->is_mapped()) {
+            retval.push_back(*i);
+        }
+    }
+    return retval;
+}
+    
 /* Returns sections in this header that have the specified ID. */
 SgAsmGenericSectionPtrList
 SgAsmGenericHeader::get_sections_by_id(int id)
@@ -2779,6 +2934,413 @@
 // functions
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
+
+SgAsmExecutableFileFormat::ByteOrder
+SgAsmExecutableFileFormat::host_order()
+{
+    static const int i = 1;
+    return *(unsigned char*)&i ? ORDER_LSB : ORDER_MSB;
+}
+
+/* Swap (reverse) bytes taking care of sign extension */
+uint8_t
+SgAsmExecutableFileFormat::swap_bytes(uint8_t n)
+{
+    return n;
+}
+
+uint16_t
+SgAsmExecutableFileFormat::swap_bytes(uint16_t n)
+{
+    return ((n>>8) & 0xff) | ((n<<8) & 0xff00);
+}
+
+uint32_t
+SgAsmExecutableFileFormat::swap_bytes(uint32_t n)
+{
+    return ((n>>24) & 0xff) | ((n>>8) & 0xff00) | ((n<<8) & 0xff0000) | ((n<<24) & 0xff000000u);
+}
+
+uint64_t
+SgAsmExecutableFileFormat::swap_bytes(uint64_t n)
+{
+    return (((n>>56) & (0xffull<<0 )) | ((n>>40) & (0xffull<<8 )) | ((n>>24) & (0xffull<<16)) | ((n>>8 ) & (0xffull<<24)) |
+            ((n<<8 ) & (0xffull<<32)) | ((n<<24) & (0xffull<<40)) | ((n<<40) & (0xffull<<48)) | ((n<<56) & (0xffull<<56)));
+}
+
+int8_t
+SgAsmExecutableFileFormat::swap_bytes(int8_t n)
+{
+    return swap_bytes((uint8_t)n);
+}
+
+int16_t
+SgAsmExecutableFileFormat::swap_bytes(int16_t n)
+{
+    return swap_bytes((uint16_t)n);
+}
+
+int32_t
+SgAsmExecutableFileFormat::swap_bytes(int32_t n)
+{
+    return swap_bytes((uint32_t)n);
+}
+
+int64_t
+SgAsmExecutableFileFormat::swap_bytes(int64_t n)
+{
+    return swap_bytes((uint64_t)n);
+}
+
+/* Little-endian byte order conversions */
+uint8_t
+SgAsmExecutableFileFormat::le_to_host(uint8_t n)
+{
+    return ORDER_LSB==host_order() ? n : swap_bytes(n);
+}
+
+uint16_t
+SgAsmExecutableFileFormat::le_to_host(uint16_t n)
+{
+    return ORDER_LSB==host_order() ? n : swap_bytes(n);
+}
+
+uint32_t
+SgAsmExecutableFileFormat::le_to_host(uint32_t n)
+{
+    return ORDER_LSB==host_order() ? n : swap_bytes(n);
+}
+
+uint64_t
+SgAsmExecutableFileFormat::le_to_host(uint64_t n)
+{
+    return ORDER_LSB==host_order() ? n : swap_bytes(n);
+}
+
+int8_t
+SgAsmExecutableFileFormat::le_to_host(int8_t n)
+{
+    return ORDER_LSB==host_order() ? n : swap_bytes(n);
+}
+
+int16_t
+SgAsmExecutableFileFormat::le_to_host(int16_t n)
+{
+    return ORDER_LSB==host_order() ? n : swap_bytes(n);
+}
+
+int32_t
+SgAsmExecutableFileFormat::le_to_host(int32_t n)
+{
+    return ORDER_LSB==host_order() ? n : swap_bytes(n);
+}
+
+int64_t
+SgAsmExecutableFileFormat::le_to_host(int64_t n)
+{
+    return ORDER_LSB==host_order() ? n : swap_bytes(n);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(unsigned h, uint8_t *n)
+{
+    assert(0==(h & ~0xff));
+    uint8_t hh = h;
+    *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(unsigned h, uint16_t *n)
+{
+    assert(0==(h & ~0xffff));
+    uint16_t hh = h;
+    *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(unsigned h, uint32_t *n)
+{
+    assert(0==(h & ~0xfffffffful));
+    uint32_t hh = h;
+    *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(addr_t h, uint64_t *n)
+{
+    assert(0==(h & ~0xffffffffffffffffull));
+    uint64_t hh = h;
+    *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(rva_t h, uint32_t *n)
+{
+    host_to_le(h.get_rva(), n);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(rva_t h, uint64_t *n)
+{
+    host_to_le(h.get_rva(), n);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(int h, int8_t *n)
+{
+    assert((unsigned)h<=0x8f || ((unsigned)h|0xff)==(unsigned)-1);
+    int8_t hh = h;
+    *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(int h, int16_t *n)
+{
+    assert((unsigned)h<=0x8fff || ((unsigned)h|0xffff)==(unsigned)-1);
+    int16_t hh = h;
+    *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(int h, int32_t *n)
+{
+    assert((unsigned)h<=0x8fffffffu || ((unsigned)h|0xffffffffu)==(unsigned)-1);
+    int32_t hh = h;
+    *n = ORDER_LSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_le(int64_t h, int64_t *n)
+{
+    *n = ORDER_LSB==host_order() ? h : swap_bytes(h);
+}
+
+/* Big-endian byte order conversions */
+uint8_t
+SgAsmExecutableFileFormat::be_to_host(uint8_t n)
+{
+    return ORDER_MSB==host_order() ? n : swap_bytes(n);
+}
+
+uint16_t
+SgAsmExecutableFileFormat::be_to_host(uint16_t n)
+{
+    return ORDER_MSB==host_order() ? n : swap_bytes(n);
+}
+
+uint32_t
+SgAsmExecutableFileFormat::be_to_host(uint32_t n)
+{
+    return ORDER_MSB==host_order() ? n : swap_bytes(n);
+}
+
+uint64_t
+SgAsmExecutableFileFormat::be_to_host(uint64_t n)
+{
+    return ORDER_MSB==host_order() ? n : swap_bytes(n);
+}
+
+int8_t
+SgAsmExecutableFileFormat::be_to_host(int8_t n)
+{
+    return ORDER_MSB==host_order() ? n : swap_bytes(n);
+}
+
+int16_t
+SgAsmExecutableFileFormat::be_to_host(int16_t n)
+{
+    return ORDER_MSB==host_order() ? n : swap_bytes(n);
+}
+
+int32_t
+SgAsmExecutableFileFormat::be_to_host(int32_t n)
+{
+    return ORDER_MSB==host_order() ? n : swap_bytes(n);
+}
+
+int64_t
+SgAsmExecutableFileFormat::be_to_host(int64_t n)
+{
+    return ORDER_MSB==host_order() ? n : swap_bytes(n);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(unsigned h, uint8_t *n)
+{
+    assert(0==(h & ~0xff));
+    uint8_t hh = h;
+    *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(unsigned h, uint16_t *n)
+{
+    assert(0==(h & ~0xffff));
+    uint16_t hh = h;
+    *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(unsigned h, uint32_t *n)
+{
+    assert(0==(h & ~0xfffffffful));
+    uint32_t hh = h;
+    *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(addr_t h, uint64_t *n)
+{
+    assert(0==(h & ~0xffffffffffffffffull));
+    uint64_t hh = h;
+    *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(rva_t h, uint32_t *n)
+{
+    host_to_be(h.get_rva(), n);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(rva_t h, uint64_t *n)
+{
+    host_to_be(h.get_rva(), n);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(int h, int8_t *n)
+{
+    assert((unsigned)h<0x8f || ((unsigned)h|0xff)==(unsigned)-1);
+    int8_t hh = h;
+    *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(int h, int16_t *n)
+{
+    assert((unsigned)h<0x8fff || ((unsigned)h|0xffff)==(unsigned)-1);
+    int16_t hh = h;
+    *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(int h, int32_t *n)
+{
+    assert((unsigned)h<0x8ffffffful || ((unsigned)h|0xfffffffful)==(unsigned)-1);
+    int32_t hh = h;
+    *n = ORDER_MSB==host_order() ? hh : swap_bytes(hh);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_be(int64_t h, int64_t *n)
+{
+    *n = ORDER_MSB==host_order() ? h : swap_bytes(h);
+}
+
+/* Caller-specified byte order conversions */
+uint8_t
+SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, uint8_t n)
+{
+    return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
+}
+
+uint16_t
+SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, uint16_t n)
+{
+    return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
+}
+
+uint32_t
+SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, uint32_t n)
+{
+    return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
+}
+
+uint64_t
+SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, uint64_t n)
+{
+    return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
+}
+
+int8_t
+SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, int8_t n)
+{
+    return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
+}
+
+int16_t
+SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, int16_t n)
+{
+    return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
+}
+
+int32_t
+SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, int32_t n)
+{
+    return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
+}
+
+int64_t
+SgAsmExecutableFileFormat::disk_to_host(SgAsmExecutableFileFormat::ByteOrder sex, int64_t n)
+{
+    return ORDER_LSB==sex ? le_to_host(n) : be_to_host(n);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, unsigned h, uint8_t *np)
+{
+    ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, unsigned h, uint16_t *np)
+{
+    ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, unsigned h, uint32_t *np)
+{
+    ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, addr_t h, uint64_t *np)
+{
+    ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, rva_t h, uint64_t *np)
+{
+    host_to_disk(sex, h.get_rva(), np);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int h, int8_t *np)
+{
+    ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int h, int16_t *np)
+{
+    ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int h, int32_t *np)
+{
+    ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
+}
+
+void
+SgAsmExecutableFileFormat::host_to_disk(SgAsmExecutableFileFormat::ByteOrder sex, int64_t h, int64_t *np)
+{
+    ORDER_LSB==sex ? host_to_le(h, np) : host_to_be(h, np);
+}
+
 /* Works like hexdump -C to display N bytes of DATA. The "prefix" can be used for whitespace to intent the output. */
 void
 SgAsmExecutableFileFormat::hexdump(FILE *f, addr_t base_addr, const char *prefix, const unsigned char *data, size_t n)

Modified: branches/rice/src/frontend/ExecFormats/ROSE_ExecPE.C
===================================================================
--- branches/rice/src/frontend/ExecFormats/ROSE_ExecPE.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/ExecFormats/ROSE_ExecPE.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -4,6 +4,8 @@
 #define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 
+#define ALIGN(ADDR,ALMNT)       ((((ADDR)+(ALMNT)-1)/(ALMNT))*(ALMNT))
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Extended DOS File Header
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -86,7 +88,8 @@
     fprintf(f, "%s%-*s = %u\n",                     p, w, "e_res2[9]",  p_e_res2[9]);
     fprintf(f, "%s%-*s = %"PRIu64" byte offset (0x%"PRIx64")\n",  p, w, "e_lfanew",   p_e_lfanew,p_e_lfanew);
 
-    hexdump(f, 0, std::string(p)+"data at ", p_data);
+    if (variantT() == V_SgAsmPEExtendedDOSHeader) //unless a base class
+        hexdump(f, 0, std::string(p)+"data at ", p_data);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -101,7 +104,7 @@
     set_synthesized(true);
     set_purpose(SP_HEADER);
 
- // DQ (8/16/2008): Added code to set SgAsmPEFileHeader as parent of input SgAsmGenericFile
+    // DQ (8/16/2008): Added code to set SgAsmPEFileHeader as parent of input SgAsmGenericFile
     f->set_parent(this);
 
     p_rvasize_pairs = new SgAsmPERVASizePairList;
@@ -115,7 +118,7 @@
     if (fh.e_magic[0]!='P' || fh.e_magic[1]!='E' || fh.e_magic[2]!='\0' || fh.e_magic[3]!='\0')
         throw FormatError("Bad PE magic number");
 
-    /* Decode file header */
+    /* Decode COFF file header */
     p_e_cpu_type           = le_to_host(fh.e_cpu_type);
     p_e_nsections          = le_to_host(fh.e_nsections);
     p_e_time               = le_to_host(fh.e_time);
@@ -124,7 +127,8 @@
     p_e_nt_hdr_size        = le_to_host(fh.e_nt_hdr_size);
     p_e_flags              = le_to_host(fh.e_flags);
 
-    /* Read the optional header, the size of which is stored in the e_nt_hdr_size of the main PE file header. According to
+    /* Read the "Optional Header" (optional in the sense that not all files have one, but required for an executable), the
+     * size of which is stored in the e_nt_hdr_size of the main PE file header. According to 
      * http://www.phreedom.org/solar/code/tinype the Windows loader honors the e_nt_hdr_size even when set to smaller than the
      * smallest possible documented size of the optional header. Also it's possible for the optional header to extend beyond
      * the end of the file, in which case that part should be read as zero. */
@@ -135,18 +139,26 @@
     content(sizeof fh, sizeof oh32, &oh32);
     p_e_opt_magic = le_to_host(oh32.e_opt_magic);
     
+    /* File format */
+    p_exec_format->set_family(FAMILY_PE);
+    p_exec_format->set_purpose(p_e_flags & HF_PROGRAM ? PURPOSE_EXECUTABLE : PURPOSE_LIBRARY);
+    p_exec_format->set_sex(ORDER_LSB);
+    p_exec_format->set_abi(ABI_NT);
+    p_exec_format->set_abi_version(0);
+    p_exec_format->set_word_size(0x010b==p_e_opt_magic? 4 : 8);
+
     /* Decode the optional header. */
-    if (0x010b == p_e_opt_magic) {                                           
-        p_exec_format->set_word_size(4);
+    addr_t entry_rva;
+    if (4==p_exec_format->get_word_size()) {
         p_e_lmajor             = le_to_host(oh32.e_lmajor);
         p_e_lminor             = le_to_host(oh32.e_lminor);
         p_e_code_size          = le_to_host(oh32.e_code_size);
         p_e_data_size          = le_to_host(oh32.e_data_size);
         p_e_bss_size           = le_to_host(oh32.e_bss_size);
-        p_e_entrypoint_rva     = le_to_host(oh32.e_entrypoint_rva);
+        entry_rva              = le_to_host(oh32.e_entrypoint_rva);
         p_e_code_rva           = le_to_host(oh32.e_code_rva);
         p_e_data_rva           = le_to_host(oh32.e_data_rva);
-        p_e_image_base         = le_to_host(oh32.e_image_base);
+        p_base_va              = le_to_host(oh32.e_image_base);
         p_e_section_align      = le_to_host(oh32.e_section_align);
         p_e_file_align         = le_to_host(oh32.e_file_align);
         p_e_os_major           = le_to_host(oh32.e_os_major);
@@ -167,9 +179,8 @@
         p_e_heap_commit_size   = le_to_host(oh32.e_heap_commit_size);
         p_e_loader_flags       = le_to_host(oh32.e_loader_flags);
         p_e_num_rvasize_pairs  = le_to_host(oh32.e_num_rvasize_pairs);
-    } else if (0x020b == p_e_opt_magic) {
-        /* We guessed wrong so extend and read the 64-bit header. */
-        p_exec_format->set_word_size(8);
+    } else if (8==p_exec_format->get_word_size()) {
+        /* We guessed wrong. This is a 64-bit header, not 32-bit. */
         PE64OptHeader_disk oh64;
         memset(&oh64, 0, sizeof oh64);
         addr_t need64 = std::min(p_e_nt_hdr_size, (addr_t)(sizeof oh64));
@@ -180,10 +191,10 @@
         p_e_code_size          = le_to_host(oh64.e_code_size);
         p_e_data_size          = le_to_host(oh64.e_data_size);
         p_e_bss_size           = le_to_host(oh64.e_bss_size);
-        p_e_entrypoint_rva     = le_to_host(oh64.e_entrypoint_rva);
+        entry_rva              = le_to_host(oh64.e_entrypoint_rva);
         p_e_code_rva           = le_to_host(oh64.e_code_rva);
-     // p_e_data_rva         = le_to_host(oh.e_data_rva); /* not in PE32+ */
-        p_e_image_base         = le_to_host(oh64.e_image_base);
+     // p_e_data_rva           = le_to_host(oh.e_data_rva);             /* not in PE32+ */
+        p_base_va              = le_to_host(oh64.e_image_base);
         p_e_section_align      = le_to_host(oh64.e_section_align);
         p_e_file_align         = le_to_host(oh64.e_file_align);
         p_e_os_major           = le_to_host(oh64.e_os_major);
@@ -213,15 +224,9 @@
         p_magic.push_back(fh.e_magic[i]);
 
     /* File format */
-    p_exec_format->set_family(FAMILY_PE);
-    p_exec_format->set_purpose( p_e_flags & HF_PROGRAM ? PURPOSE_EXECUTABLE : PURPOSE_LIBRARY );
-    p_exec_format->set_sex( ORDER_LSB );
-    p_exec_format->set_abi( ABI_NT );
-    p_exec_format->set_abi_version(0);
- // p_exec_format.word_size   = ???; /*word size was set above*/
     ROSE_ASSERT(p_e_lmajor <= 0xffff && p_e_lminor <= 0xffff);
-    p_exec_format->set_version( (p_e_lmajor << 16) | p_e_lminor );
-    p_exec_format->set_is_current_version( true ); /*FIXME*/
+    p_exec_format->set_version((p_e_lmajor << 16) | p_e_lminor);
+    p_exec_format->set_is_current_version(true); /*FIXME*/
 
     /* Target architecture */
     switch (p_e_cpu_type) {
@@ -284,22 +289,20 @@
         set_isa(ISA_Mitsubishi_M32R);
         break;
       default:
+        fprintf(stderr, "Warning: SgAsmPEFileHeader::ctor::p_e_cputype = 0x%x (%u)\n", p_e_cpu_type, p_e_cpu_type);
         set_isa(ISA_OTHER);
         break;
     }
 
-    /* Entry point */
-    p_base_va = p_e_image_base;
-    add_entry_rva(p_e_entrypoint_rva);
+    /* Entry point. We will eventually bind the entry point to a particular section (in SgAsmPEFileHeader::parse) so that if
+     * sections are rearranged, extended, etc. the entry point will be updated automatically. */
+    add_entry_rva(entry_rva);
 }
 
 SgAsmPEFileHeader::~SgAsmPEFileHeader() 
 {
- // printf ("In ~SgAsmPEFileHeader() \n");
-
     ROSE_ASSERT(p_rvasize_pairs->get_pairs().empty() == true);
-    
- // Delete the pointers to the IR nodes containing the STL lists
+    // Delete the pointers to the IR nodes containing the STL lists
     delete p_rvasize_pairs;
     p_rvasize_pairs = NULL;
 }
@@ -310,6 +313,8 @@
 {
     for (size_t i=0; i<NELMTS(disk->e_magic); i++)
         disk->e_magic[i] = get_magic()[i];
+
+
     host_to_le(p_e_cpu_type,           &(disk->e_cpu_type));
     host_to_le(p_e_nsections,          &(disk->e_nsections));
     host_to_le(p_e_time,               &(disk->e_time));
@@ -329,10 +334,10 @@
     host_to_le(p_e_code_size,          &(disk->e_code_size));
     host_to_le(p_e_data_size,          &(disk->e_data_size));
     host_to_le(p_e_bss_size,           &(disk->e_bss_size));
-    host_to_le(p_e_entrypoint_rva,     &(disk->e_entrypoint_rva));
+    host_to_le(get_entry_rva(),        &(disk->e_entrypoint_rva));
     host_to_le(p_e_code_rva,           &(disk->e_code_rva));
     host_to_le(p_e_data_rva,           &(disk->e_data_rva));
-    host_to_le(p_e_image_base,         &(disk->e_image_base));
+    host_to_le(get_base_va(),          &(disk->e_image_base));
     host_to_le(p_e_section_align,      &(disk->e_section_align));
     host_to_le(p_e_file_align,         &(disk->e_file_align));
     host_to_le(p_e_os_major,           &(disk->e_os_major));
@@ -365,10 +370,10 @@
     host_to_le(p_e_code_size,          &(disk->e_code_size));
     host_to_le(p_e_data_size,          &(disk->e_data_size));
     host_to_le(p_e_bss_size,           &(disk->e_bss_size));
-    host_to_le(p_e_entrypoint_rva,     &(disk->e_entrypoint_rva));
+    host_to_le(get_entry_rva(),        &(disk->e_entrypoint_rva));
     host_to_le(p_e_code_rva,           &(disk->e_code_rva));
  // host_to_le(p_e_data_rva,           &(disk->e_data_rva)); /* not present in PE32+ */
-    host_to_le(p_e_image_base,         &(disk->e_image_base));
+    host_to_le(get_base_va(),          &(disk->e_image_base));
     host_to_le(p_e_section_align,      &(disk->e_section_align));
     host_to_le(p_e_file_align,         &(disk->e_file_align));
     host_to_le(p_e_os_major,           &(disk->e_os_major));
@@ -402,6 +407,7 @@
     SgAsmPERVASizePair::RVASizePair_disk pairs_disk;
 
     ROSE_ASSERT(p_rvasize_pairs != NULL);
+    ROSE_ASSERT(p_rvasize_pairs->get_pairs().size()==0);
 
     extend_up_to(pairs_size);
     for (size_t i = 0; i < p_e_num_rvasize_pairs; i++, pairs_offset += sizeof pairs_disk) {
@@ -427,21 +433,21 @@
         /* Table names come from PE file specification and are hard coded by RVA/Size pair index */
         const char *tabname = NULL;
         switch (i) {
-          case 0:  tabname = "Export table";                 break;
-          case 1:  tabname = "Import table";                 break;
-          case 2:  tabname = "Resource table";               break;
-          case 3:  tabname = "Exception table";              break;
-          case 4:  tabname = "Certificate table";            break;
-          case 5:  tabname = "Base relocation table";        break;
+          case 0:  tabname = "Export Table";                 break;
+          case 1:  tabname = "Import Table";                 break;
+          case 2:  tabname = "Resource Table";               break;
+          case 3:  tabname = "Exception Table";              break;
+          case 4:  tabname = "Certificate Table";            break;
+          case 5:  tabname = "Base relocation Table";        break;
           case 6:  tabname = "Debug";                        break;
           case 7:  tabname = "Architecture";                 break;
-          case 8:  tabname = "Global ptr";                   break;
-          case 9:  tabname = "TLS table";                    break;
-          case 10: tabname = "Load config table";            break;
-          case 11: tabname = "Bound import";                 break;
-          case 12: tabname = "Import address table";         break;
-          case 13: tabname = "Delay import descriptor";      break;
-          case 14: tabname = "CLR runtime header";           break;
+          case 8:  tabname = "Global Ptr";                   break;
+          case 9:  tabname = "TLS Table";                    break;
+          case 10: tabname = "Load Config Table";            break;
+          case 11: tabname = "Bound Import";                 break;
+          case 12: tabname = "Import Address Table";         break;
+          case 13: tabname = "Delay Import Descriptor";      break;
+          case 14: tabname = "CLR Runtime Header";           break;
           case 15: ROSE_ASSERT(!"reserved; should be zero"); break;
           default: ROSE_ASSERT(!"too many RVA/Size pairs");  break;
         }
@@ -452,78 +458,231 @@
         if (!contained_in) {
             fprintf(stderr, "SgAsmPEFileHeader::create_table_sections(): pair-%zu, rva=0x%08"PRIx64", size=%"PRIu64" bytes \"%s\""
                     ": unable to find a section containing the virtual address (skipping)\n",
-                    i, pair->get_e_rva(), pair->get_e_size(), tabname?tabname:"");
+                    i, pair->get_e_rva().get_rva(), pair->get_e_size(), tabname?tabname:"");
             continue;
         }
-        addr_t file_offset = contained_in->get_rva_offset(pair->get_e_rva());
-        
+        addr_t file_offset = contained_in->get_rva_offset(pair->get_e_rva().get_rva());
 
-        SgAsmGenericSection *tabsec = new SgAsmGenericSection(ef, this, file_offset, pair->get_e_size());
+        /* Create the new section */
+        SgAsmGenericSection *tabsec = NULL;
+        switch (i) {
+          case 0:
+            tabsec = new SgAsmPEExportSection(this, file_offset, pair->get_e_size(), pair->get_e_rva().get_rva());
+            break;
+#if 1 /*not ready for prime-time yet (RPM 2008-10-29)*/
+          case 1:
+            tabsec = new SgAsmPEImportSection(this, file_offset, pair->get_e_size(), pair->get_e_rva().get_rva());
+            break;
+#endif
+          default:
+            tabsec = new SgAsmGenericSection(ef, this, file_offset, pair->get_e_size());
+            break;
+        }
         if (tabname) tabsec->set_name(new SgAsmBasicString(tabname));
         tabsec->set_synthesized(true);
         tabsec->set_purpose(SP_HEADER);
         tabsec->set_file_alignment(get_e_file_align());
         tabsec->set_mapped_alignment(get_e_section_align());
-        tabsec->set_mapped_rva(pair->get_e_rva());
+        tabsec->set_mapped_rva(pair->get_e_rva().get_rva());
         tabsec->set_mapped_size(pair->get_e_size());
         tabsec->set_mapped_rperm(true);
         tabsec->set_mapped_wperm(false);
         tabsec->set_mapped_xperm(false);
         pair->set_section(tabsec);
+        pair->set_e_rva(pair->get_e_rva().set_section(tabsec));
     }
 }
 
+/* Change size of PE header based on word size */
+bool
+SgAsmPEFileHeader::reallocate()
+{
+    bool reallocated = SgAsmGenericHeader::reallocate();
+    
+    addr_t need = sizeof(PEFileHeader_disk);
+    if (4==get_word_size()) {
+        need += sizeof(PE32OptHeader_disk);
+    } else if (8==get_word_size()) {
+        need += sizeof(PE64OptHeader_disk);
+    } else {
+        throw FormatError("unsupported PE word size");
+    }
+    need += p_rvasize_pairs->get_pairs().size() * sizeof(SgAsmPERVASizePair::RVASizePair_disk);
+    
+    if (need<get_size()) {
+        if (is_mapped()) {
+            ROSE_ASSERT(get_mapped_size()==get_size());
+            set_mapped_size(need);
+        }
+        set_size(need);
+        reallocated = true;
+    } else if (need>get_size()) {
+        get_file()->shift_extend(this, 0, need-get_size(), SgAsmGenericFile::ADDRSP_ALL, SgAsmGenericFile::ELASTIC_HOLE);
+        reallocated = true;
+    }
+
+    return reallocated;
+}
+
+/* Override ROSETTA accessors because we don't want users changing these values when traversing the AST */
+void
+SgAsmPEFileHeader::set_e_coff_symtab(addr_t a)
+{
+    ROSE_ASSERT(!get_congealed()); /*must be still parsing*/
+    p_e_coff_symtab = a;
+}
+void
+SgAsmPEFileHeader::set_e_coff_nsyms(unsigned n)
+{
+    ROSE_ASSERT(!get_congealed()); /*must still be parsing*/
+    p_e_coff_nsyms = n;
+}
+void
+SgAsmPEFileHeader::set_e_nsections(unsigned n)
+{
+    ROSE_ASSERT(!get_congealed()); /*must still be parsing*/
+    p_e_nsections = n;
+}
+void
+SgAsmPEFileHeader::set_e_header_size(unsigned n)
+{
+    ROSE_ASSERT(!get_congealed()); /*must still be parsing*/
+    p_e_header_size = n;
+}
+void
+SgAsmPEFileHeader::set_e_num_rvasize_pairs(unsigned n)
+{
+    ROSE_ASSERT(!get_congealed()); /*must still be parsing*/
+    p_e_num_rvasize_pairs = n;
+}
+void
+SgAsmPEFileHeader::set_e_lmajor(unsigned n)
+{
+    ROSE_ASSERT(!get_congealed()); /*must still be parsing*/
+    p_e_lmajor = n;
+}
+void
+SgAsmPEFileHeader::set_e_lminor(unsigned n)
+{
+    ROSE_ASSERT(!get_congealed()); /*must still be parsing*/
+    p_e_lminor = n;
+}
+
 /* Write the PE file header back to disk and all that it references */
 void
 SgAsmPEFileHeader::unparse(FILE *f)
 {
-    ROSE_ASSERT(0==reallocate()); /*should have been called well before any unparsing started*/
+    /* Allow sections to reallocate themselves until things settle. */
+    while (reallocate()) /*void*/;
 
-    /* The fixed length part of the header */
-    PEFileHeader_disk fh;
-    encode(&fh);
+    /* Write unreferenced areas back to the file before anything else. */
+    unparse_holes(f);
+    
+    /* Write the PE section table and, indirectly, the sections themselves. Also, count the number of sections in the table
+     * and update the header's e_nsections member. */
+    if (p_section_table) {
+        ROSE_ASSERT(p_section_table->get_header()==this);
+        p_section_table->unparse(f);
+        SgAsmGenericSectionList *all = get_sections();
+        p_e_nsections = 0;
+        for (size_t i=0; i<all->get_sections().size(); i++) {
+            SgAsmPESection *pesec = dynamic_cast<SgAsmPESection*>(all->get_sections()[i]);
+            if (pesec && pesec->get_st_entry()!=NULL)
+                p_e_nsections++;
+        }
+        addr_t header_size = ALIGN(p_section_table->get_offset() + p_section_table->get_size(),
+                                   p_e_file_align>0 ? p_e_file_align : 1);
+#if 1
+        /* The PE Specification regarding e_header_size (known as "SizeOfHeader" on page 14 of "Microsoft Portable Executable
+         * and Common Object File Format Specification: Revision 8.1 February 15, 2008" is not always followed. We recompute
+         * it here as being the minimum file offset from all the sections defined in the PE Section Table, but not smaller
+         * than the value according to the specification. This alternate value is kept if it's already in the parse tree,
+         * otherwise we use the correct value. (RPM 2008-10-21) */
+        addr_t min_offset;
+        for (size_t i=0, nfound=0; i<all->get_sections().size(); i++) {
+            SgAsmPESection *pesec = dynamic_cast<SgAsmPESection*>(all->get_sections()[i]);
+            if (pesec && pesec->get_st_entry()!=NULL) {
+                if (0==nfound++) {
+                    min_offset = pesec->get_offset();
+                } else {
+                    min_offset = std::min(min_offset, pesec->get_offset());
+                }
+            }
+        }
+        addr_t header_size2 = std::max(header_size, min_offset);
+        if (p_e_header_size==header_size2)
+            header_size = header_size2;
+#endif
+        p_e_header_size = header_size;
+    }
 
-    /* The optional header */
-    PE32OptHeader_disk oh32;
-    PE64OptHeader_disk oh64;
-    void *oh       = NULL;
-    size_t oh_size = 0;
-
-    if (4==get_word_size()) {
-        oh = encode(&oh32);
-        oh_size = sizeof oh32;
-    } else if (8==get_word_size()) {
-        oh = encode(&oh64);
-        oh_size = sizeof oh64;
-    } else {
-        ROSE_ASSERT(!"unsupported word size");
+    /* Write sections that are pointed to by the file header and update data members in the file header */
+    if (p_coff_symtab) {
+        ROSE_ASSERT(p_coff_symtab->get_header()==this);
+        p_coff_symtab->unparse(f);
+        p_e_coff_symtab = p_coff_symtab->get_offset();
+        p_e_coff_nsyms = p_coff_symtab->get_symbols()->get_symbols().size();
     }
     
-    /* Write file and optional header to disk */
-    addr_t spos = write(f, 0, sizeof fh, &fh);
-    spos = write(f, spos, oh_size, oh);
-
-    /* The variable length RVA/size pair table and its sections */
-    for (size_t i = 0; i < p_e_num_rvasize_pairs; i++) {
-        SgAsmPERVASizePair::RVASizePair_disk rvasize_disk;
-        p_rvasize_pairs->get_pairs()[i]->encode(&rvasize_disk);
-        spos = write(f, spos, sizeof rvasize_disk, &rvasize_disk);
+    /* Write the sections from the header RVA/size pair table. */
+    for (size_t i=0; i<p_rvasize_pairs->get_pairs().size(); i++) {
         SgAsmGenericSection *sizepair_section = p_rvasize_pairs->get_pairs()[i]->get_section();
         if (sizepair_section)
             sizepair_section->unparse(f);
     }
 
-    /* The extended DOS header */
-    if (p_dos2_header)
+    /* Write the extended DOS header */
+    if (p_dos2_header) {
+        ROSE_ASSERT(p_dos2_header->get_header()==this);
         p_dos2_header->unparse(f);
+    }
 
-    /* The section table and all the non-synthesized sections */
-    if (p_section_table)
-        p_section_table->unparse(f);
+    /* Update some additional header fields */
+    p_e_num_rvasize_pairs = p_rvasize_pairs->get_pairs().size();
+    p_e_opt_magic = 4==get_word_size() ? 0x010b : 0x020b;
+    p_e_lmajor = (p_exec_format->get_version() >> 16) & 0xffff;
+    p_e_lminor = p_exec_format->get_version() & 0xffff;
 
-    /* Sections that aren't in the section table */
-    if (p_coff_symtab)
-        p_coff_symtab->unparse(f);
+    /* Encode the "NT Optional Header" before the COFF Header since the latter depends on the former. Adjust the COFF Header's
+     * e_nt_hdr_size to accommodate the NT Optional Header in such a way that EXEs from tinype.com don't change (i.e., don't
+     * increase e_nt_hdr_size if the bytes beyond it are zero anyway, and if they aren't then adjust it as little as possible.
+     * The RVA/Size pairs are considered to be part of the NT Optional Header. */
+    size_t oh_size = p_rvasize_pairs->get_pairs().size() * sizeof(SgAsmPERVASizePair::RVASizePair_disk);
+    size_t rvasize_offset; /*offset with respect to "oh" buffer allocated below*/
+    if (4==get_word_size()) {
+        oh_size += sizeof(PE32OptHeader_disk);
+    } else if (8==get_word_size()) {
+        oh_size += sizeof(PE64OptHeader_disk);
+    } else {
+        throw FormatError("unsupported PE word size");
+    }
+    unsigned char *oh = new unsigned char[oh_size];
+    if (4==get_word_size()) {
+        encode((PE32OptHeader_disk*)oh);
+        rvasize_offset = sizeof(PE32OptHeader_disk);
+    } else if (8==get_word_size()) {
+        encode((PE64OptHeader_disk*)oh);
+        rvasize_offset = sizeof(PE64OptHeader_disk);
+    } else {
+        throw FormatError("unsupported PE word size");
+    }
+    for (size_t i=0; i<p_rvasize_pairs->get_pairs().size(); i++, rvasize_offset+=sizeof(SgAsmPERVASizePair::RVASizePair_disk)) {
+        SgAsmPERVASizePair::RVASizePair_disk *rvasize_disk = (SgAsmPERVASizePair::RVASizePair_disk*)(oh+rvasize_offset);
+        p_rvasize_pairs->get_pairs()[i]->encode(rvasize_disk);
+    }
+    while (oh_size>p_e_nt_hdr_size) {
+        if (0!=oh[oh_size-1]) break;
+        --oh_size;
+    }
+    p_e_nt_hdr_size = oh_size;
+
+    /* Write the fixed-length COFF Header */
+    PEFileHeader_disk fh;
+    encode(&fh);
+    addr_t spos = write(f, 0, sizeof fh, &fh);
+
+    /* Write the following "NT Optional Header" */
+    spos = write(f, spos, oh_size, oh);
 }
     
 /* Print some debugging information */
@@ -543,54 +702,51 @@
     strftime(time_str, sizeof time_str, "%c", localtime(&t));
 
     SgAsmGenericHeader::dump(f, p, -1);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_cpu_type",          p_e_cpu_type);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_nsections",         p_e_nsections);
-    fprintf(f, "%s%-*s = %u (%s)\n",       p, w, "e_time",              p_e_time, time_str);
-    fprintf(f, "%s%-*s = %"PRIu64"\n",     p, w, "e_coff_symtab",       p_e_coff_symtab);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_coff_nsyms",        p_e_coff_nsyms);
+    fprintf(f, "%s%-*s = 0x%04x (%u)\n",               p, w, "e_cpu_type",          p_e_cpu_type, p_e_cpu_type);
+    fprintf(f, "%s%-*s = %u\n",                        p, w, "e_nsections",         p_e_nsections);
+    fprintf(f, "%s%-*s = %u (%s)\n",                   p, w, "e_time",              p_e_time, time_str);
+    fprintf(f, "%s%-*s = 0x%08"PRIx64" (%"PRIu64")\n", p, w, "e_coff_symtab",       p_e_coff_symtab, p_e_coff_symtab);
+    fprintf(f, "%s%-*s = %u\n",                        p, w, "e_coff_nsyms",        p_e_coff_nsyms);
     if (p_coff_symtab) {
-        fprintf(f, "%s%-*s = [%d] \"%s\"\n", p, w, "coff_symtab", p_coff_symtab->get_id(), p_coff_symtab->get_name()->c_str());
+        fprintf(f, "%s%-*s = [%d] \"%s\"\n",           p, w, "coff_symtab",
+                p_coff_symtab->get_id(), p_coff_symtab->get_name()->c_str());
     } else {
-        fprintf(f, "%s%-*s = none\n",      p, w, "coff_symtab");
+        fprintf(f, "%s%-*s = none\n",                  p, w, "coff_symtab");
     }
-    fprintf(f, "%s%-*s = %"PRIu64"\n",     p, w, "e_nt_hdr_size",       p_e_nt_hdr_size);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_flags",             p_e_flags);
-    fprintf(f, "%s%-*s = 0x%04x %s\n",     p, w, "e_opt_magic",         p_e_opt_magic,
+    fprintf(f, "%s%-*s = 0x%08"PRIx64" (%"PRIu64")\n", p, w, "e_nt_hdr_size",       p_e_nt_hdr_size, p_e_nt_hdr_size);
+    fprintf(f, "%s%-*s = 0x%04x (%u)\n",               p, w, "e_flags",             p_e_flags, p_e_flags);
+    fprintf(f, "%s%-*s = 0x%04x %s\n",                 p, w, "e_opt_magic",         p_e_opt_magic,
             0x10b == p_e_opt_magic ? "PE32" : (0x20b == p_e_opt_magic ? "PE32+" : "other"));
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_lmajor",            p_e_lmajor);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_lminor",            p_e_lminor);
-    fprintf(f, "%s%-*s = %u bytes\n",      p, w, "e_code_size",         p_e_code_size);
-    fprintf(f, "%s%-*s = %u bytes\n",      p, w, "e_data_size",         p_e_data_size);
-    fprintf(f, "%s%-*s = %u bytes\n",      p, w, "e_bss_size",          p_e_bss_size);
-    fprintf(f, "%s%-*s = 0x%08x\n",        p, w, "e_entrypoint_rva",    p_e_entrypoint_rva);
-    fprintf(f, "%s%-*s = 0x%08x\n",        p, w, "e_code_rva",          p_e_code_rva);
-    fprintf(f, "%s%-*s = 0x%08x\n",        p, w, "e_data_rva",          p_e_data_rva);
-    fprintf(f, "%s%-*s = 0x%08"PRIx64"\n", p, w, "e_image_base",        p_e_image_base);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_section_align",     p_e_section_align);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_file_align",        p_e_file_align);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_os_major",          p_e_os_major);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_os_minor",          p_e_os_minor);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_user_major",        p_e_user_major);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_user_minor",        p_e_user_minor);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_subsys_major",      p_e_subsys_major);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_subsys_minor",      p_e_subsys_minor);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_reserved9",         p_e_reserved9);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_image_size",        p_e_image_size);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_header_size",       p_e_header_size);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_file_checksum",     p_e_file_checksum);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_subsystem",         p_e_subsystem);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_dll_flags",         p_e_dll_flags);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_stack_reserve_size",p_e_stack_reserve_size);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_stack_commit_size", p_e_stack_commit_size);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_heap_reserve_size", p_e_heap_reserve_size);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_heap_commit_size",  p_e_heap_commit_size);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_loader_flags",      p_e_loader_flags);
-    fprintf(f, "%s%-*s = %u\n",            p, w, "e_num_rvasize_pairs", p_e_num_rvasize_pairs);
-    for (unsigned i = 0; i < p_e_num_rvasize_pairs; i++) {
+    fprintf(f, "%s%-*s = %u.%u\n",                     p, w, "linker_vers",         p_e_lmajor, p_e_lminor);
+    fprintf(f, "%s%-*s = 0x%08x (%u) bytes\n",         p, w, "e_code_size",         p_e_code_size, p_e_code_size);
+    fprintf(f, "%s%-*s = 0x%08x (%u) bytes\n",         p, w, "e_data_size",         p_e_data_size, p_e_data_size);
+    fprintf(f, "%s%-*s = 0x%08x (%u) bytes\n",         p, w, "e_bss_size",          p_e_bss_size, p_e_bss_size);
+    fprintf(f, "%s%-*s = %s\n",                        p, w, "e_code_rva",          p_e_code_rva.to_string().c_str());
+    fprintf(f, "%s%-*s = %s\n",                        p, w, "e_data_rva",          p_e_data_rva.to_string().c_str());
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_section_align",     p_e_section_align, p_e_section_align);
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_file_align",        p_e_file_align, p_e_file_align);
+    fprintf(f, "%s%-*s = %u.%u\n",                     p, w, "os_vers",             p_e_os_major, p_e_os_minor);
+    fprintf(f, "%s%-*s = %u.%u\n",                     p, w, "user_vers",           p_e_user_major, p_e_user_minor);
+    fprintf(f, "%s%-*s = %u.%u\n",                     p, w, "subsys_vers",         p_e_subsys_major, p_e_subsys_minor);
+    fprintf(f, "%s%-*s = %u\n",                        p, w, "e_reserved9",         p_e_reserved9);
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_image_size",        p_e_image_size, p_e_image_size);
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_header_size",       p_e_header_size, p_e_header_size);
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_file_checksum",     p_e_file_checksum, p_e_file_checksum);
+    fprintf(f, "%s%-*s = %u\n",                        p, w, "e_subsystem",         p_e_subsystem);
+    fprintf(f, "%s%-*s = 0x%04x (%u)\n",               p, w, "e_dll_flags",         p_e_dll_flags, p_e_dll_flags);
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_stack_reserve_size",
+            p_e_stack_reserve_size, p_e_stack_reserve_size);
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_stack_commit_size", p_e_stack_commit_size, p_e_stack_commit_size);
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_heap_reserve_size", p_e_heap_reserve_size, p_e_heap_reserve_size);
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_heap_commit_size",  p_e_heap_commit_size, p_e_heap_commit_size);
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "e_loader_flags",      p_e_loader_flags, p_e_loader_flags);
+    fprintf(f, "%s%-*s = %u\n",                        p, w, "e_num_rvasize_pairs", p_e_num_rvasize_pairs);
+    for (unsigned i = 0; i < p_rvasize_pairs->get_pairs().size(); i++) {
         sprintf(p, "%sPEFileHeader.pair[%d].", prefix, i);
         w = std::max(1, DUMP_FIELD_WIDTH-(int)strlen(p));
-        fprintf(f, "%s%-*s = 0x%08" PRIx64 "\n",  p, w, "e_rva",  p_rvasize_pairs->get_pairs()[i]->get_e_rva());
-        fprintf(f, "%s%-*s = %" PRIu64 " bytes\n", p, w, "e_size", p_rvasize_pairs->get_pairs()[i]->get_e_size());
+        fprintf(f, "%s%-*s = rva %s,\tsize 0x%08"PRIx64" (%"PRIu64")\n", p, w, "..",
+                p_rvasize_pairs->get_pairs()[i]->get_e_rva().to_string().c_str(),
+                p_rvasize_pairs->get_pairs()[i]->get_e_size(), p_rvasize_pairs->get_pairs()[i]->get_e_size());
     }
     if (p_dos2_header) {
         fprintf(f, "%s%-*s = [%d] \"%s\"\n", p, w, "dos2_header", p_dos2_header->get_id(), p_dos2_header->get_name()->c_str());
@@ -604,7 +760,8 @@
         fprintf(f, "%s%-*s = none\n", p, w, "section_table");
     }
 
-    hexdump(f, 0, std::string(p)+"data at ", p_data);
+    if (variantT() == V_SgAsmPEFileHeader) //unless a base class
+        hexdump(f, 0, std::string(p)+"data at ", p_data);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -690,9 +847,11 @@
     }
 
     SgAsmGenericSection::dump(f, p, -1);
-    p_st_entry->dump(f, p, -1);
+    if (p_st_entry)
+        p_st_entry->dump(f, p, -1);
 
-    hexdump(f, 0, std::string(p)+"data at ", p_data);
+    if (variantT() == V_SgAsmPESection) //unless a base class
+        hexdump(f, 0, std::string(p)+"data at ", p_data);
 }
 
 /* Constructor */
@@ -785,7 +944,8 @@
 
     SgAsmGenericSection::dump(f, p, -1);
 
-    hexdump(f, 0, std::string(p)+"data at ", p_data);
+    if (variantT() == V_SgAsmPESectionTable) //unless a base class
+        hexdump(f, 0, std::string(p)+"data at ", p_data);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -807,11 +967,11 @@
 void *
 SgAsmPEImportDirectory::encode(PEImportDirectory_disk *disk)
 {
-    host_to_le(p_hintnames_rva,   &(disk->hintnames_rva));
-    host_to_le(p_time,            &(disk->time));
-    host_to_le(p_forwarder_chain, &(disk->forwarder_chain));
-    host_to_le(p_dll_name_rva,    &(disk->dll_name_rva));
-    host_to_le(p_bindings_rva,    &(disk->bindings_rva));
+    host_to_le(p_hintnames_rva.get_rva(), &(disk->hintnames_rva));
+    host_to_le(p_time,                    &(disk->time));
+    host_to_le(p_forwarder_chain,         &(disk->forwarder_chain));
+    host_to_le(p_dll_name_rva.get_rva(),  &(disk->dll_name_rva));
+    host_to_le(p_bindings_rva.get_rva(),  &(disk->bindings_rva));
     return disk;
 }
 
@@ -826,12 +986,12 @@
         sprintf(p, "%sPEImportDirectory.", prefix);
     }
     const int w = std::max(1, DUMP_FIELD_WIDTH-(int)strlen(p));
-    
-    fprintf(f, "%s%-*s = 0x%08"PRIx64"\n", p, w, "hintnames_rva",   p_hintnames_rva);
-    fprintf(f, "%s%-*s = %lu %s",          p, w, "time",            (unsigned long)p_time, ctime(&p_time));
-    fprintf(f, "%s%-*s = %u\n",            p, w, "forwarder_chain", p_forwarder_chain);
-    fprintf(f, "%s%-*s = 0x%08"PRIx64"\n", p, w, "dll_name_rva",    p_dll_name_rva);
-    fprintf(f, "%s%-*s = 0x%08"PRIx64"\n", p, w, "bindings_rva",    p_bindings_rva);
+
+    fprintf(f, "%s%-*s = %s\n",          p, w, "hintnames_rva", p_hintnames_rva.to_string().c_str());
+    fprintf(f, "%s%-*s = %lu %s",        p, w, "time", (unsigned long)p_time, ctime(&p_time));
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n", p, w, "forwarder_chain", p_forwarder_chain, p_forwarder_chain);
+    fprintf(f, "%s%-*s = %s\n",          p, w, "dll_name_rva", p_dll_name_rva.to_string().c_str());
+    fprintf(f, "%s%-*s = %s\n",          p, w, "bindings_rva", p_bindings_rva.to_string().c_str());
 }
 
 /* Constructor */
@@ -916,6 +1076,9 @@
 void
 SgAsmPEImportSection::ctor(addr_t offset, addr_t size, addr_t mapped_rva)
 {
+    set_mapped_rva(mapped_rva);
+    set_mapped_size(size);
+
     SgAsmPEFileHeader *fhdr = dynamic_cast<SgAsmPEFileHeader*>(get_header());
     ROSE_ASSERT(fhdr!=NULL);
 
@@ -934,11 +1097,37 @@
         if (!memcmp(&zero, &idir_disk, sizeof zero)) break;
         SgAsmPEImportDirectory *idir = new SgAsmPEImportDirectory(&idir_disk);
 
-        /* The library's name is indicated by RVA. We need a section offset instead. */
-        ROSE_ASSERT(idir->get_dll_name_rva() >= mapped_rva);
-        addr_t dll_name_offset = idir->get_dll_name_rva() - mapped_rva;
-        std::string dll_name = content_str(dll_name_offset);
-
+        /* The library name, indicated by RVA.
+         * 
+         * FIXME (RPM 2008-10-29) We're having problems with this because in some files (e.g., Windows XP
+         * WINDOWS/system32/msacm32.dll) have no ".idata" section defined in the Section Table, but sill have an Import Table
+         * defined in the RVA/Size pairs of the NT Optional Header. This would normally be OK, but it seems that the Import
+         * Table size is too small and doesn't include the strings for the library names; rather, they appear immediately
+         * after the Import Table in part of the file that isn't referenced by any other section and therefore has no RVA
+         * since it's not mapped. */
+        std::string dll_name;
+        rva_t rva = idir->get_dll_name_rva();
+        if (rva.get_rva()<mapped_rva || rva.get_rva()>=mapped_rva+get_size()) {
+            fprintf(stderr, "SgAsmPEImportSection::ctor: warning: in PE Import Directory entry %zu "
+                    "Name RVA (0x%08"PRIx64") is outside of import section (0x%08"PRIx64"-0x%08"PRIx64")\n",
+                    i, rva.get_rva(), mapped_rva, mapped_rva+get_size());
+            rva.set_section(fhdr->get_best_section_by_va(rva.get_rva()+fhdr->get_base_va()));
+            if (!rva.get_section()) {
+                fprintf(stderr, "SgAsmPEImportSection::ctor: error: 0x%08"PRIx64" is not in the mapped address space\n", 
+                        rva.get_rva());
+            } else {
+                fprintf(stderr, "SgAsmPEImportSection::ctor: note: 0x%08"PRIx64" was found at offset 0x%08"PRIx64" (%"PRIu64")"
+                        " in [%d] \"%s\"\n", rva.get_rva(), rva.get_rel(), rva.get_rel(),
+                        rva.get_section()->get_id(), rva.get_section()->get_name()->c_str());
+            }
+        } else {
+            rva.set_section(this);
+        }
+        if (rva.get_section()) {
+            idir->set_dll_name_rva(rva);
+            dll_name = rva.get_section()->content_str(rva.get_rel());
+        }
+        
         /* Create the DLL objects */
         SgAsmPEDLL *dll = new SgAsmPEDLL(new SgAsmBasicString(dll_name));
         dll->set_idir(idir);
@@ -947,74 +1136,107 @@
 
         /* The idir->hintname_rvas is an (optional) RVA for a NULL-terminated array whose members are either:
          *    1. an RVA of a hint/name pair (if the high-order bit of the array member is clear)
-         *    2. an ordinal if the high-order bit is set */
+         *    2. an ordinal if the high-order bit is set
+         * This information suffers from the same problem as dll_name above. */
         if (idir->get_hintnames_rva() != 0) {
-            if (idir->get_hintnames_rva() < mapped_rva)
-                throw FormatError("hint/name RVA is before beginning of \".idata\" object");
-
-         // DQ (8/11/2008): Should this really be a "for loop"; test is "1;"
-            for (addr_t hintname_rvas_offset = idir->get_hintnames_rva() - mapped_rva; /*section offset of RVA/ordinal array */
-                 1; 
-                 hintname_rvas_offset += fhdr->get_word_size()) {
-                addr_t hintname_rva = 0; /*RVA of the hint/name pair*/
-                bool import_by_ordinal=false; /*was high-order bit of array element set?*/
-                if (4==fhdr->get_word_size()) {
-                    uint32_t word;
-                    content(hintname_rvas_offset, sizeof word, &word);
-                    hintname_rva = le_to_host(word);
-                    import_by_ordinal = (hintname_rva & 0x80000000) != 0;
-                } else if (8==fhdr->get_word_size()) {
-                    uint64_t word;
-                    content(hintname_rvas_offset, sizeof word, &word);
-                    hintname_rva = le_to_host(word);
-                    import_by_ordinal = (hintname_rva & 0x8000000000000000ull) != 0;
+            rva_t rva = idir->get_hintnames_rva();
+            if (rva.get_rva()<mapped_rva || rva.get_rva()>=mapped_rva+get_size()) {
+                fprintf(stderr, "SgAsmPEImportSection::ctor: warning: in PE Import Directory entry %zu "
+                        "Import Lookup Table RVA (0x%08"PRIx64") is outside of import section (0x%08"PRIx64"-0x%08"PRIx64")\n",
+                        i, rva.get_rva(), mapped_rva, mapped_rva+get_size());
+                rva.set_section(fhdr->get_best_section_by_va(rva.get_rva()+fhdr->get_base_va()));
+                if (!rva.get_section()) {
+                    fprintf(stderr, "SgAsmPEImportSection::ctor: error: 0x%08"PRIx64" is not in the mapped address space\n", 
+                            rva.get_rva());
                 } else {
-                    ROSE_ASSERT(!"unsupported word size");
+                    fprintf(stderr, "SgAsmPEImportSection::ctor: note: 0x%08"PRIx64" was found at offset 0x%08"PRIx64" (%"PRIu64")"
+                            " in [%d] \"%s\"\n", rva.get_rva(), rva.get_rel(), rva.get_rel(),
+                            rva.get_section()->get_id(), rva.get_section()->get_name()->c_str());
                 }
+            } else {
+                rva.set_section(this);
+            }
+            
+            if (rva.get_section()) {
+                idir->set_hintnames_rva(rva);
+                for (addr_t hintname_rvas_offset = rva.get_rel(); 1; hintname_rvas_offset += fhdr->get_word_size()) {
+                    addr_t hintname_rva = 0; /*RVA of the hint/name pair*/
+                    bool import_by_ordinal=false; /*was high-order bit of array element set?*/
+                    if (4==fhdr->get_word_size()) {
+                        uint32_t word;
+                        content(hintname_rvas_offset, sizeof word, &word);
+                        hintname_rva = le_to_host(word);
+                        import_by_ordinal = (hintname_rva & 0x80000000) != 0;
+                    } else if (8==fhdr->get_word_size()) {
+                        uint64_t word;
+                        content(hintname_rvas_offset, sizeof word, &word);
+                        hintname_rva = le_to_host(word);
+                        import_by_ordinal = (hintname_rva & 0x8000000000000000ull) != 0;
+                    } else {
+                        ROSE_ASSERT(!"unsupported word size");
+                    }
 
-                /* Array is NULL terminated */
-                if (0==hintname_rva)
-                    break;
+                    /* Array is NULL terminated */
+                    if (0==hintname_rva)
+                        break;
 
-                /* Add arrary value and hint/name pair to the DLL object */
-                dll->add_hintname_rva(hintname_rva);
-                if (!import_by_ordinal) {
-                    addr_t hintname_offset = (hintname_rva & 0x7fffffff) - mapped_rva;
-                    SgAsmPEImportHintName *hintname = new SgAsmPEImportHintName(this, hintname_offset);
-                    dll->add_function(hintname->get_name());
-                    dll->add_hintname(hintname);
+                    /* Add arrary value and hint/name pair to the DLL object */
+                    dll->add_hintname_rva(hintname_rva);
+                    if (!import_by_ordinal) {
+                        addr_t hintname_offset = (hintname_rva & 0x7fffffff) - mapped_rva;
+                        SgAsmPEImportHintName *hintname = new SgAsmPEImportHintName(this, hintname_offset);
+                        dll->add_function(hintname->get_name());
+                        dll->add_hintname(hintname);
 
-                 // Make the parent the list IR node
-                    hintname->set_parent(dll->get_hintnames());
+                     // Make the parent the list IR node
+                        hintname->set_parent(dll->get_hintnames());
+                    }
                 }
             }
         }
         
-        /* The idir->bindings_rva is a NULL-terminated array of RVAs */
+        /* The idir->bindings_rva is a NULL-terminated array of RVAs.
+         * This information suffers from the same problem as dll_name above.  */
         if (idir->get_bindings_rva() != 0) {
-            if (idir->get_bindings_rva() < mapped_rva)
-                throw FormatError("bindings RVA is before beginning of \".idata\" object");
-
-            for (addr_t bindings_offset  = idir->get_bindings_rva()  - mapped_rva; /*section offset of RVA array for bindings*/
-                 1; 
-                 bindings_offset += fhdr->get_word_size()) {
-                addr_t binding=0;
-                if (4==fhdr->get_word_size()) {
-                    uint32_t word;
-                    content(bindings_offset, sizeof word, &word);
-                    binding = le_to_host(word);
-                } else if (8==fhdr->get_word_size()) {
-                    uint64_t word;
-                    content(bindings_offset, sizeof word, &word);
-                    binding = le_to_host(word);
+            rva_t rva = idir->get_bindings_rva();
+            if (rva.get_rva()<mapped_rva || rva.get_rva()>=mapped_rva+get_size()) {
+                fprintf(stderr, "SgAsmPEImportSection::ctor: warning: in PE Import Directory entry %zu "
+                        "Import Address Table RVA (0x%08"PRIx64") is outside of import section (0x%08"PRIx64"-0x%08"PRIx64")\n",
+                        i, rva.get_rva(), mapped_rva, mapped_rva+get_size());
+                rva.set_section(fhdr->get_best_section_by_va(rva.get_rva()+fhdr->get_base_va()));
+                if (!rva.get_section()) {
+                    fprintf(stderr, "SgAsmPEImportSection::ctor: error: 0x%08"PRIx64" is not in the mapped address space\n", 
+                            rva.get_rva());
                 } else {
-                    ROSE_ASSERT(!"unsupported word size");
+                    fprintf(stderr, "SgAsmPEImportSection::ctor: note: 0x%08"PRIx64" was found at offset 0x%08"PRIx64" (%"PRIu64")"
+                            " in [%d] \"%s\"\n", rva.get_rva(), rva.get_rel(), rva.get_rel(),
+                            rva.get_section()->get_id(), rva.get_section()->get_name()->c_str());
                 }
+            } else {
+                rva.set_section(this);
+            }
 
-                /* Array is NULL terminated; otherwise add binding to DLL object */
-                if (0==binding)
-                    break;
-                dll->add_binding(binding);
+            if (rva.get_section()) {
+                idir->set_bindings_rva(rva);
+                for (addr_t bindings_offset  = rva.get_rel(); 1; bindings_offset += fhdr->get_word_size()) {
+                    addr_t binding=0;
+                    if (4==fhdr->get_word_size()) {
+                        uint32_t word;
+                        content(bindings_offset, sizeof word, &word);
+                        binding = le_to_host(word);
+                    } else if (8==fhdr->get_word_size()) {
+                        uint64_t word;
+                        content(bindings_offset, sizeof word, &word);
+                        binding = le_to_host(word);
+                    } else {
+                        ROSE_ASSERT(!"unsupported word size");
+                    }
+
+                    /* Array is NULL terminated; otherwise add binding to DLL object */
+                    if (0==binding)
+                        break;
+                    dll->add_binding(binding);
+                }
             }
         }
 
@@ -1024,111 +1246,309 @@
     }
 }
 
-/* Write the import section back to disk */
 void
-SgAsmPEImportSection::unparse(FILE *f)
+SgAsmPEImportSection::add_dll(SgAsmPEDLL *d)
 {
-    ROSE_ASSERT(0==reallocate()); /*should have been called well before any unparsing started*/
-    SgAsmGenericHeader *fhdr = get_header();
+    ROSE_ASSERT(p_dlls != NULL);
+    p_dlls->get_dlls().push_back(d);
+}
 
- // This is the same as accessing p_dlls and used to be redundant with "dlls" before being use with RISE IR nodes.
- // const std::vector<SgAsmPEDLL*> & dlls = get_dlls();
-    const std::vector<SgAsmPEDLL*> & dlls = get_dlls()->get_dlls();
+// /* The following code is commented out pending some redesign work for SgAsmGenericDLL. The plan is to not use SgAsmGenericDLL
+//  * for the time being, which will make SgAsmPEImportSection look a lot more like SgAsmPEExportSection in terms of the IR nodes
+//  * that are created.  Part of what makes this necessary is that PE shared libraries have very messed up Import Tables -- the
+//  * Import Directory points off into completely unrelated parts of the file. Commenting out the unparser causes us to use the
+//  * implementation from the super class, which just writes the original data back to disk. (RPM 2008-10-29). */
+// 
+// /* Write the import section back to disk */
+// void
+// SgAsmPEImportSection::unparse(FILE *f)
+// {
+//     ROSE_ASSERT(0==reallocate()); /*should have been called well before any unparsing started*/
+//     SgAsmGenericHeader *fhdr = get_header();
+// 
+//     const std::vector<SgAsmPEDLL*> & dlls = get_dlls()->get_dlls();
+// 
+//     for (size_t dllno = 0; dllno < dlls.size(); dllno++) {
+//         SgAsmPEDLL *dll = dlls[dllno];
+//         SgAsmPEImportDirectory *idir = dll->get_idir();
+//         
+//         /* Directory entry */
+//         SgAsmPEImportDirectory::PEImportDirectory_disk idir_disk;
+//         idir->encode(&idir_disk);
+//         write(f, dllno*sizeof(idir_disk), sizeof idir_disk, &idir_disk);
+// 
+//         /* Library name. Write it even if it's not in this section! (RPM 2008-10-29) */
+//         rva_t rva = idir->get_dll_name_rva();
+//         ROSE_ASSERT(rva >= p_mapped_rva);
+//         ROSE_ASSERT(rva.get_section()); /*should have been bound in constructor*/
+//         addr_t spos = rva.get_section()->write(f, rva.get_rel(), dll->get_name()->get_string());
+//         rva.get_section()->write(f, spos, '\0');
+// 
+//         /* Write the hint/name pairs and the array entries that point to them. They might not even be in this section! See
+//          * ctor */   
+//         rva = idir->get_hintnames_rva();
+//         if (rva != 0) {
+//             ROSE_ASSERT(rva.get_section());
+//             const std::vector<addr_t> & hintname_rvas = dll->get_hintname_rvas();
+//             const std::vector<SgAsmPEImportHintName*> & hintnames = dll->get_hintnames()->get_hintnames();
+//             for (size_t i = 0; i <= hintname_rvas.size(); i++) {
+//                 /* Hint/name RVA */
+//                 addr_t hintname_rva = i < hintname_rvas.size() ? hintname_rvas[i] : 0; /*zero terminated*/
+//                 bool import_by_ordinal = false;
+//                 if (4 == fhdr->get_word_size()) {
+//                     uint32_t rva_le;
+//                     host_to_le(hintname_rva, &rva_le);
+//                     rva.get_section()->write(f, rva.get_rel() + i*fhdr->get_word_size(), sizeof rva_le, &rva_le);
+//                     import_by_ordinal = (hintname_rva & 0x80000000) != 0;
+//                 } else if (8==fhdr->get_word_size()) {
+//                     uint64_t rva_le;
+//                     host_to_le(hintname_rva, &rva_le);
+//                     rva.get_section()->write(f, rva.get_rel() + i*fhdr->get_word_size(), sizeof rva_le, &rva_le);
+//                     import_by_ordinal = (hintname_rva & 0x8000000000000000ull) != 0;
+//                 } else {
+//                     ROSE_ASSERT(!"unsupported word size");
+//                 }
+//             
+//                 /* Hint/name pair */
+//                 if (i<hintname_rvas.size() && !import_by_ordinal) {
+//                     addr_t hintname_spos = (hintname_rvas[i] & 0x7fffffff) - p_mapped_rva; /*section offset*/
+//                     hintnames[i]->unparse(f, this, hintname_spos);
+//                 }
+//             }
+//         }
+//         
+//         /* Write the bindings array. These could be in some other section (see constructor)! */
+//         rva = idir->get_bindings_rva();
+//         if (rva != 0) {
+//             ROSE_ASSERT(rva.get_section());
+//             const std::vector<addr_t> & bindings = dll->get_bindings();
+//             for (size_t i=0; i<=bindings.size(); i++) {
+//                 addr_t binding = i<bindings.size() ? bindings[i] : 0; /*zero terminated*/
+//                 if (4==fhdr->get_word_size()) {
+//                     uint32_t binding_le;
+//                     host_to_le(binding, &binding_le);
+//                     rva.get_section()->write(f, rva.get_rel() + i*fhdr->get_word_size(), sizeof binding_le, &binding_le);
+//                 } else if (8==fhdr->get_word_size()) {
+//                     uint64_t binding_le;
+//                     host_to_le(binding, &binding_le);
+//                     rva.get_section()->write(f, rva.get_rel() + i*fhdr->get_word_size(), sizeof binding_le, &binding_le);
+//                 } else {
+//                     ROSE_ASSERT(!"unsupported word size");
+//                 }
+//             }
+//         }
+//     }
+// 
+//     /* DLL list is zero terminated */
+//     {
+//         SgAsmPEImportDirectory::PEImportDirectory_disk zero;
+//         memset(&zero, 0, sizeof zero);
+//         write(f, dlls.size()*sizeof zero, sizeof zero, &zero);
+//     }
+// 
+//     unparse_holes(f);
+// }
 
-    for (size_t dllno = 0; dllno < dlls.size(); dllno++) {
-        SgAsmPEDLL *dll = dlls[dllno];
-        SgAsmPEImportDirectory *idir = dll->get_idir();
-        
-        /* Directory entry */
-        SgAsmPEImportDirectory::PEImportDirectory_disk idir_disk;
-        idir->encode(&idir_disk);
-        write(f, dllno*sizeof(idir_disk), sizeof idir_disk, &idir_disk);
+/* Print debugging info */
+void
+SgAsmPEImportSection::dump(FILE *f, const char *prefix, ssize_t idx)
+{
+    char p[4096];
+    if (idx>=0) {
+        sprintf(p, "%sPEImportSection[%zd].", prefix, idx);
+    } else {
+        sprintf(p, "%sPEImportSection.", prefix);
+    }
+    
+    SgAsmPESection::dump(f, p, -1);
 
-        /* Library name */
-        ROSE_ASSERT(idir->get_dll_name_rva() >= p_mapped_rva);
-        addr_t dll_name_offset = idir->get_dll_name_rva() - p_mapped_rva;
-        ROSE_ASSERT(dll_name_offset + dll->get_name()->get_string().size() + 1 < get_size());
-        addr_t spos = write(f, dll_name_offset, dll->get_name()->get_string());
-        write(f, spos, '\0');
+    if (variantT() == V_SgAsmPEImportSection) //unless a base class
+        hexdump(f, 0, std::string(p)+"data at ", p_data);
+}
 
-        /* Write the hint/name pairs and the array entries that point to them. */
-        if (idir->get_hintnames_rva() != 0) {
-            ROSE_ASSERT(idir->get_hintnames_rva() >= p_mapped_rva);
-            addr_t hintname_rvas_spos = idir->get_hintnames_rva() - p_mapped_rva; /*section offset*/
-            const std::vector<addr_t> & hintname_rvas = dll->get_hintname_rvas();
-            const std::vector<SgAsmPEImportHintName*> & hintnames = dll->get_hintnames()->get_hintnames();
-            for (size_t i = 0; i <= hintname_rvas.size(); i++) {
-                /* Hint/name RVA */
-                addr_t hintname_rva = i < hintname_rvas.size() ? hintname_rvas[i] : 0; /*zero terminated*/
-                bool import_by_ordinal = false;
-                if (4 == fhdr->get_word_size()) {
-                    uint32_t rva_le;
-                    host_to_le(hintname_rva, &rva_le);
-                    write(f, hintname_rvas_spos + i*fhdr->get_word_size(), sizeof rva_le, &rva_le);
-                    import_by_ordinal = (hintname_rva & 0x80000000) != 0;
-                } else if (8==fhdr->get_word_size()) {
-                    uint64_t rva_le;
-                    host_to_le(hintname_rva, &rva_le);
-                    write(f, hintname_rvas_spos + i*fhdr->get_word_size(), sizeof rva_le, &rva_le);
-                    import_by_ordinal = (hintname_rva & 0x8000000000000000ull) != 0;
-                } else {
-                    ROSE_ASSERT(!"unsupported word size");
-                }
-            
-                /* Hint/name pair */
-                if (i<hintname_rvas.size() && !import_by_ordinal) {
-                    addr_t hintname_spos = (hintname_rvas[i] & 0x7fffffff) - p_mapped_rva; /*section offset*/
-                    hintnames[i]->unparse(f, this, hintname_spos);
-                }
-            }
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// PE Export Section.
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/* Constructor */
+void
+SgAsmPEExportDirectory::ctor(SgAsmPEExportSection *section)
+{
+    set_parent(section);
+
+    size_t entry_size = sizeof(PEExportDirectory_disk);
+    const PEExportDirectory_disk *disk = (const PEExportDirectory_disk*)section->content(0, entry_size);
+    
+    p_res1         = le_to_host(disk->res1);
+    p_timestamp    = le_to_host(disk->timestamp);
+    p_vmajor       = le_to_host(disk->vmajor);
+    p_vminor       = le_to_host(disk->vminor);
+    p_name_rva     = le_to_host(disk->name_rva);       p_name_rva.set_section(section);
+    p_ord_base     = le_to_host(disk->ord_base);
+    p_expaddr_n    = le_to_host(disk->expaddr_n);
+    p_nameptr_n    = le_to_host(disk->nameptr_n);
+    p_expaddr_rva  = le_to_host(disk->expaddr_rva);    p_expaddr_rva.set_section(section);
+    p_nameptr_rva  = le_to_host(disk->nameptr_rva);    p_nameptr_rva.set_section(section);
+    p_ordinals_rva = le_to_host(disk->ordinals_rva);   p_ordinals_rva.set_section(section);
+
+    const char *name = p_name_rva.get_section()->content_str(p_name_rva.get_rel());
+    p_name = new SgAsmBasicString(name);
+}
+
+/* Print debugging info */
+void
+SgAsmPEExportDirectory::dump(FILE *f, const char *prefix, ssize_t idx)
+{
+    char p[4096];
+    if (idx>=0) {
+        sprintf(p, "%sPEExportDirectory[%zd].", prefix, idx);
+    } else {
+        sprintf(p, "%sPEExportDirectory.", prefix);
+    }
+    const int w = std::max(1, DUMP_FIELD_WIDTH-(int)strlen(p));
+    
+    fprintf(f, "%s%-*s = \"%s\"\n",                    p, w, "name", p_name->c_str());
+    fprintf(f, "%s%-*s = 0x%08x (%u)\n",               p, w, "res1", p_res1, p_res1);
+    fprintf(f, "%s%-*s = %lu %s",                      p, w, "timestamp", (unsigned long)p_timestamp, ctime(&p_timestamp));
+    fprintf(f, "%s%-*s = %u\n",                        p, w, "vmajor", p_vmajor);
+    fprintf(f, "%s%-*s = %u\n",                        p, w, "vminor", p_vminor);
+    fprintf(f, "%s%-*s = %s\n",                        p, w, "name_rva", p_name_rva.to_string().c_str());
+    fprintf(f, "%s%-*s = %u\n",                        p, w, "ord_base", p_ord_base);
+    fprintf(f, "%s%-*s = %zu\n",                       p, w, "expaddr_n", p_expaddr_n);
+    fprintf(f, "%s%-*s = %zu\n",                       p, w, "nameptr_n", p_nameptr_n);
+    fprintf(f, "%s%-*s = %s\n",                        p, w, "expaddr_rva", p_expaddr_rva.to_string().c_str());
+    fprintf(f, "%s%-*s = %s\n",                        p, w, "nameptr_rva", p_nameptr_rva.to_string().c_str());
+    fprintf(f, "%s%-*s = %s\n",                        p, w, "ordinals_rva", p_ordinals_rva.to_string().c_str());
+}
+
+/* Constructor */
+void
+SgAsmPEExportEntry::ctor(SgAsmGenericString *fname, unsigned ordinal, rva_t expaddr, SgAsmGenericString *forwarder)
+{
+    set_name(fname);
+    set_ordinal(ordinal);
+    set_export_rva(expaddr);
+    set_forwarder(forwarder);
+}
+
+/* Print debugging info */
+void
+SgAsmPEExportEntry::dump(FILE *f, const char *prefix, ssize_t idx)
+{
+    char p[4096];
+    if (idx>=0) {
+        sprintf(p, "%sPEExportEntry[%zd].", prefix, idx);
+    } else {
+        sprintf(p, "%sPEExportEntry.", prefix);
+    }
+    const int w = std::max(1, DUMP_FIELD_WIDTH-(int)strlen(p));
+
+    fprintf(f, "%s%-*s = [ord %u] rva=%s \"%s\"", p, w, "info", p_ordinal, p_export_rva.to_string().c_str(), p_name->c_str());
+    if (p_forwarder)
+        fprintf(f, " -> \"%s\"", p_forwarder->c_str());
+    fputc('\n', f);
+}
+
+/* Override ROSETTA to set parent */
+void
+SgAsmPEExportEntry::set_name(SgAsmGenericString *fname)
+{
+    p_name = fname;
+    if (p_name) p_name->set_parent(this);
+}
+void
+SgAsmPEExportEntry::set_forwarder(SgAsmGenericString *forwarder)
+{
+    p_forwarder = forwarder;
+    if (p_forwarder) p_forwarder->set_parent(this);
+}
+    
+/* Constructor */
+void
+SgAsmPEExportSection::ctor(addr_t offset, addr_t size, addr_t mapped_rva)
+{
+    ROSE_ASSERT(p_exports  == NULL);
+    p_exports = new SgAsmPEExportEntryList();
+    p_exports->set_parent(this);
+
+    set_mapped_rva(mapped_rva);
+    set_mapped_size(size);
+
+    SgAsmPEFileHeader *fhdr = dynamic_cast<SgAsmPEFileHeader*>(get_header());
+    ROSE_ASSERT(fhdr!=NULL);
+
+    p_export_dir = new SgAsmPEExportDirectory(this);
+
+
+    for (size_t i=0; i<p_export_dir->get_nameptr_n(); i++) {
+        /* Function name */
+        const ExportNamePtr_disk *nameptr_disk;
+        addr_t nameptr_offset = p_export_dir->get_nameptr_rva().get_rel(this) + i*sizeof(*nameptr_disk);
+        nameptr_disk = (const ExportNamePtr_disk*)content(nameptr_offset, sizeof(*nameptr_disk));
+        rva_t nameptr = le_to_host(*nameptr_disk);
+        SgAsmGenericString *fname = new SgAsmBasicString(content_str(nameptr.get_rel(this)));
+
+        /* Ordinal (sort of an index into the Export Address Table contained in this same section) */
+        const ExportOrdinal_disk *ordinal_disk;
+        addr_t ordinal_offset = p_export_dir->get_ordinals_rva().get_rel(this) + i*sizeof(*ordinal_disk);
+        ordinal_disk = (const ExportOrdinal_disk*)content(ordinal_offset, sizeof(*ordinal_disk));
+        unsigned ordinal = le_to_host(*ordinal_disk);
+
+        /* Export address. Convert the symbol's Ordinal into an index into the Export Address Table. The spec says to subtract
+         * the ord_base from the Ordinal to get the index, but testing has shown this to be off by one (e.g., Windows-XP file
+         * /WINDOWS/system32/msacm32.dll's Export Table's first symbol has the name "XRegThunkEntry" with an Ordinal of zero
+         * and the ord_base is one. The index according to spec would be -1 rather than the correct value of zero.) */
+        rva_t expaddr;
+        if (ordinal >= (p_export_dir->get_ord_base()-1)) {
+            unsigned expaddr_idx = ordinal - (p_export_dir->get_ord_base()-1);
+            ROSE_ASSERT(expaddr_idx < p_export_dir->get_expaddr_n());
+            const ExportAddress_disk *expaddr_disk;
+            addr_t expaddr_offset = p_export_dir->get_expaddr_rva().get_rel(this) + expaddr_idx*sizeof(*expaddr_disk);
+            expaddr_disk = (const ExportAddress_disk*)content(expaddr_offset, sizeof(*expaddr_disk));
+            expaddr = le_to_host(*expaddr_disk);
+            expaddr.set_section(fhdr->get_best_section_by_va(expaddr.get_rva()+fhdr->get_base_va()));
+        } else {
+            expaddr = 0xffffffff; /*Ordinal out of range!*/
         }
-        
-        /* Write the bindings array */
-        if (idir->get_bindings_rva() != 0) {
-            ROSE_ASSERT(idir->get_bindings_rva() >= p_mapped_rva);
-            const addr_t bindings_spos = idir->get_bindings_rva() - p_mapped_rva; /*section offset*/
-            const std::vector<addr_t> & bindings = dll->get_bindings();
-            for (size_t i=0; i<=bindings.size(); i++) {
-                addr_t binding = i<bindings.size() ? bindings[i] : 0; /*zero terminated*/
-                if (4==fhdr->get_word_size()) {
-                    uint32_t binding_le;
-                    host_to_le(binding, &binding_le);
-                    write(f, bindings_spos + i*fhdr->get_word_size(), sizeof binding_le, &binding_le);
-                } else if (8==fhdr->get_word_size()) {
-                    uint64_t binding_le;
-                    host_to_le(binding, &binding_le);
-                    write(f, bindings_spos + i*fhdr->get_word_size(), sizeof binding_le, &binding_le);
-                } else {
-                    ROSE_ASSERT(!"unsupported word size");
-                }
-            }
+
+        /* If export address is within this section then it points to a NUL-terminated forwarder name. */
+        SgAsmGenericString *forwarder = NULL;
+        if (expaddr.get_rva()>=get_mapped_rva() && expaddr.get_rva()<get_mapped_rva()+get_mapped_size()) {
+            forwarder = new SgAsmBasicString(content_str(expaddr.get_rel(this)));
         }
-    }
 
-    /* DLL list is zero terminated */
-    {
-        SgAsmPEImportDirectory::PEImportDirectory_disk zero;
-        memset(&zero, 0, sizeof zero);
-        write(f, dlls.size()*sizeof zero, sizeof zero, &zero);
+        SgAsmPEExportEntry *entry = new SgAsmPEExportEntry(fname, ordinal, expaddr, forwarder);
+        add_entry(entry);
     }
+}
 
-    unparse_holes(f);
+void
+SgAsmPEExportSection::add_entry(SgAsmPEExportEntry *entry)
+{
+    ROSE_ASSERT(p_exports!=NULL);
+    p_exports->get_exports().push_back(entry);
 }
 
 /* Print debugging info */
 void
-SgAsmPEImportSection::dump(FILE *f, const char *prefix, ssize_t idx)
+SgAsmPEExportSection::dump(FILE *f, const char *prefix, ssize_t idx)
 {
     char p[4096];
     if (idx>=0) {
-        sprintf(p, "%sPEImportSection[%zd].", prefix, idx);
+        sprintf(p, "%sPEExportSection[%zd].", prefix, idx);
     } else {
-        sprintf(p, "%sPEImportSection.", prefix);
+        sprintf(p, "%sPEExportSection.", prefix);
     }
     
     SgAsmPESection::dump(f, p, -1);
 
-    hexdump(f, 0, std::string(p)+"data at ", p_data);
+    if (p_export_dir)
+        p_export_dir->dump(f, p, -1);
+    for (size_t i=0; i<p_exports->get_exports().size(); i++)
+        p_exports->get_exports()[i]->dump(f, p, i);
+
+    if (variantT() == V_SgAsmPEExportSection) //unless a base class
+        hexdump(f, 0, std::string(p)+"data at ", p_data);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1198,6 +1618,9 @@
 
     ROSE_ASSERT(get_strtab()!=NULL);
     get_strtab()->dump(f, p, -1);
+
+    if (variantT() == V_SgAsmPEStringSection) //unless a base class
+        hexdump(f, 0, std::string(p)+"data at ", p_data);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1676,7 +2099,8 @@
         p_symbols->get_symbols()[i]->dump(f, p, i);
     }
 
-    hexdump(f, 0, std::string(p)+"data at ", p_data);
+    if (variantT() == V_SgAsmCoffSymbolTable) //unless a base class
+        hexdump(f, 0, std::string(p)+"data at ", p_data);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1720,38 +2144,44 @@
     SgAsmPEExtendedDOSHeader *dos2_header = new SgAsmPEExtendedDOSHeader(ef, dos_header->get_size());
     
     /* The PE header has a fixed-size component followed by some number of RVA/Size pairs */
-    SgAsmPEFileHeader *pe_header = new SgAsmPEFileHeader(ef, dos2_header->get_e_lfanew());
-    ROSE_ASSERT(pe_header->get_e_num_rvasize_pairs() < 1000); /* just a sanity check before we allocate memory */
-    pe_header->add_rvasize_pairs();
+    SgAsmPEFileHeader *fhdr = new SgAsmPEFileHeader(ef, dos2_header->get_e_lfanew());
+    ROSE_ASSERT(fhdr->get_e_num_rvasize_pairs() < 1000); /* just a sanity check before we allocate memory */
+    fhdr->add_rvasize_pairs();
 
     /* The extended part of the DOS header is owned by the PE header */
-    dos2_header->set_header(pe_header);
-    pe_header->add_section(dos2_header);
-    pe_header->set_dos2_header(dos2_header);
+    dos2_header->set_header(fhdr);
+    fhdr->add_section(dos2_header);
+    fhdr->set_dos2_header(dos2_header);
 
     /* Now go back and add the DOS Real-Mode section but rather than using the size specified in the DOS header, constrain it
      * to not extend beyond the beginning of the PE file header. This makes detecting holes in the PE format much easier. */
-    dos_header->add_rm_section(pe_header->get_offset());
+    dos_header->add_rm_section(fhdr->get_offset());
 
     /* Construct the section table and its sections (non-synthesized sections). The specification says that the section table
      * comes after the optional (NT) header, which in turn comes after the fixed part of the PE header. The size of the
      * optional header is indicated in the fixed header. */
-    addr_t secttab_offset = pe_header->get_offset() + sizeof(PEFileHeader_disk) + pe_header->get_e_nt_hdr_size();
-    addr_t secttab_size = pe_header->get_e_nsections() * sizeof(SgAsmPESectionTableEntry::PESectionTableEntry_disk);
-    SgAsmPESectionTable *secttab = new SgAsmPESectionTable(pe_header, secttab_offset, secttab_size);
-    pe_header->set_section_table(secttab);
+    addr_t secttab_offset = fhdr->get_offset() + sizeof(PEFileHeader_disk) + fhdr->get_e_nt_hdr_size();
+    addr_t secttab_size = fhdr->get_e_nsections() * sizeof(SgAsmPESectionTableEntry::PESectionTableEntry_disk);
+    SgAsmPESectionTable *secttab = new SgAsmPESectionTable(fhdr, secttab_offset, secttab_size);
+    fhdr->set_section_table(secttab);
 
     /* Parse the COFF symbol table and add symbols to the PE header */
-    if (pe_header->get_e_coff_symtab() && pe_header->get_e_coff_nsyms()) {
-        SgAsmCoffSymbolTable *symtab = new SgAsmCoffSymbolTable(pe_header);
+    if (fhdr->get_e_coff_symtab() && fhdr->get_e_coff_nsyms()) {
+        SgAsmCoffSymbolTable *symtab = new SgAsmCoffSymbolTable(fhdr);
         std::vector<SgAsmCoffSymbol*> & symbols = symtab->get_symbols()->get_symbols();
         for (size_t i = 0; i < symbols.size(); i++)
-            pe_header->add_symbol(symbols[i]);
-        pe_header->set_coff_symtab(symtab);
+            fhdr->add_symbol(symbols[i]);
+        fhdr->set_coff_symtab(symtab);
     }
 
+    /* Associate RVAs with particular sections. */
+    ROSE_ASSERT(fhdr->get_entry_rvas().size()==1);
+    fhdr->get_entry_rvas()[0].set_section(fhdr);
+    fhdr->set_e_code_rva(fhdr->get_e_code_rva().set_section(fhdr));
+    fhdr->set_e_data_rva(fhdr->get_e_data_rva().set_section(fhdr));
+
     /* Turn header-specified tables (RVA/Size pairs) into generic sections */
-    pe_header->create_table_sections();
+    fhdr->create_table_sections();
     
-    return pe_header;
+    return fhdr;
 }

Modified: branches/rice/src/frontend/OpenFortranParser_SAGE_Connection/FortranModuleInfo.C
===================================================================
--- branches/rice/src/frontend/OpenFortranParser_SAGE_Connection/FortranModuleInfo.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/OpenFortranParser_SAGE_Connection/FortranModuleInfo.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -70,7 +70,8 @@
      nestedSgFile++;
      SgProject*  project = getCurrentProject();
 
-     SgSourceFile* newFile = new SgSourceFile (argv, errorCode, 0, project);
+     SgSourceFile* newFile = isSgSourceFile(determineFileType(argv,errorCode,project));
+       // SgSourceFile* newFile =  new SgSourceFile (argv, errorCode, 0, project);
 
      ROSE_ASSERT (newFile != NULL);
      ROSE_ASSERT (newFile->get_startOfConstruct() != NULL);

Modified: branches/rice/src/frontend/SageIII/Makefile.am
===================================================================
--- branches/rice/src/frontend/SageIII/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -51,7 +51,7 @@
 	StorageClasses.h \
 	StorageClasses.C \
 	Cxx_GrammarReturnDataMemberPointers.C \
-	Cxx_GrammarReturnDataMemberReferenceToPointers.C \
+	Cxx_GrammarProcessDataMemberReferenceToPointers.C \
 	Cxx_GrammarNewConstructors.C \
 	Cxx_GrammarGetChildIndex.C
 
@@ -76,7 +76,8 @@
    fixupCopy_symbols.C \
    fixupCopy_references.C \
    rtiHelpers.C \
-   virtualCfgMemberFunctions.C
+   virtualCfgMemberFunctions.C \
+   OmpAttribute.C
 # $(GENERATED_SOURCE) is handled separately
 
 # DQ (5/27/2007): Files moved or removed
@@ -128,7 +129,8 @@
    attachPreprocessingInfo.h \
    attach_all_info.h manglingSupport.h C++_include_files.h \
    fixupCopy.h \
-   general_token_defs.h rose_paths.h rtiHelpers.h
+   general_token_defs.h rose_paths.h rtiHelpers.h \
+   OmpAttribute.h omp.h
 
 nodist_include_HEADERS = \
    Cxx_Grammar.h \

Copied: branches/rice/src/frontend/SageIII/OmpAttribute.C (from rev 117, trunk/src/frontend/SageIII/OmpAttribute.C)
===================================================================
--- branches/rice/src/frontend/SageIII/OmpAttribute.C	                        (rev 0)
+++ branches/rice/src/frontend/SageIII/OmpAttribute.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,541 @@
+// Refined OmpAttribute connected to a parser using Bison
+//Liao, 9/18/2008
+//
+#include "OmpAttribute.h"
+#include <algorithm>
+using namespace std;
+using namespace SageInterface;
+using namespace SageBuilder;
+
+namespace OmpSupport{
+  //! A builder for OmpAttribute
+  OmpAttribute* buildOmpAttribute(omp_construct_enum directive_type, SgNode* node)
+  {
+    OmpAttribute* result = new OmpAttribute(directive_type,node);
+    ROSE_ASSERT(result);
+    return result;
+  }
+
+    //! Add OmpAttribute to a SgNode
+  void addOmpAttribute(OmpAttribute* ompattribute, SgNode* node)
+  {
+    ROSE_ASSERT(node);
+    ROSE_ASSERT(ompattribute);
+    node->addNewAttribute("OmpAttribute",ompattribute);
+  }
+
+  //! Get OmpAttribute from a SgNode
+  OmpAttribute* getOmpAttribute(SgNode* node)
+  {
+     OmpAttribute* result = NULL;
+     AstAttribute* astattribute=node->getAttribute("OmpAttribute");
+     if (astattribute)
+       result = dynamic_cast<OmpAttribute* > (astattribute);
+     return result;  
+  }
+
+   //!Add a clause into an OpenMP directive, the content of the clause is set by other interface, such as addVariable(), addExpression() , setReductionOperator() etc.
+   void OmpAttribute::addClause(omp_construct_enum clause_type)
+   {
+     if (isClause(clause_type))
+     {
+       //We only store a clause type once
+       //Logically, the content will be merged into the first occurence.
+       if (!hasClause(clause_type))
+       { 
+        clause_map[clause_type]=true;
+	clauses.push_back(clause_type);
+       }
+     }
+     else
+     {
+       cerr<<"OmpAttribute::addClause(): Unrecognized clause type:"<<clause_type<<endl;
+       ROSE_ASSERT(false);
+     }
+   }
+
+//! Get a vector of clauses existing in the directive
+// We only maintain a map internally, so generated the vector on the fly   
+// This implementation detail is hidden from users, can be changed any time   
+std::vector<omp_construct_enum> OmpAttribute::getClauses()
+{
+/*
+  if (hasClause(e_default))     result.push_back(e_default);
+  if (hasClause(e_shared))    result.push_back(e_shared);
+  if (hasClause(e_private))    result.push_back(e_private);
+  if (hasClause(e_firstprivate))    result.push_back(e_firstprivate);
+  if (hasClause(e_lastprivate))    result.push_back(e_lastprivate);
+  if (hasClause(e_copyin))    result.push_back(e_copyin);
+  if (hasClause(e_copyprivate))    result.push_back(e_copyprivate);
+
+  if (hasClause(e_if)) result.push_back(e_if);
+  if (hasClause(e_num_threads)) result.push_back(e_num_threads);
+  if (hasClause(e_nowait)) result.push_back(e_nowait);
+  if (hasClause(e_ordered_clause)) result.push_back(e_ordered_clause);
+  if (hasClause(e_reduction)) result.push_back(e_reduction);
+  if (hasClause(e_schedule)) result.push_back(e_schedule);
+  if (hasClause(e_collapse)) result.push_back(e_collapse);
+  if (hasClause(e_untied))  result.push_back(e_untied);
+  */
+  return clauses;
+}
+
+//! Get the associated SgPragmaDeclaration
+SgPragmaDeclaration* OmpAttribute::getPragmaDeclaration()
+{
+  SgPragmaDeclaration* result = NULL;
+  if (mNode)
+     result = isSgPragmaDeclaration(mNode);
+  return result;
+}
+
+
+//! Insert a variable into a variable list for clause "targetConstruct", maintain the reversed variable-clause mapping also.
+void OmpAttribute::addVariable(omp_construct_enum targetConstruct, const std::string& varString)
+ {
+   SgInitializedName* sgvar = NULL; 
+   if (mNode)
+   {
+     SgScopeStatement* scope = SageInterface::getScope(mNode);
+     ROSE_ASSERT(scope!=NULL);
+     //resolve the variable here
+     SgVariableSymbol* symbol = lookupVariableSymbolInParentScopes 
+               (varString, scope);
+     ROSE_ASSERT(symbol!= NULL);
+     sgvar = symbol->get_declaration();
+   }  
+   //debug clause var_list
+  // if (targetConstruct== e_copyin) cout<<"debug: adding variable to copyin()"<<endl;
+   variable_lists[targetConstruct].push_back(make_pair(varString, sgvar));
+   // maintain the var-clause map also
+   var_clauses[varString].push_back(targetConstruct);
+ }
+
+//! Set name for named critical section
+ void OmpAttribute::setCriticalName(const std::string & varname)
+ {
+   hasName = true;
+   name = varname;
+ }
+
+//! Expression 
+void OmpAttribute::addExpression(omp_construct_enum targetConstruct, const std::string& expString, SgExpression* sgexp/* =NULL */)
+{
+  expressions[targetConstruct]=make_pair(expString,sgexp);
+  if (sgexp!=NULL)
+    sgexp->set_parent(mNode); // a little hack here, we not yet extend the SgPragmaDeclaration to have expression children.
+}
+
+std::pair<std::string, SgExpression*>
+OmpAttribute::getExpression(omp_construct_enum targetConstruct)
+{
+  return expressions[targetConstruct];
+}
+
+// default () value
+void OmpAttribute::setDefaultValue(omp_construct_enum valuex)
+{
+  switch (valuex)
+  {
+    case  e_default_none:
+    case  e_default_shared:
+    case  e_default_private:
+    case  e_default_firstprivate:
+       default_scope = valuex;
+       break;
+    default:
+      cerr<<"OmpAttribute::setDefaultValue() Illegal default scoping value:"<<valuex<<endl;
+      ROSE_ASSERT(false);
+  }
+}
+
+enum omp_construct_enum OmpAttribute::getDefaultValue()
+{
+  return default_scope;
+}
+
+// Reduction clause's operator
+void OmpAttribute::setReductionOperator(omp_construct_enum operatorx)
+ {
+   reduction_operator = operatorx;
+ }
+omp_construct_enum OmpAttribute::getReductionOperator()
+{
+  return reduction_operator;
+}
+
+//! Find the relevant clauses for a variable 
+std::vector<enum omp_construct_enum> 
+OmpAttribute::get_clauses(const std::string& variable)
+{
+ return var_clauses[variable];
+}
+
+// Schedule kind
+void OmpAttribute::setScheduleKind(omp_construct_enum kindx)
+{
+  //validating the parameter here
+ switch (kindx)
+ {
+   case  e_schedule_none:
+   case  e_schedule_static:
+   case  e_schedule_dynamic:
+   case  e_schedule_guided:
+   case  e_schedule_auto:
+   case  e_schedule_runtime:
+     schedule_kind = kindx;
+     break;
+   default:
+     cerr<<"OmpAttribute::setScheduleKind() Illegal schedule kind:"<<kindx<<endl;
+     ROSE_ASSERT(false);
+     break;
+ }
+}
+
+omp_construct_enum OmpAttribute::getScheduleKind()
+{
+  ROSE_ASSERT(hasClause(e_schedule)==true);
+  return schedule_kind;
+}
+
+string toString(omp_construct_enum omp_type)
+{
+  string result;
+  switch (omp_type)
+  {
+  /*
+    case e_: result = ""; break;
+    */
+    //directives
+    case e_unknown: result ="unknown" ; break;
+    case e_parallel: result = "parallel" ; break;
+    case e_for: result = "for"; break;
+    case e_sections: result = "sections"; break;
+    case e_section: result = "section"; break;
+    case e_single: result = "single"; break;
+
+    case e_master: result = "master"; break;
+    case e_critical: result = "critical"; break;
+    case e_barrier: result = "barrier"; break;
+    case e_atomic: result = "atomic"; break;
+    case e_flush: result = "flush"; break;
+
+
+    case e_threadprivate: result = "threadprivate"; break;
+    case e_parallel_for: result = "parallel for"; break;
+    case e_parallel_sections: result = "parallel sections"; break;
+    case e_task: result = "task"; break;
+    case e_taskwait: result = "taskwait"; break;
+    case e_ordered_directive: result = "ordered"; break;
+
+   // clauses
+    case e_default: result = "default"; break;
+    case e_shared: result = "shared"; break;
+    case e_private: result = "private"; break;
+    case e_firstprivate: result = "firstprivate"; break;
+    case e_lastprivate: result = "lastprivate"; break;
+    case e_copyin: result = "copyin"; break;
+    case e_copyprivate: result = "copyprivate"; break;
+
+
+    case e_if: result = "if"; break;
+    case e_num_threads: result = "num_threads"; break;
+    case e_nowait: result = "nowait"; break;
+    case e_ordered_clause: result = "ordered"; break;
+    case e_reduction: result = "reduction"; break;
+    case e_schedule: result = "schedule"; break;
+    case e_collapse: result = "collapse"; break;
+    case e_untied: result = "untied"; break;
+
+  // values
+    case e_default_none: result = "none"; break;
+    case e_default_shared: result = "shared"; break;
+    case e_default_private: result = "private"; break;
+    case e_default_firstprivate: result = "firstprivate"; break;
+
+    case e_reduction_plus: result = "+"; break;
+    case e_reduction_minus: result = "-"; break;
+    case e_reduction_mul: result = "*"; break;
+    case e_reduction_bitand: result = "&"; break;
+    case e_reduction_bitor: result = "|"; break;
+
+    case e_reduction_bitxor: result = "^"; break;
+    case e_reduction_logand: result = "&&"; break;
+    case e_reduction_logor: result = "||"; break;
+
+    case e_reduction_min: result = "min"; break;
+    case e_reduction_max: result = "max"; break;
+
+    case e_schedule_none: result = "not-specified"; break;
+    case e_schedule_static: result = "static"; break;
+    case e_schedule_dynamic: result = "dynamic"; break;
+    case e_schedule_guided: result = "guided"; break;
+    case e_schedule_auto: result = "auto"; break;
+    case e_schedule_runtime: result = "runtime"; break;
+
+    case e_not_omp: result = "not_omp"; break;
+  }
+
+  if (isDirective(omp_type))
+    result= "omp " + result;
+  return result;
+}
+bool isDirective(omp_construct_enum omp_type)
+{
+  bool result = false;
+  switch (omp_type)
+  { // 16 directives as OpenMP 3.0
+    case e_parallel:
+    case e_for:
+    case e_sections:
+    case e_section:
+    case e_single:
+
+    case e_master: 
+    case e_critical:
+    case e_barrier:
+    case e_atomic:
+    case e_flush:
+
+    case e_threadprivate:
+    case e_parallel_for:
+    case e_parallel_sections:
+    case e_task:
+    case e_taskwait:
+
+    case e_ordered_directive:
+      result = true;
+      break;
+    default:
+     result = false;
+     break;
+  }
+ return result;
+}
+
+bool isClause(omp_construct_enum clause_type)
+{
+  bool result = false;
+
+   switch (clause_type)
+   { //total 15 possible clauses as OpenMP 3.0
+     case e_default:
+     case e_shared:
+     case e_private:
+     case e_firstprivate:
+     case e_lastprivate:
+
+     case e_copyin:
+     case e_copyprivate:
+     case e_if:
+     case e_num_threads:
+     case e_nowait:
+
+     case e_ordered_clause:
+     case e_reduction:
+     case e_schedule:
+     case e_collapse:
+     case e_untied:
+       result = true; 
+       break;
+     default:
+       result = false;
+       break;
+   }
+  return result; 
+}
+
+
+bool OmpAttribute::hasClause(omp_construct_enum omp_type)
+{
+  bool result = false;
+  if (isClause(omp_type))
+     result =clause_map[omp_type];
+  else
+  {        
+    cerr<<"OmpAttribute::hasClause(): Unrecognized clause type as a parameter:"<<omp_type<<endl;
+    ROSE_ASSERT(false);
+  }
+  return result;
+}
+
+//--------------------------
+//Judge if a name is in a clause's variable list: like private(x,y,z), copyin(), etc.
+bool OmpAttribute::isInConstruct(const string & varName, enum omp_construct_enum omptype)
+{
+  bool result =false;
+  ROSE_ASSERT(varName.size()!= 0);
+  vector <omp_construct_enum> construct_vec = get_clauses(varName);
+  vector <omp_construct_enum>::iterator iter;
+  iter = find (construct_vec.begin(), construct_vec.end(),omptype);
+  if (iter != construct_vec.end())
+    result = true;
+  return result;
+}
+
+//! Convert directives and clauses to string 
+// Top down recursive conversion: directive ,directive-optional stuff, 
+ // then clauses one by one, plus clause-optional stuff
+std::string OmpAttribute::toOpenMPString(omp_construct_enum omp_type)
+{
+  string result;
+  //Directives ------------------
+  if (isDirective(omp_type))
+  { //common string for all directives
+    // atomic, barrier, master, section, ordered, taskwait
+   result += OmpSupport::toString(omp_type);
+   // optional: critical's name
+   if (omp_type == e_critical)
+   {
+     if (isNamedCritical())
+       result+=" ("+ getCriticalName()+")";
+   } 
+   // optional: variable lists for flush () and threadprivate()
+   else if ((omp_type == e_flush)||(omp_type == e_threadprivate))
+   {
+     if(hasVariableList(omp_type))
+     {
+       string varListString = toOpenMPString(getVariableList(omp_type));
+       result+=" (" + varListString + ")"; 
+     }
+   }// end of flush(), threadprivate()
+  } // end if directives
+  //Clauses ------------------
+  else if (isClause(omp_type))
+  {
+    // Common string for all clauses
+    result += OmpSupport::toString(omp_type);
+    // optional expressions
+    if((omp_type == e_if)||
+       (omp_type ==e_num_threads)||
+       (omp_type == e_collapse)
+      )
+    {
+       string expString;
+      // We store real SgExpression* in .second now, 
+      // No need to save the original string format in .first 
+       if (getExpression(omp_type).first.size()>0) 
+         expString   = getExpression(omp_type).first;
+       else if (getExpression(omp_type).second!=NULL)
+         expString = getExpression(omp_type).second->unparseToString();
+       result+=" (" + expString+ ")"; 
+    } 
+    // optional variable lists
+    else if ((omp_type == e_copyprivate)||
+           (omp_type ==e_private)||
+	   (omp_type == e_firstprivate)||
+	   (omp_type == e_shared)||
+	   (omp_type == e_copyin)||
+	   (omp_type == e_lastprivate)
+	   )
+    {
+       string varListString = toOpenMPString(getVariableList(omp_type));
+       result+=" (" + varListString + ")"; 
+    }
+    // default scoping values
+    else if (omp_type == e_default)
+    {
+       result+=" ("+ OmpSupport::toString(getDefaultValue())+")";
+    } // reduction (op:var-list)
+    else if (omp_type == e_reduction)
+    {
+      result +=" ("+ OmpSupport::toString(getReductionOperator())+":";
+      string varListString = toOpenMPString(getVariableList(omp_type));
+      result += varListString + ")";
+    } // schedule(kind, exp)
+    else if (omp_type == e_schedule)
+    {
+      result +=" ("+ OmpSupport::toString(getScheduleKind());
+      string expString;
+      // We store real SgExpression* in .second now, 
+      // No need to save the original string format in .first
+      if (getExpression(omp_type).first.size()>0)
+        expString = getExpression(omp_type).first;
+      else  if (getExpression(omp_type).second !=  NULL)
+        expString =  getExpression(omp_type).second->unparseToString();
+
+      if (expString.size()>0)
+        result += "," + expString;
+      result += ")";
+    }
+  }// end clauses
+  return result; 
+}
+
+//! Convert a variable list to x,y,z ,without parenthesis.
+std::string OmpAttribute::toOpenMPString(std::vector<std::pair<std::string,SgNode* > >var_list)
+{
+  string result;
+  std::vector<std::pair<std::string,SgNode* > >::iterator iter;
+  for (iter=var_list.begin();iter!=var_list.end();iter++)
+  {
+    if (iter != var_list.begin())
+      result +=",";
+    result+=(*iter).first;
+  }
+  return result;
+}
+
+
+//! Get the variable list associated with a construct
+std::vector<std::pair<std::string,SgNode* > >
+        OmpAttribute::getVariableList(omp_construct_enum targetConstruct)
+{
+  return variable_lists[targetConstruct];
+}
+//! Check if a variable list is associated with a construct
+bool OmpAttribute::hasVariableList(omp_construct_enum omp_type)
+{
+  vector<std::pair<std::string,SgNode* > > var_list = variable_lists[omp_type];
+  return (var_list.size()!=0);
+}
+
+std::string OmpAttribute::toOpenMPString()
+{
+  string result; // Should not add "#pragma ", which is automatically generated by SgPragmaDeclaration
+  // Convert directive first
+  result += toOpenMPString(omp_type);
+
+  // Convert clauses then
+  vector<omp_construct_enum> clause_vector = getClauses();
+  vector<omp_construct_enum>::iterator iter;
+  for (iter=clause_vector.begin();iter!=clause_vector.end();iter++)
+  {  
+    if (iter==clause_vector.begin())
+     result+= " "; // space between directive and first clause
+    else
+      result+= ",";
+    result+= toOpenMPString(*iter);
+  }
+  return result;
+}
+
+//! pretty print of OmpAttribute, ideally should reproduce a legal OpenMP pragma
+void OmpAttribute::print()
+{ 
+  std::cout<<"----------------------"<<std::endl;
+  SgPragmaDeclaration* pragma = getPragmaDeclaration();
+  if (pragma)
+   std::cout<<"Original OpenMP pragma is:\n\t\t#pragma "<<pragma->get_pragma()->get_pragma()<<std::endl;
+  std::cout<<"Reproduced OpenMP pragma is:\n";
+  // Generate OpenMP pragma from OmpAttribute
+  cout<<"\t\t#pragma "<<toOpenMPString();
+  cout<<std::endl;
+
+}//end print
+
+//! It does not set omp_type and pragma, leaving constructors to do it
+void OmpAttribute::init()
+    {   
+      //TODO, complete this!
+        parent = NULL;
+
+	isOrphaned = false;
+        hasName = false;
+
+        schedule_kind = e_schedule_none;
+        wrapperCount=0;
+    }
+
+
+} //end namespace OmpSupport

Copied: branches/rice/src/frontend/SageIII/OmpAttribute.h (from rev 117, trunk/src/frontend/SageIII/OmpAttribute.h)
===================================================================
--- branches/rice/src/frontend/SageIII/OmpAttribute.h	                        (rev 0)
+++ branches/rice/src/frontend/SageIII/OmpAttribute.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,295 @@
+/*!
+ * ROSE persistent attribute to represent OpenMP 3.0 C/C++ directives
+ * All things go to the OmpSupport namespace to avoid conflicts 
+ */
+// Goal: share it by both OpenMP translation and automatic OpenMP insertion
+//
+// Liao 9/17, 2008
+
+#include <rose.h>
+#include <iostream>
+#include <string>
+#include <map>
+
+namespace OmpSupport{
+
+ // OpenMP construct name list
+ // We put all directive and clause types into one enumerate type
+ // since some internal data structure(map) have to access 
+ // both directives and clauses uniformly
+  enum	omp_construct_enum {
+     e_unknown = 0, 
+
+  // 16 directives as OpenMP 3.0
+     e_parallel,
+     e_for,
+     e_sections,
+     e_section,
+     e_single,
+
+     e_master, 
+     e_critical,
+     e_barrier,
+     e_atomic,
+     e_flush,
+
+     e_threadprivate,
+     e_parallel_for,
+     e_parallel_sections,
+     e_task,
+     e_taskwait, 
+     // we have both ordered directive and ordered clause, 
+    //so make the name explicit
+     e_ordered_directive,
+
+  // 15 clauses for OpenMP 3.0
+    // 7 data-sharing attributes clauses
+     e_default, // the clause
+     e_shared,
+     e_private,
+     e_firstprivate,
+     e_lastprivate,
+     e_copyin,
+     e_copyprivate,
+
+     //8 misc clauses
+     e_if, // used with omp parallel or omp task
+     e_num_threads, // for omp parallel only
+     e_nowait,
+     e_ordered_clause,
+     e_reduction,
+     e_schedule,
+     e_collapse,
+     e_untied, 
+
+ // Simple values for some clauses
+   
+     //4 values for default clause 
+     //C/C++ default values
+     e_default_none,
+     e_default_shared,
+     //Fortran default values
+     e_default_private,
+     e_default_firstprivate,
+
+
+     // reduction operations
+     //8 operand for C/C++
+     e_reduction_plus,
+     e_reduction_minus,
+     e_reduction_mul,
+     e_reduction_bitand,
+     e_reduction_bitor,
+
+     e_reduction_bitxor,
+     e_reduction_logand,
+     e_reduction_logor, 
+
+     // TODO more reduction intrinsic procedure name for Fortran  
+     e_reduction_min, //?
+     e_reduction_max,
+
+     //5 schedule policies
+     e_schedule_none,
+     e_schedule_static,
+     e_schedule_dynamic,
+     e_schedule_guided,
+     e_schedule_auto,
+     e_schedule_runtime,
+
+  // not an OpenMP construct
+     e_not_omp
+  }; //end omp_construct_enum
+
+  //! Output omp_construct_enum to a string: 
+  // Better using OmpSupport::toString() to avoid ambiguous 
+  std::string toString(omp_construct_enum omp_type);
+
+  //! Check if an OpenMP construct is a directive
+  bool isDirective(omp_construct_enum omp_type);
+
+  //! Check if an OpenMP construct is a clause
+  bool isClause(omp_construct_enum omp_type);
+
+  class OmpAttribute;
+  //! Some utility functions to manipulate OmpAttribute
+  //
+  //! A builder for OmpAttribute
+  OmpAttribute* buildOmpAttribute(enum omp_construct_enum directive_type, SgNode* context_node);
+
+  //! Add OmpAttribute to a SgNode
+  void addOmpAttribute(OmpAttribute* ompattribute, SgNode* node);
+
+  //! Get OmpAttribute from a SgNode, return NULL if not found
+  OmpAttribute* getOmpAttribute(SgNode* node);
+
+//------------------------------------------------------------------
+//------------------------------------------------------------------
+// By default, the persistent attribute attached to an OpenMP pragma node in SAGE III AST
+// Attaching to pragma is easier since a few directives have no obvious 
+// associated code blocks, like threadprivate.
+//
+// The attribute can also be attached by a scope affected by OpenMP. This is used during
+// automatic parallelization when the corresponding pragma is not yet generated.
+//
+// A cure-all approach is used to simplify the handling. 
+// OmpAttribute is implemented using a 'flat' data structure encompass all 
+// possible directives, clauses
+// and their various contents, if any.
+//
+// different types of pragmas need different information in some cases
+// e.g.
+//    'omp for' needs scheduling type 
+//------------------------------------------------------------------
+//------------------------------------------------------------------
+class OmpAttribute : public AstAttribute 
+{
+ public:
+   //It is recommended to use OmpSupport::buildOmpAttribute() instead of 
+   //using the constructors here
+  //!Default constructors
+   OmpAttribute()
+    {
+      mNode = NULL;
+      omp_type = e_unknown;
+      init();
+    }
+   //! Constructor for known directive type and originating pragma/scope node
+   OmpAttribute(omp_construct_enum omptye, SgNode* mynode):
+   mNode(mynode),omp_type(omptye){ 
+     /*The initialization order has to match the declaration order, 
+      * otherwise get a compilation warning*/
+        init();
+   }
+
+  //! Get the associated SgPragmaDeclaration if any
+  SgPragmaDeclaration* getPragmaDeclaration();
+
+  //! Get the associated SgNode, can be SgPragmaDeclaration or others( during parallelization)
+  SgNode* getNode();
+
+   //!-----------clauses----------------
+   //!Add a clause into an OpenMP directive, the content of the clause is set by other interface, such as addVariable(), addExpression() , setReductionOperator() etc.
+   void addClause(omp_construct_enum clause_type);
+   //! Check if a directive has a clause of the specified type 
+   bool hasClause(omp_construct_enum clause_type);
+
+   //! Get all existing clauses
+   std::vector<omp_construct_enum> getClauses();
+
+   //!--------var list --------------
+   //! Add a variable into a variable list of a construct
+   void addVariable(omp_construct_enum targetConstruct, const std::string& varString);
+   //! Check if a variable list is associated with a construct
+   bool hasVariableList(omp_construct_enum);
+   //! Get the variable list associated with a construct
+   std::vector<std::pair<std::string,SgNode* > >
+     getVariableList(omp_construct_enum);
+
+   //! Find the relevant clauses for a variable 
+   std::vector<enum omp_construct_enum> get_clauses(const std::string& variable);
+
+   //!--------Expressions -----------------------------
+   //! Add an expression to a clause
+   void addExpression(omp_construct_enum targetConstruct, const std::string& expString, SgExpression*    sgexp=NULL); 
+
+   //! Get expression of a clause
+   std::pair<std::string, SgExpression*>  
+   getExpression(omp_construct_enum targetConstruct);
+
+   //!--------values for some clauses ----------
+   //! Get reduction operator from reduction(op:kind)
+   void setReductionOperator(omp_construct_enum operatorx);
+   omp_construct_enum getReductionOperator();
+   
+   // default () value
+   void setDefaultValue(omp_construct_enum valuex);
+   omp_construct_enum getDefaultValue();
+
+   // Schedule kind
+   omp_construct_enum getScheduleKind(); 
+   void setScheduleKind(omp_construct_enum kindx);
+
+   //! Check if a variable is inside a variable list of a clause/directive.
+   bool isInConstruct(const std::string & variable, enum omp_construct_enum);
+
+   //! Set name for named critical section
+   void setCriticalName(const std::string & name);
+   std::string  getCriticalName() {return name;};
+   bool isNamedCritical(){return hasName;};
+
+   //!Pretty print the OmpAttribute
+   void print(); 
+   //! Convert OmpAttribute to a legal OpenMP pragma string, 
+   //not named toString() to void ambiguous with OmpAttribute::toString()
+   std::string toOpenMPString();
+//------------------hide the implementation details, could be changed anytime!!
+private:  
+   //! The associated SgNode for this attribute, could be SgPragmaDeclaration or other nodes
+   SgNode*  mNode; 
+
+   //!Directive information: type of OpenMP directive
+   enum omp_construct_enum  omp_type; 
+
+   //! Clause information 
+   // vector is used to preserve the order of clauses in the directive
+   // map is used to fast query if a clause exists or not
+   // Some clauses are allowed to appear more than once, merge the content into the first occurrence in our implementation.
+   std::vector<omp_construct_enum> clauses;
+   std::map<omp_construct_enum,bool> clause_map;
+
+   //variable lists------------------- 
+   //appeared within some directives and clauses
+   //The clauses/directive are: flush, threadprivate, private, firstprivate, 
+   //  shared, copyin, reduction, lastprivate, copyprivate
+   // We use a pair of (name, SgNode) for each variable 
+   // It is highly possible that a variable having more than one OpenMP properties.
+   // For example, a variable can be both firstprivate and lastprivate.
+   std::map<omp_construct_enum, std::vector<std::pair<std::string,SgNode* > > > variable_lists; 
+   // A reverse map from a variable to the clauses the variable appears
+   std::map<std::string, std::vector<omp_construct_enum> > var_clauses;
+
+   // expressions ----------------------
+   // e.g.: if (exp), num_threads(exp), schedule(,exp), collapse(exp)
+   std::map<omp_construct_enum, std::pair<std::string, SgExpression*> > expressions;
+
+   // values for some clauses -------------------------
+  // values for default() clause: data scoping information
+   // choices are: none,shared, private, firstprivate
+   omp_construct_enum default_scope; 
+   
+   //value for reduction operation: + -, * & | etc
+   omp_construct_enum reduction_operator;
+
+   // value for omp for's schedule policies
+   omp_construct_enum schedule_kind;
+
+   // Only used for omp critical to indicate if it is named or not
+   // name for the directive, only used for omp critical
+   bool hasName; 
+   std::string name; 
+ 
+   // Misc fields  --------------------------------
+   // help translation and analysis   
+   bool isOrphaned; //true if parent omp parallel is not in the static lexical scope
+
+  // Additional information to help translation
+   int wrapperCount; // the shared variables from the same scope which needs wrapper
+
+   //optional information
+   OmpAttribute * parent; //upper-level OMP pragma's attribute
+
+   //!Member functions --------------------------------- 
+    //! Initialize internal data
+    void init() ;
+
+   //! Convert entire directives and clauses to string ,
+    // invoke OmpSupport::toString() to stringify the enumerate type internally
+   std::string toOpenMPString(omp_construct_enum omp_type);
+
+   //! Convert a variable list to x,y,z ,without parenthesis.
+   std::string toOpenMPString(std::vector<std::pair<std::string,SgNode* > >);
+  }; // end class OmpAttribute
+
+
+} //end namespace OmpSupport

Modified: branches/rice/src/frontend/SageIII/astMerge/fixupTraversal.C
===================================================================
--- branches/rice/src/frontend/SageIII/astMerge/fixupTraversal.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/astMerge/fixupTraversal.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -59,14 +59,6 @@
   // Keep a count of the number of IR nodes tested (whose data members are evaluated)
      numberOfNodesTested++;
 
-  // Only traverse list of IR node pointers on each IR node.
-     typedef vector<pair<SgNode**,string> > DataMemberVectorType;
-
-  // We require the reference version of this function because we want to update the (referenced) pointer values.
-  // Question: Can this be a const ref for the dataMemberMap?  This would avoid copying of STL maps.
-  // DataMemberMapType dataMemberMap = node->returnDataMemberPointers();
-     const DataMemberVectorType & dataMemberVector = node->returnDataMemberReferenceToPointers();
-
   // printf ("dataMemberVector.size() = %ld \n",dataMemberVector.size());
      bool traceReplacement = false;
 #if 0
@@ -79,162 +71,146 @@
 #endif
      if (traceReplacement == true)
         {
-          printf ("FixupTraversal::visit: node = %p = %s dataMemberVector.size() = %zu \n",node,node->class_name().c_str(),dataMemberVector.size());
+          printf ("FixupTraversal::visit: node = %p = %s \n",node,node->class_name().c_str());
         }
 
-     DataMemberVectorType::const_iterator i = dataMemberVector.begin();
-     while (i != dataMemberVector.end())
-        {
-       // Ignore the parent pointer since it will be reset differently if required
-          SgNode** pointerToKey = i->first;
+     struct Replacer: public ReferenceToPointerHandler {
+       FixupTraversal& ft;
+       bool traceReplacement;
+       SgNode* node;
+       Replacer(FixupTraversal& ft, bool traceReplacement, SgNode* node): ft(ft), traceReplacement(traceReplacement), node(node) {}
+       virtual void operator()(SgNode*& key, const SgName& debugStringName) {
+         // Keep a count of the number of IR nodes evaluated.
+            ft.numberOfDataMemberPointersEvaluated++;
+         // Keep a count of the number of IR data members that are non-null
+            ft.numberOfValidDataMemberPointersEvaluated++;
 
-       // Keep a count of the number of IR nodes evaluated.
-          numberOfDataMemberPointersEvaluated++;
+            const string& debugString = debugStringName.getString();
 
-       // DQ (5/20/2006): Data members that are NULL will have been put into the dataMemberVector as NULL pointers so we have to skip over them.
-          if (pointerToKey != NULL)
-             {
-            // For node, this is the reference to the field containing a pointer 
-            // to another IR node (this will be a key into the replacementMap).
-               SgNode* key           = *(i->first);
-            // printf ("key  = %p = %p = %s \n",key,dynamic_cast<SgNode*>(key),key != NULL ? key->class_name().c_str() : "NULL");
-            // printf ("pointerToKey != NULL: key  = %p \n",key);
+         // DQ (2/8/2007): Only handle non-NULL valued pointers (only valid pointers to IR nodes that need be reset).
+         // However, since we have few NULL pointers in the AST by design this is not a significant optimization.
+            if (key != NULL)
+               {
+              // Keep a count of the number of IR data members that are non-null (where the key is also non-null)
+                 ft.numberOfValidDataMemberPointersWithValidKeyEvaluated++;
 
-            // Keep a count of the number of IR data members that are non-null
-               numberOfValidDataMemberPointersEvaluated++;
-
-            // DQ (2/8/2007): Only handle non-NULL valued pointers (only valid pointers to IR nodes that need be reset).
-            // However, since we have few NULL pointers in the AST by design this is not a significant optimization.
-               if (key != NULL)
-                  {
-                 // Keep a count of the number of IR data members that are non-null (where the key is also non-null)
-                    numberOfValidDataMemberPointersWithValidKeyEvaluated++;
-
-                 // printf ("key  = %p = %p = %s \n",key,dynamic_cast<SgNode*>(key),key->class_name().c_str());
-                 // printf ("key  = %p = %s \n",key,key->class_name().c_str());
-                 // printf ("key  = %p \n",key);
+              // printf ("key  = %p = %p = %s \n",key,dynamic_cast<SgNode*>(key),key->class_name().c_str());
+              // printf ("key  = %p = %s \n",key,key->class_name().c_str());
+              // printf ("key  = %p \n",key);
 #if 0
-                 // This is the field name of the data member (helps with debugging to know what it is)
-                    const string & debugString  = i->second;
+              // This is the field name of the data member (helps with debugging to know what it is)
+                 const string & debugString  = i->second;
 
-                 // Lookup the key in the replacementMap.  If present then the replacement map stores the 
-                 // values required to reset the pointer FROM the unshared IR node and TO the shared IR node.
-                    ReplacementMapTraversal::ReplacementMapType::const_iterator lowerBound = replacementMap.lower_bound(key);
-                    ReplacementMapTraversal::ReplacementMapType::const_iterator upperBound = replacementMap.upper_bound(key);
+              // Lookup the key in the replacementMap.  If present then the replacement map stores the 
+              // values required to reset the pointer FROM the unshared IR node and TO the shared IR node.
+                 ReplacementMapTraversal::ReplacementMapType::const_iterator lowerBound = replacementMap.lower_bound(key);
+                 ReplacementMapTraversal::ReplacementMapType::const_iterator upperBound = replacementMap.upper_bound(key);
 
-                    if (lowerBound == upperBound)
-                       {
-                      // Keep a count of the number of case where the replacement list was empty.
-                         numberOfValidDataMemberPointersWithValidKeyButNotInReplacementMap++;
+                 if (lowerBound == upperBound)
+                    {
+                   // Keep a count of the number of case where the replacement list was empty.
+                      numberOfValidDataMemberPointersWithValidKeyButNotInReplacementMap++;
 #if 0
-                         if (traceReplacement == true)
-                            {
-                              ROSE_ASSERT(key != NULL);
-                              ROSE_ASSERT(node != NULL);
-                              printf ("debugString = %s \n",debugString.c_str());
-                           // printf ("node = %p \n",node);
-                              printf ("node = %p = %s \n",node,node->class_name().c_str());
-                              printf ("key  = %p \n",key);
-                           // printf ("dynamic_cast<SgNode*>(key) = %p \n",dynamic_cast<SgNode*>(key));
-                           // printf ("key  = %p = %s \n",key,dynamic_cast<SgNode*>(key)->class_name().c_str());
-                           // printf ("FixupTraversal::visit(): Key not present in replacementMap, node = %p = %s: key = %p = %s at data member %s is not in the replacementMap to be updated to a shared IR node \n",
-                           //      node,node->class_name().c_str(),key,key->class_name().c_str(),debugString.c_str());
-                            }
+                      if (traceReplacement == true)
+                         {
+                           ROSE_ASSERT(key != NULL);
+                           ROSE_ASSERT(node != NULL);
+                           printf ("debugString = %s \n",debugString.c_str());
+                        // printf ("node = %p \n",node);
+                           printf ("node = %p = %s \n",node,node->class_name().c_str());
+                           printf ("key  = %p \n",key);
+                        // printf ("dynamic_cast<SgNode*>(key) = %p \n",dynamic_cast<SgNode*>(key));
+                        // printf ("key  = %p = %s \n",key,dynamic_cast<SgNode*>(key)->class_name().c_str());
+                        // printf ("FixupTraversal::visit(): Key not present in replacementMap, node = %p = %s: key = %p = %s at data member %s is not in the replacementMap to be updated to a shared IR node \n",
+                        //      node,node->class_name().c_str(),key,key->class_name().c_str(),debugString.c_str());
+                         }
 #endif
-                       }
-                      else
-                       {
-                      // Keep a count of the number of case where the replacement list was valid.
-                         numberOfValidDataMemberPointersWithValidKeyAndInReplacementMap++;
-                       }
-                    
-                 // Loop over all those in the replacement map that need to have child pointers to be updated
-                    int loopCounter = 0;
-                    while (lowerBound != upperBound)
-                       {
-                         SgNode* originalNode = (replacementMap.lower_bound(key))->second;
+                    }
+                   else
+                    {
+                   // Keep a count of the number of case where the replacement list was valid.
+                      numberOfValidDataMemberPointersWithValidKeyAndInReplacementMap++;
+                    }
+                 
+              // Loop over all those in the replacement map that need to have child pointers to be updated
+                 int loopCounter = 0;
+                 while (lowerBound != upperBound)
+                    {
+                      SgNode* originalNode = (replacementMap.lower_bound(key))->second;
 
-                      // Keep a count of the number of case where the replacement list was valid.
-                         numberOfValidDataMemberPointersWithValidKeyAndInReplacementMapEvaluated++;
+                   // Keep a count of the number of case where the replacement list was valid.
+                      numberOfValidDataMemberPointersWithValidKeyAndInReplacementMapEvaluated++;
 
-                         if (traceReplacement == true)
-                            {
-                              printf ("FixupTraversal::visit(): Set the key (IR node) (%p = %s) on %p = %s to %p = %s \n",key,debugString.c_str(),node,node->class_name().c_str(),originalNode,originalNode->class_name().c_str());
-                            }
+                      if (traceReplacement == true)
+                         {
+                           printf ("FixupTraversal::visit(): Set the key (IR node) (%p = %s) on %p = %s to %p = %s \n",key,debugString.c_str(),node,node->class_name().c_str(),originalNode,originalNode->class_name().c_str());
+                         }
 
-                         ROSE_ASSERT(*pointerToKey == key);
+                      if (key != originalNode)
+                         {
+                        // Now reset the pointer to the subtree identified as redundent with
+                        // a subtree in the original AST to the subtree in the original AST.
+                        // *pointerToKey = node;
+                           key = originalNode;
 
-                         if (key != originalNode)
-                            {
-                           // Now reset the pointer to the subtree identified as redundent with
-                           // a subtree in the original AST to the subtree in the original AST.
-                           // *pointerToKey = node;
-                              *pointerToKey = originalNode;
+                        // Keep a count of the number of IR nodes that are reset.
+                           numberOfValidDataMemberPointersReset++;
+                         }
 
-                           // Keep a count of the number of IR nodes that are reset.
-                              numberOfValidDataMemberPointersReset++;
-                            }
+                      lowerBound++;
+                      loopCounter++;
+                    }
 
-                         lowerBound++;
-                         loopCounter++;
-                       }
-
-                 // DQ (2/8/2007): If the loop trip is only 0 or 1 then we don't need a loop here!
-                 // I think that by design the loop trip is at most 1!
-                 // printf ("FixupTraversal::visit(): loop from replacementMap.lower_bound(key) to replacementMap.upper_bound(key): loopCounter = %d \n",loopCounter);
-                    ROSE_ASSERT(loopCounter < 2);
-                 // end of block for "if(key != NULL)"
+              // DQ (2/8/2007): If the loop trip is only 0 or 1 then we don't need a loop here!
+              // I think that by design the loop trip is at most 1!
+              // printf ("FixupTraversal::visit(): loop from replacementMap.lower_bound(key) to replacementMap.upper_bound(key): loopCounter = %d \n",loopCounter);
+                 ROSE_ASSERT(loopCounter < 2);
+              // end of block for "if(key != NULL)"
 #else
-                 // Since the ReplacementMapTraversal::ReplacementMapType is a now a map rather 
-                 // than a multi-map, the use of it is simple and should be more efficient.
+              // Since the ReplacementMapTraversal::ReplacementMapType is a now a map rather 
+              // than a multi-map, the use of it is simple and should be more efficient.
 
-                 // Keep a count of the number of case where the replacement list was valid.
-                    numberOfValidDataMemberPointersWithValidKeyAndInReplacementMapEvaluated++;
+              // Keep a count of the number of case where the replacement list was valid.
+                 ft.numberOfValidDataMemberPointersWithValidKeyAndInReplacementMapEvaluated++;
 
-                 // Check that the key is in the map
-                 // DQ (2/19/2007): This is more efficient since it looks up the element from the map only once.
-                    ReplacementMapTraversal::ReplacementMapType::const_iterator replacementMap_it = replacementMap.find(key);
-                    if (replacementMap_it != replacementMap.end())
-                       {
-                         SgNode* originalNode = replacementMap_it->second;
+              // Check that the key is in the map
+              // DQ (2/19/2007): This is more efficient since it looks up the element from the map only once.
+                 ReplacementMapTraversal::ReplacementMapType::const_iterator replacementMap_it = ft.replacementMap.find(key);
+                 if (replacementMap_it != ft.replacementMap.end())
+                    {
+                      SgNode* originalNode = replacementMap_it->second;
 
-                         ROSE_ASSERT(*pointerToKey == key);
+                      if (traceReplacement == true)
+                         {
+                           printf ("FixupTraversal::visit(): Set the key (IR node) (%p = %s) on %p = %s to %p = %s \n",key,debugString.c_str(),node,node->class_name().c_str(),originalNode,originalNode->class_name().c_str());
+                         }
 
-                         if (traceReplacement == true)
-                            {
-                              const string & debugString  = i->second;
-                              printf ("FixupTraversal::visit(): Set the key (IR node) (%p = %s) on %p = %s to %p = %s \n",key,debugString.c_str(),node,node->class_name().c_str(),originalNode,originalNode->class_name().c_str());
-                            }
+                   // Skip the trival case of resetting the pointer value to itself!
+                      if (key != originalNode)
+                         {
+                        // Now reset the pointer to the subtree identified as redundent with a
+                        // subtree in the original AST to the subtree in the original (merged) AST.
+                           key = originalNode;
 
-                      // Skip the trival case of resetting the pointer value to itself!
-                         if (key != originalNode)
-                            {
-                           // Now reset the pointer to the subtree identified as redundent with a
-                           // subtree in the original AST to the subtree in the original (merged) AST.
-                              *pointerToKey = originalNode;
-
-                           // Keep a count of the number of IR nodes that are reset.
-                              numberOfValidDataMemberPointersReset++;
-                            }
-                       }
-                      else
-                       {
-                      // printf ("replacementMap_it == replacementMap.end() \n");
-                       }
+                        // Keep a count of the number of IR nodes that are reset.
+                           ft.numberOfValidDataMemberPointersReset++;
+                         }
+                    }
+                   else
+                    {
+                   // printf ("replacementMap_it == replacementMap.end() \n");
+                    }
 #endif
-                  }
-                 else
-                  {
-                 // printf ("key == NULL \n");
-                  }
-             }
-            else
-             {
-            // printf ("pointerToKey == NULL \n");
-             }
-          
-          i++;
+               }
+              else
+               {
+              // printf ("key == NULL \n");
+               }
         }
+     };
+
+     Replacer r(*this, traceReplacement, node);
+     node->processDataMemberReferenceToPointers(&r);
    }
 
 void

Modified: branches/rice/src/frontend/SageIII/astMerge/merge.C
===================================================================
--- branches/rice/src/frontend/SageIII/astMerge/merge.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/astMerge/merge.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -630,7 +630,7 @@
                     int nextErrorCode = 0;
 #if 1
                     int fileIndex = 0;
-                    SgFile* newFile = new SgFile ( argc, argv, nextErrorCode, fileIndex, project );
+                    SgFile* newFile = determineFileType( vector<string>(argv, argv+argc), nextErrorCode,  project );
                     ROSE_ASSERT (newFile != NULL);
 
                     newFile->set_parent(project);

Modified: branches/rice/src/frontend/SageIII/astMerge/nullifyAST.C
===================================================================
--- branches/rice/src/frontend/SageIII/astMerge/nullifyAST.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/astMerge/nullifyAST.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -38,22 +38,11 @@
 
      if (nullifyIRchildren == true)
         {
-       // Only traverse the new part of the AST
-          typedef vector<pair<SgNode**,string> > DataMemberMapType;
-          DataMemberMapType dataMemberMap = node->returnDataMemberReferenceToPointers();
-
-          DataMemberMapType::iterator i = dataMemberMap.begin();
-          while (i != dataMemberMap.end())
-             {
-            // Ignore the parent pointer since it will be reset differently if required
-               SgNode** pointerToKey = i->first;
-            // SgNode* key           = *(i->first);
-            // string & debugString  = i->second;
-
-               *pointerToKey = NULL;
-
-               i++;
-             }
+          struct Nullifier: public ReferenceToPointerHandler {
+            virtual void operator()(SgNode*& n, const SgName&) {n = NULL;}
+          };
+          Nullifier nf;
+          node->processDataMemberReferenceToPointers(&nf);
         }
    }
 

Modified: branches/rice/src/frontend/SageIII/astPostProcessing/fixupDefiningAndNondefiningDeclarations.C
===================================================================
--- branches/rice/src/frontend/SageIII/astPostProcessing/fixupDefiningAndNondefiningDeclarations.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/astPostProcessing/fixupDefiningAndNondefiningDeclarations.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -451,7 +451,6 @@
                   }
                ROSE_ASSERT(declaration->hasExplicitScope() == false || declaration->get_scope() == definingDeclaration->get_scope());
 
-               ROSE_ASSERT(firstNondefiningDeclaration != NULL);
                if (firstNondefiningDeclaration != NULL)
                   {
 #if 0
@@ -490,6 +489,13 @@
                     ROSE_ASSERT(declaration->hasExplicitScope() == false || declaration->get_scope() == firstNondefiningDeclaration->get_scope());
                  // firstNondefiningDeclaration->set_scope();
                   }
+                  else
+                  { //Liao,10/31/2008
+                     //dump some debugging information before assertion 
+                    declaration->get_file_info()->display("fixupDefiningAndNondefiningDeclarations.C assertion:");
+
+                    ROSE_ASSERT(firstNondefiningDeclaration != NULL);
+                  }
                break;
              }
 

Copied: branches/rice/src/frontend/SageIII/omp.h (from rev 117, trunk/src/frontend/SageIII/omp.h)
===================================================================
--- branches/rice/src/frontend/SageIII/omp.h	                        (rev 0)
+++ branches/rice/src/frontend/SageIII/omp.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,79 @@
+#ifndef _OMP_H
+#define _OMP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *omp_lock_t;  /* represented as a pointer */
+typedef void *omp_nest_lock_t; /* represented as a pointer */
+
+/*
+ * Execution Environment Functions
+ */
+void omp_set_num_threads(int num);
+int omp_get_num_threads(void);
+int omp_get_max_threads(void);
+int omp_get_thread_num(void);
+int omp_get_num_procs(void);
+int omp_in_parallel(void);
+void omp_set_dynamic(int dynamic_thds);
+int omp_get_dynamic(void);
+void omp_set_nested(int n_nested);
+int omp_get_nested(void);
+
+/* 
+ * Timer routine
+ */
+double omp_get_wtime(void);
+double omp_get_wtick(void);
+
+/*
+ * Lock Functions
+ */
+void omp_init_lock(omp_lock_t *lock);
+void omp_init_nest_lock(omp_nest_lock_t *lock);
+void omp_destroy_lock(omp_lock_t *lock);
+void omp_destroy_nest_lock(omp_nest_lock_t *lock);
+void omp_set_lock(omp_lock_t *lock);
+void omp_set_nest_lock(omp_nest_lock_t *lock);
+void omp_unset_lock(omp_lock_t *lock);
+void omp_unset_nest_lock(omp_nest_lock_t *lock);
+int omp_test_lock(omp_lock_t *lock);
+int omp_test_nest_lock(omp_nest_lock_t *lock);
+
+/*
+ * FORTRAN Execution Environment Function Wrappers
+ */
+void omp_set_num_threads_(int *num);
+int omp_get_num_threads_(void);
+int omp_get_max_threads_(void);
+int omp_get_thread_num_(void);
+int omp_get_num_procs_(void);
+int omp_in_parallel_(void);
+void omp_set_dynamic_(int *dynamic_thds);
+int omp_get_dynamic_(void);
+void omp_set_nested_(int *n_nested);
+int omp_get_nested_(void);
+
+/*
+ * FORTRAN Lock Function Wrappers
+ */
+typedef unsigned int _omf77Lock_t;
+void omp_init_lock_(_omf77Lock_t *lock);
+void omp_init_nest_lock_(_omf77Lock_t *lock);
+void omp_destroy_lock_(_omf77Lock_t *lock);
+void omp_destroy_nest_lock_(_omf77Lock_t *lock);
+void omp_set_lock_(_omf77Lock_t *lock);
+void omp_set_nest_lock_(_omf77Lock_t *lock);
+void omp_unset_lock_(_omf77Lock_t *lock);
+void omp_unset_nest_lock_(_omf77Lock_t *lock);
+int omp_test_lock_(_omf77Lock_t *lock);
+int omp_test_nest_lock_(_omf77Lock_t *lock);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
+
+#endif /* _OMP_H */
+

Modified: branches/rice/src/frontend/SageIII/rtiHelpers.h
===================================================================
--- branches/rice/src/frontend/SageIII/rtiHelpers.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/rtiHelpers.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -71,7 +71,7 @@
      ss << "[";
 
      printf ("Warning: SgSharedVector iterator support is not finished! \n");
-     ROSE_ASSERT(false);
+     // ROSE_ASSERT(false);
 
   // for (typename std::vector<T>::const_iterator i = x.begin(); i != x.end(); ++i) {if (i != x.begin()) ss << ", "; ss << (*i);}
 

Modified: branches/rice/src/frontend/SageIII/sageInterface/Makefile.am
===================================================================
--- branches/rice/src/frontend/SageIII/sageInterface/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/sageInterface/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -22,6 +22,7 @@
      sageBuilder.h \
      sageBuilderAsm.h \
      endianWrappers.h \
+     integerOps.h \
      abiStuff.h
 #     highLevelInterface.h
 #     loopHelpers.h 

Copied: branches/rice/src/frontend/SageIII/sageInterface/integerOps.h (from rev 117, trunk/src/frontend/SageIII/sageInterface/integerOps.h)
===================================================================
--- branches/rice/src/frontend/SageIII/sageInterface/integerOps.h	                        (rev 0)
+++ branches/rice/src/frontend/SageIII/sageInterface/integerOps.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,103 @@
+#ifndef ROSE_INTEGEROPS_H
+#define ROSE_INTEGEROPS_H
+
+#include <limits>
+#include <boost/static_assert.hpp>
+
+namespace IntegerOpsPrivate {
+
+  template <typename T>
+  struct NumBits {
+    BOOST_STATIC_ASSERT (std::numeric_limits<T>::radix == 2);
+    BOOST_STATIC_ASSERT (std::numeric_limits<T>::is_integer);
+    static const size_t value = std::numeric_limits<T>::digits;
+  };
+
+  template <typename T, size_t Count, bool TooBig> struct SHL1Helper;
+  template <typename T, size_t Count>
+  struct SHL1Helper<T, Count, true> {
+    static const T value = 0;
+  };
+  template <typename T, size_t Count>
+  struct SHL1Helper<T, Count, false> {
+    static const T value = T(1) << Count;
+  };
+
+}
+
+namespace IntegerOps {
+
+// 1 << x, handling the case where x is >= the number of bits in T
+template <typename T, size_t Count>
+struct SHL1: public IntegerOpsPrivate::SHL1Helper<T, Count, (Count >= IntegerOpsPrivate::NumBits<T>::value)> {};
+
+// 1 << x, handling the case where x is >= the number of bits in T
+template <typename T>
+inline T shl1(size_t count) {
+  return (count >= IntegerOpsPrivate::NumBits<T>::value) ? T(0) : (T(1) << count);
+}
+
+// Set rightmost (from LSB) count bits of result, clear others
+template <typename T, size_t Count>
+struct GenMask {
+  static const T value = SHL1<T, Count>::value - T(1);
+};
+
+template <typename T>
+inline T genMask(size_t count) {
+  return shl1<T>(count) - 1;
+}
+
+template <size_t NBits, typename T>
+inline bool signBit(T value) {
+  return (value & SHL1<T, NBits - 1>::value) != T(0);
+}
+
+template <size_t FromBits, size_t ToBits, typename T>
+inline T signExtend(T value) {
+  return value | (signBit<FromBits>(value) ? (GenMask<T, ToBits>::value ^ GenMask<T, FromBits>::value) : T(0));
+}
+
+template <size_t NBits, typename T>
+inline T shiftLeft(T value, size_t count) {
+  return (value * shl1<T>(count)) & GenMask<T, NBits>::value;
+};
+
+template <size_t NBits, typename T>
+inline T shiftRightLogical(T value, size_t count) {
+  return (count >= NBits) ? T(0) : (value >> count);
+}
+
+template <size_t NBits, typename T>
+inline T shiftRightArithmetic(T value, size_t count) {
+  if (count >= NBits) {
+    return signBit<NBits>(value) ? GenMask<T, NBits>::value : T(0);
+  } else {
+    return shiftRightLogical<NBits>(value, count) |
+           (signBit<NBits>(value) ? (GenMask<T, NBits>::value ^ genMask<T>(NBits - count)) : T(0));
+  }
+}
+
+template <size_t NBits, typename T>
+inline T rotateLeft(T value, size_t count) {
+  count %= NBits;
+  return ((value << count) | (value >> (NBits - count))) & GenMask<T, NBits>::value;
+}
+
+template <size_t NBits, typename T>
+inline T rotateRight(T value, size_t count) {
+  count %= NBits;
+  return ((value >> count) | (value << (NBits - count))) & GenMask<T, NBits>::value;
+}
+
+template <typename T>
+inline T log2(T a) {
+  T n = T(1);
+  T i = 0;
+  while (n != 0 && n < a) {n <<= 1; ++i;}
+  return i;
+}
+
+} // namespace IntegerOps
+
+#endif // ROSE_INTEGEROPS_H

Modified: branches/rice/src/frontend/SageIII/sageInterface/sageBuilder.C
===================================================================
--- branches/rice/src/frontend/SageIII/sageInterface/sageBuilder.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/sageInterface/sageBuilder.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1993,8 +1993,12 @@
 
    // DQ (9/3/2008): Added support for SgSourceFile IR node
    // SgFile* result = new SgFile (arglist, nextErrorCode, 0, project);
-      SgSourceFile* result = new SgSourceFile (arglist, nextErrorCode, 0, project);
-
+      //AS(10/04/08) Because of refactoring we require the determineFileType function to be called 
+      //to construct the node. 
+      //SgSourceFile* result = new SgSourceFile (arglist, nextErrorCode, 0, project);
+      SgSourceFile* result = isSgSourceFile(determineFileType(arglist, nextErrorCode, project));
+      
+      
       ROSE_ASSERT(result!=NULL);
       result->set_parent(project);
       project->set_file(*result); 

Modified: branches/rice/src/frontend/SageIII/sageInterface/sageInterface.C
===================================================================
--- branches/rice/src/frontend/SageIII/sageInterface/sageInterface.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/sageInterface/sageInterface.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -169,6 +169,23 @@
      return foundExistingPrototype;
    }
 
+bool
+SageInterface::isAncestor (SgNode* node1, SgNode* node2)   
+{
+  ROSE_ASSERT(node1&&node2);
+  SgNode* curnode= node2;
+  if (node1==node2)
+    return false;
+  do {
+      curnode= curnode->get_parent();
+  } while( (curnode!=NULL)&&(curnode!=node1));
+
+  if (curnode==node1)
+   return true;
+  else 
+    return false;
+}
+
 std::vector<SgNode*>
 SageInterface::astIntersection ( SgNode* original, SgNode* copy, SgCopyHelp* help )
    {
@@ -3019,6 +3036,23 @@
      return returnValue;
    }
 bool
+SageInterface::is_OpenMP_language()
+   {
+     bool returnValue = false;
+
+     vector<SgFile*> fileList = generateFileList();
+
+     int size = (int)fileList.size();
+     for (int i = 0; i < size; i++)
+        {
+          if (fileList[i]->get_openmp() == true)
+               returnValue = true;
+        }
+
+     return returnValue;
+   }
+
+bool
 SageInterface::is_UPC_language()
    {
      bool returnValue = false;
@@ -6735,3 +6769,20 @@
   }
 
 
+// tps : 28 Oct 2008 - support for finding the main interpretation
+ SgAsmInterpretation* 
+ SageInterface::getMainInterpretation(SgAsmFile* file) {
+   SgAsmInterpretationPtrList& interps = file->get_interpretations();
+   if (interps.size()==1)
+     return interps[0];
+   SgAsmInterpretation* mainInt=NULL;
+   SgAsmInterpretationPtrList::iterator it = interps.begin();
+   for (;it!=interps.end();++it) {
+     mainInt = *it;
+     SgAsmGenericHeader* header = mainInt->get_header();
+     if (isSgAsmPEFileHeader(header))
+       break;
+   }
+   ROSE_ASSERT(mainInt);
+   return mainInt;
+ }

Modified: branches/rice/src/frontend/SageIII/sageInterface/sageInterface.h
===================================================================
--- branches/rice/src/frontend/SageIII/sageInterface/sageInterface.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/sageInterface/sageInterface.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,7 +1,10 @@
 #ifndef ROSE_SAGE_INTERFACE
 #define ROSE_SAGE_INTERFACE
 
+
 #include "sage3.h"
+SgFile*                         determineFileType ( std::vector<std::string> argv, int nextErrorCode, SgProject* project );
+
 #include "rewrite.h"
 
 // DQ (7/20/2008): Added support for unparsing abitrary strings in the unparser.
@@ -68,6 +71,10 @@
 //! An internal counter for generating unique SgName
 extern int gensym_counter;
 
+// tps : 28 Oct 2008 - support for finding the main interpretation
+ SgAsmInterpretation* getMainInterpretation(SgAsmFile* file);
+
+
 //------------------------------------------------------------------------
 //@{
 /*! @name Symbol tables
@@ -387,6 +394,7 @@
   /*! Brief These traverse the memory pool of SgFile IR nodes and determine what languages are in use!
    */
   bool is_C_language ();
+  bool is_OpenMP_language ();
   bool is_UPC_language ();
   //! Check if dynamic threads compilation is used for UPC programs
   bool is_UPC_dynamic_threads();
@@ -438,6 +446,8 @@
 			   SgFunctionDeclaration * functionDeclaration,
 			   SgDeclarationStatement * startingAtDeclaration);
 
+  //!check if node1 is an ancestor of node 2, mostly used to compare which scope node is in higher level
+  bool isAncestor(SgNode* node1, SgNode* node2);
 //@}
 //------------------------------------------------------------------------
 //@{
@@ -1039,7 +1049,6 @@
 //! Get the constant value from a constant integer expression; abort on
 //! everything else.  Note that signed long longs are converted to unsigned.
 unsigned long long getIntegerConstantValue(SgValueExp* expr);
-
 //@}
 
 

Modified: branches/rice/src/frontend/SageIII/sageSupport.C
===================================================================
--- branches/rice/src/frontend/SageIII/sageSupport.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/frontend/SageIII/sageSupport.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1120,22 +1120,32 @@
              }
         }
 
+//Liao 10/28/2008: I changed it to a more generic flag to indicate support for either Fortran or C/C++
   // DQ (8/19/2007): I have added the option here so that we can start to support OpenMP for Fortran.
   // Allows handling of OpenMP "!$omp" directives in free form and "c$omp", *$omp and "!$omp" directives in fixed form, enables "!$" conditional 
   // compilation sentinels in free form and "c$", "*$" and "!$" sentinels in fixed form and when linking arranges for the OpenMP runtime library 
   // to be linked in. (Not implemented yet).
-     set_fortran_openmp(false);
-     ROSE_ASSERT (get_fortran_openmp() == false);
-     if ( CommandlineProcessing::isOption(argv,"-","fopenmp",true) == true )
+     set_openmp(false);
+     ROSE_ASSERT (get_openmp() == false);
+     if ( CommandlineProcessing::isOption(argv,"-rose:","(OpenMP|openmp)",true) == true ) 
         {
           if ( SgProject::get_verbose() >= 1 )
-               printf ("Fortran OpenMP option specified \n");
-          set_fortran_openmp(true);
+               printf ("OpenMP option specified \n");
+          set_openmp(true);
+          /*
           if (get_sourceFileUsesFortranFileExtension() == false)
              {
                printf ("Warning, Non Fortran source file name specified with explicit OpenMP option! \n");
                set_fortran_openmp(false);
              }
+             */
+         //side effect for enabling OpenMP, define the macro as required 
+         //This new option does not reach the backend compiler
+         //But it is enough to reach EDG only.
+         //We can later on back end option to turn on their OpenMP handling flags, 
+         //like -fopenmp for GCC, depending on the version of gcc
+         //which will define this macro for GCC
+          argv.push_back("-D_OPENMP");
         }
 
   //
@@ -1543,6 +1553,7 @@
      optionCount = sla(argv, "-rose:", "($)^", "(upc_threads)", &integerOption, 1);
      optionCount = sla(argv, "-rose:", "($)", "(C|C_only)",1);
      optionCount = sla(argv, "-rose:", "($)", "(UPC|UPC_only)",1);
+     optionCount = sla(argv, "-rose:", "($)", "(OpenMP|openmp)",1);
      optionCount = sla(argv, "-rose:", "($)", "(C99|C99_only)",1);
      optionCount = sla(argv, "-rose:", "($)", "(Cxx|Cxx_only)",1);
 
@@ -1746,48 +1757,11 @@
       return returnValue;
     }
 
- 
-void
-SgFile::generateBinaryExecutableFileInformation ( string sourceFilename, SgAsmFile* asmFile )
-   {
-  // Need a mechanism to select what kind of binary we will process.
 
-#if 1
-  // printf ("Calling SgAsmExecutableFileFormat::parseBinaryFormat() \n");
-
-     SgAsmExecutableFileFormat::parseBinaryFormat(sourceFilename,asmFile);
-
-#else
-  // JJW (7/23/2008): We are using Robb's code for this, and it crashes on PE files
-  // printf ("Calling generateBinaryExecutableFileInformation_ELF() \n");
-     bool handled = false;
-
-  // DQ (13/8/2008): Skip the use of the older binary file format support (from before Robb's work).
-  // if (!handled) handled = generateBinaryExecutableFileInformation_ELF( sourceFilename, asmFile );
-  // if (!handled) {} // generateBinaryExecutableFileInformation_Windows ( sourceFilename, asmFile );
-
-     if (!handled) {
-
-    // DQ (13/8/2008): This is one of the few remaining data member in a SgAsmFile IR node.
-       asmFile->set_name(sourceFilename);
-
-    // Hard wire this for the moment while I work on getting Robb's work into place...
-    // DQ (13/8/2008): Removed this data member (such information is now in the SgAsmGenericHeader).
-    // asmFile->set_machine_architecture(SgAsmFile::e_machine_architecture_Intel_80386);
-
-       handled = true;
-     }
-     ROSE_ASSERT (handled);
-#endif
-   }
-
-
-
-
-
-void
-SgFile::setupSourceFilename ( const vector<string>& argv )
+SgFile* 
+determineFileType ( vector<string> argv, int nextErrorCode, SgProject* project )
    {
+     SgFile* file = NULL;
   // DQ (4/21/2006): New version of source file name handling (set the source file name early)
      Rose_STL_Container<string> fileList = CommandlineProcessing::generateSourceFilenames(argv);
 
@@ -1810,10 +1784,6 @@
 
        // printf ("After conversion to absolute path: sourceFilename = %s \n",sourceFilename.c_str());
 
-          p_sourceFileNameWithPath = sourceFilename;
-
-       // printf ("In SgFile::setupSourceFilename(const vector<string>& argv): p_sourceFileNameWithPath = %s \n",p_sourceFileNameWithPath.c_str());
-
        // This should be an absolute path
           string targetSubstring = "/";
        // if (sourceFilename.substr(0,targetSubstring.size()) != targetSubstring)
@@ -1835,69 +1805,71 @@
        // ROSE_ASSERT(false);
 
        // DQ (5/18/2008): Set this to true (redundant, since the default already specified as true)
-          set_requires_C_preprocessor(true);
+          //file->set_requires_C_preprocessor(true);
 
        // DQ (11/17/2007): Mark this as a file using a Fortran file extension (else this turns off options down stream).
           if (CommandlineProcessing::isFortranFileNameSuffix(filenameExtension) == true)
              {
-            // printf ("Calling set_sourceFileUsesFortranFileExtension(true) \n");
-               set_sourceFileUsesFortranFileExtension(true);
+               file = new SgSourceFile ( argv,  project );
 
+            // printf ("Calling file->set_sourceFileUsesFortranFileExtension(true) \n");
+               file->set_sourceFileUsesFortranFileExtension(true);
+
             // Use the filename suffix as a default means to set this value
-               set_outputLanguage(SgFile::e_Fortran_output_language);
+               file->set_outputLanguage(SgFile::e_Fortran_output_language);
 
-               set_Fortran_only(true);
+               file->set_Fortran_only(true);
 
             // DQ (5/18/2008): Set this to true (redundant, since the default already specified as true)
-               set_requires_C_preprocessor(CommandlineProcessing::isFortranFileNameSuffixRequiringCPP(filenameExtension));
+               file->set_requires_C_preprocessor(CommandlineProcessing::isFortranFileNameSuffixRequiringCPP(filenameExtension));
 
             // Now set the specific types of Fortran file extensions
                if (CommandlineProcessing::isFortran77FileNameSuffix(filenameExtension) == true)
                   {
-                 // printf ("Calling set_sourceFileUsesFortran77FileExtension(true) \n");
-                    set_sourceFileUsesFortran77FileExtension(true);
+                 // printf ("Calling file->set_sourceFileUsesFortran77FileExtension(true) \n");
+                    file->set_sourceFileUsesFortran77FileExtension(true);
 
                  // Use the filename suffix as a default means to set this value
-                    set_outputFormat(SgFile::e_fixed_form_output_format);
-                    set_backendCompileFormat(SgFile::e_fixed_form_output_format);
+                    file->set_outputFormat(SgFile::e_fixed_form_output_format);
+                    file->set_backendCompileFormat(SgFile::e_fixed_form_output_format);
 
-                    set_F77_only(true);
+                    file->set_F77_only(true);
                   }
 
                if (CommandlineProcessing::isFortran90FileNameSuffix(filenameExtension) == true)
                   {
-                 // printf ("Calling set_sourceFileUsesFortran90FileExtension(true) \n");
-                    set_sourceFileUsesFortran90FileExtension(true);
+                 // printf ("Calling file->set_sourceFileUsesFortran90FileExtension(true) \n");
+                    file->set_sourceFileUsesFortran90FileExtension(true);
 
                  // Use the filename suffix as a default means to set this value
-                    set_outputFormat(SgFile::e_free_form_output_format);
-                    set_backendCompileFormat(SgFile::e_free_form_output_format);
+                    file->set_outputFormat(SgFile::e_free_form_output_format);
+                    file->set_backendCompileFormat(SgFile::e_free_form_output_format);
 
-                    set_F90_only(true);
+                    file->set_F90_only(true);
                   }
 
                if (CommandlineProcessing::isFortran95FileNameSuffix(filenameExtension) == true)
                   {
-                 // printf ("Calling set_sourceFileUsesFortran95FileExtension(true) \n");
-                    set_sourceFileUsesFortran95FileExtension(true);
+                 // printf ("Calling file->set_sourceFileUsesFortran95FileExtension(true) \n");
+                    file->set_sourceFileUsesFortran95FileExtension(true);
 
                  // Use the filename suffix as a default means to set this value
-                    set_outputFormat(SgFile::e_free_form_output_format);
-                    set_backendCompileFormat(SgFile::e_free_form_output_format);
+                    file->set_outputFormat(SgFile::e_free_form_output_format);
+                    file->set_backendCompileFormat(SgFile::e_free_form_output_format);
 
-                    set_F95_only(true);
+                    file->set_F95_only(true);
                   }
 
                if (CommandlineProcessing::isFortran2003FileNameSuffix(filenameExtension) == true)
                   {
-                 // printf ("Calling set_sourceFileUsesFortran2003FileExtension(true) \n");
-                    set_sourceFileUsesFortran2003FileExtension(true);
+                 // printf ("Calling file->set_sourceFileUsesFortran2003FileExtension(true) \n");
+                    file->set_sourceFileUsesFortran2003FileExtension(true);
 
                  // Use the filename suffix as a default means to set this value
-                    set_outputFormat(SgFile::e_free_form_output_format);
-                    set_backendCompileFormat(SgFile::e_free_form_output_format);
+                    file->set_outputFormat(SgFile::e_free_form_output_format);
+                    file->set_backendCompileFormat(SgFile::e_free_form_output_format);
 
-                    set_F2003_only(true);
+                    file->set_F2003_only(true);
                   }
 
                if (CommandlineProcessing::isFortran2008FileNameSuffix(filenameExtension) == true)
@@ -1906,55 +1878,64 @@
                     ROSE_ASSERT(false);
 
                  // This is not yet supported.
-                 // set_sourceFileUsesFortran2008FileExtension(true);
+                 // file->set_sourceFileUsesFortran2008FileExtension(true);
 
                  // Use the filename suffix as a default means to set this value
-                    set_outputFormat(SgFile::e_free_form_output_format);
-                    set_backendCompileFormat(SgFile::e_free_form_output_format);
+                    file->set_outputFormat(SgFile::e_free_form_output_format);
+                    file->set_backendCompileFormat(SgFile::e_free_form_output_format);
                   }
              }
             else if (CommandlineProcessing::isPHPFileNameSuffix(filenameExtension) == true)
              {
-                    set_sourceFileUsesPHPFileExtension(true);
 
-                    set_outputLanguage(SgFile::e_PHP_output_language);
+                    file = new SgSourceFile ( argv,  project );
 
-                    set_PHP_only(true);
+                    file->set_sourceFileUsesPHPFileExtension(true);
+
+                    file->set_outputLanguage(SgFile::e_PHP_output_language);
+
+                    file->set_PHP_only(true);
               }
             else
              {
-            // printf ("Calling set_sourceFileUsesFortranFileExtension(false) \n");
-               set_sourceFileUsesFortranFileExtension(false);
-
+            // printf ("Calling file->set_sourceFileUsesFortranFileExtension(false) \n");
+               
             // if (StringUtility::isCppFileNameSuffix(filenameExtension) == true)
                if (CommandlineProcessing::isCppFileNameSuffix(filenameExtension) == true)
                   {
+                    file = new SgSourceFile ( argv,  project );
+
                  // This is a C++ file (so define __cplusplus, just like GNU gcc would)
-                 // set_requires_cplusplus_macro(true);
-                    set_sourceFileUsesCppFileExtension(true);
+                 // file->set_requires_cplusplus_macro(true);
+                    file->set_sourceFileUsesCppFileExtension(true);
 
                  // Use the filename suffix as a default means to set this value
-                    set_outputLanguage(SgFile::e_Cxx_output_language);
+                    file->set_outputLanguage(SgFile::e_Cxx_output_language);
 
-                    set_Cxx_only(true);
+                    file->set_Cxx_only(true);
+                  
                   }
                  else
                   {
+             
                   // Liao, 6/6/2008, Assume AST with UPC will be unparsed using the C unparser
                     if ( ( CommandlineProcessing::isCFileNameSuffix(filenameExtension)   == true ) ||
                          ( CommandlineProcessing::isUPCFileNameSuffix(filenameExtension) == true ) )
                        {
+
+                         file = new SgSourceFile ( argv,  project );
+
                       // This a not a C++ file (assume it is a C file and don't define the __cplusplus macro, just like GNU gcc would)
-                         set_sourceFileUsesCppFileExtension(false);
+                         file->set_sourceFileUsesCppFileExtension(false);
 
                       // Use the filename suffix as a default means to set this value
-                         set_outputLanguage(SgFile::e_C_output_language);
+                         file->set_outputLanguage(SgFile::e_C_output_language);
 
-                         set_C_only(true);
+                         file->set_C_only(true);
                          // Liao 6/6/2008  Set the newly introduced p_UPC_only flag.
                          //
                          if (CommandlineProcessing::isUPCFileNameSuffix(filenameExtension) == true) 
-                           set_UPC_only(true);
+                           file->set_UPC_only(true);
                        }
                       else
                        {
@@ -1965,41 +1946,105 @@
 
                          if (isBinaryExecutable == true)
                             {
-                              set_sourceFileUsesBinaryFileExtension(true);
-                              set_binary_only(true);
 
+                              file = new SgBinaryFile ( argv,  project );
+
+                              file->set_sourceFileUsesBinaryFileExtension(true);
+                              file->set_binary_only(true);
+
                            // DQ (5/18/2008): Set this to false (since binaries are never preprocessed using the C preprocessor).
-                              set_requires_C_preprocessor(false);
+                              file->set_requires_C_preprocessor(false);
                             }
                            else
                             {
+
+                              file = new SgUnknownFile ( argv,  project );
+
                            // If all else fails, then output the type of file and exit.
-                              outputTypeOfFileAndExit(sourceFilename);
+                              file->set_sourceFileTypeIsUnknown(true);
+                              file->set_requires_C_preprocessor(false);
+                              //outputTypeOfFileAndExit(sourceFilename);
                             }
                        }
                   }
+                 file->set_sourceFileUsesFortranFileExtension(false);
+
              }
 
-          p_sourceFileNameWithoutPath = ROSE::stripPathFromFileName(p_sourceFileNameWithPath.c_str());
         }
        else
         {
+
+          //AS Is this option possible?
+          abort();
        // ROSE_ASSERT (p_numberOfSourceFileNames == 0);
-          ROSE_ASSERT (p_sourceFileNameWithPath.empty() == true);
+          ROSE_ASSERT (file->get_sourceFileNameWithPath().empty() == true);
        // If no source code file name was found then likely this is a link command
        // using the C++ compiler.  In this case skip the EDG processing.
-          set_disable_edg_backend(true);
+          file->set_disable_edg_backend(true);
        // printf ("No source file found on command line, assuming to be linker command line \n");
         }
 
+    //The frontend is called exlicitly outside the constructor since that allows for a cleaner
+    //control flow. The callFrontEnd() relies on all the "set_" flags to be already called therefore
+    //it was placed here.
+    if( isSgUnknownFile(file) == NULL && file != NULL  )
+    {
+
+      nextErrorCode =   file->callFrontEnd() ;
+      ROSE_ASSERT ( nextErrorCode <= 3);
+
+    }
+       
   // Keep the filename stored in the Sg_File_Info consistant.  Later we will want to remove this redundency
   // The reason we have the Sg_File_Info object is so that we can easily support filename matching based on
   // the integer values instead of string comparisions.
-     get_file_info()->set_filenameString(p_sourceFileNameWithPath);
-
+     
   // display("SgFile::setupSourceFilename()");
+     return file;
    }
 
+ 
+void
+SgFile::generateBinaryExecutableFileInformation ( string sourceFilename, SgAsmFile* asmFile )
+   {
+  // Need a mechanism to select what kind of binary we will process.
+
+#if 1
+  // printf ("Calling SgAsmExecutableFileFormat::parseBinaryFormat() \n");
+
+     SgAsmExecutableFileFormat::parseBinaryFormat(sourceFilename,asmFile);
+
+#else
+  // JJW (7/23/2008): We are using Robb's code for this, and it crashes on PE files
+  // printf ("Calling generateBinaryExecutableFileInformation_ELF() \n");
+     bool handled = false;
+
+  // DQ (13/8/2008): Skip the use of the older binary file format support (from before Robb's work).
+  // if (!handled) handled = generateBinaryExecutableFileInformation_ELF( sourceFilename, asmFile );
+  // if (!handled) {} // generateBinaryExecutableFileInformation_Windows ( sourceFilename, asmFile );
+
+     if (!handled) {
+
+    // DQ (13/8/2008): This is one of the few remaining data member in a SgAsmFile IR node.
+       asmFile->set_name(sourceFilename);
+
+    // Hard wire this for the moment while I work on getting Robb's work into place...
+    // DQ (13/8/2008): Removed this data member (such information is now in the SgAsmGenericHeader).
+    // asmFile->set_machine_architecture(SgAsmFile::e_machine_architecture_Intel_80386);
+
+       handled = true;
+     }
+     ROSE_ASSERT (handled);
+#endif
+   }
+
+
+
+
+
+
+
 static string makeSysIncludeList(const Rose_STL_Container<string>& dirs) {
   string includeBase = findRoseSupportPathFromBuild("include-staging", "include");
   string result;
@@ -2807,8 +2852,19 @@
    }
 
 
+SgSourceFile::SgSourceFile ( vector<string> & argv , SgProject* project )
+// : SgFile (argv,errorCode,fileNameIndex,project)
+   {
+  // printf ("In the SgSourceFile constructor \n");
 
+     set_globalScope(NULL);
 
+  // This constructor actually makes the call to EDG to build the AST (via callFrontEnd()).
+     doSetupForConstructor(argv,  project);
+
+    }
+
+#if 0
 SgSourceFile::SgSourceFile ( vector<string> & argv , int & errorCode, int fileNameIndex, SgProject* project )
 // : SgFile (argv,errorCode,fileNameIndex,project)
    {
@@ -2819,6 +2875,17 @@
   // This constructor actually makes the call to EDG to build the AST (via callFrontEnd()).
      doSetupForConstructor(argv, errorCode, fileNameIndex, project);
 
+    }
+#endif
+
+int
+SgSourceFile::callFrontEnd()
+   {
+#ifdef USE_ROSE_OPEN_FORTRAN_PARSER_SUPPORT
+     FortranParserState* currStks = new FortranParserState(); 
+#endif // USE_ROSE_OPEN_FORTRAN_PARSER_SUPPORT
+
+     int frontendErrorLevel = SgFile::callFrontEnd();
   // DQ (1/21/2008): This must be set for all languages
      ROSE_ASSERT(get_globalScope() != NULL);
      ROSE_ASSERT(get_globalScope()->get_file_info() != NULL);
@@ -2828,9 +2895,30 @@
   // DQ (8/21/2008): Added assertion.
      ROSE_ASSERT (get_globalScope()->get_startOfConstruct() != NULL);
      ROSE_ASSERT (get_globalScope()->get_endOfConstruct()   != NULL);
-    }
- 
-SgBinaryFile::SgBinaryFile ( vector<string> & argv , int & errorCode, int fileNameIndex, SgProject* project )
+
+#ifdef USE_ROSE_OPEN_FORTRAN_PARSER_SUPPORT
+     delete  currStks ;
+#endif // USE_ROSE_OPEN_FORTRAN_PARSER_SUPPORT
+
+     return frontendErrorLevel;
+   }
+
+int
+SgBinaryFile::callFrontEnd()
+   {
+     int frontendErrorLevel = SgFile::callFrontEnd();
+  // DQ (1/21/2008): This must be set for all languages
+     return frontendErrorLevel;
+   }
+
+int
+SgUnknownFile::callFrontEnd()
+   {
+     abort(); 
+     return 0;
+   }
+
+SgBinaryFile::SgBinaryFile ( vector<string> & argv ,  SgProject* project )
 // : SgFile (argv,errorCode,fileNameIndex,project)
    {
      p_binaryFile = NULL;
@@ -2839,7 +2927,7 @@
   // printf ("In the SgBinaryFile constructor \n");
 
   // This constructor actually makes the call to EDG to build the AST (via callFrontEnd()).
-     doSetupForConstructor(argv, errorCode, fileNameIndex, project);
+     doSetupForConstructor(argv,  project);
    }
 
 
@@ -2919,17 +3007,9 @@
 
             // printf ("currentFileName = %s \n",currentFileName.c_str());
 
-               if (isBinaryExecutableFile(currentFileName) == true)
-                  {
-                 // printf ("This is a binary file so building a SgBinaryFile IR node! \n");
-                    newFile = new SgBinaryFile ( argv, nextErrorCode, 0, this );
-                  }
-                 else
-                  {
-                 // printf ("This is NOT a binary file so building a SgSourceFile IR node! \n");
-                    newFile = new SgSourceFile ( argv, nextErrorCode, 0, this );
-                  }
 
+               newFile = determineFileType(argv, nextErrorCode, this);
+               
                ROSE_ASSERT (newFile != NULL);
 
             // printf ("In SgProject::parse(): newFile = %p = %s \n",newFile,newFile->class_name().c_str());
@@ -2994,6 +3074,7 @@
      return errorCode;
    }
 
+#if 0
 void
 SgFile::doSetupForConstructor(const vector<string>& argv, int& errorCode, int fileNameIndex, SgProject* project)
    {
@@ -3038,8 +3119,37 @@
      ROSE_ASSERT(get_parent() != NULL);
 
   // DQ (4/21/2006): Setup the source filename as early as possible
-     setupSourceFilename(argv);
+     //setupSourceFilename(argv);
 
+     Rose_STL_Container<string> fileList = CommandlineProcessing::generateSourceFilenames(argv);
+
+     // this->display("In SgFile::setupSourceFilename()");
+     // printf ("listToString(argv) = %s \n",StringUtility::listToString(argv).c_str());
+     // printf ("listToString(fileList) = %s \n",StringUtility::listToString(fileList).c_str());
+
+     if (fileList.empty() == false)
+     {
+
+       string sourceFilename = *(fileList.begin());
+
+       // printf ("Before conversion to absolute path: sourceFilename = %s \n",sourceFilename.c_str());
+
+       // sourceFilename = StringUtility::getAbsolutePathFromRelativePath(sourceFilename);
+       sourceFilename = StringUtility::getAbsolutePathFromRelativePath(sourceFilename, true);
+
+       set_sourceFileNameWithPath(sourceFilename);
+
+       //printf ("In SgFile::setupSourceFilename(const vector<string>& argv): p_sourceFileNameWithPath = %s \n",get_sourceFileNameWithPath().c_str());
+
+
+       set_sourceFileNameWithoutPath( ROSE::stripPathFromFileName(get_sourceFileNameWithPath().c_str()) );
+       get_file_info()->set_filenameString( get_sourceFileNameWithPath() );
+     }else{
+       //A file should never be created without a filename so this branch should be impossible
+       abort();
+     }
+
+     
 #if 1
   // DQ (9/5/2008): Handle the case that this is a SgSourceFile.  This is awkward code, and may be a temporary fix.
      const SgSourceFile* sourceFile = isSgSourceFile(this);
@@ -3055,6 +3165,8 @@
 
        // p_root->get_file_info()->set_filenameString(p_sourceFileNameWithPath);
        // ROSE_ASSERT(p_root->get_file_info()->get_filenameString().empty() == false);
+
+
           sourceFile->get_globalScope()->get_startOfConstruct()->set_filenameString(p_sourceFileNameWithPath);
           ROSE_ASSERT(sourceFile->get_globalScope()->get_startOfConstruct()->get_filenameString().empty() == false);
 
@@ -3140,15 +3252,20 @@
           get_skipfinalCompileStep() ? "true" : "false");
 #endif
 
-#if 1
+
+#if 0
+  //AS(10/04/08) Removed code because of refactoring into determineFileType(..). callFrontEnd relies on all
+  //the appropriate flags being set first.
+
   // DQ (10/16/2005): Modified to make clear that argc and argv are not modified
   // Call the EDG fron-end to generate the abstract syntax tree
   // int EDG_FrontEndErrorCode = callFrontEnd ( argc, argv, *this, fileNameIndex );
   // int EDG_FrontEndErrorCode = callFrontEnd (  local_commandLineArgumentList, *this, fileNameIndex );
   // int EDG_FrontEndErrorCode = callFrontEnd (  local_commandLineArgumentList );
   // int EDG_FrontEndErrorCode = callFrontEnd();
-     int EDG_FrontEndErrorCode = callFrontEnd();
 
+     int EDG_FrontEndErrorCode =  get_sourceFileTypeIsUnknown() == false ? callFrontEnd() : 0 ;
+
   // Warning from EDG processing are OK but not errors
      ROSE_ASSERT (EDG_FrontEndErrorCode <= 3);
 
@@ -3168,33 +3285,14 @@
   // ROSE_ASSERT (localfileInfo != NULL);
   // set_file_info(localfileInfo);
 
-#if 0
-  // DQ (9/5/2008): This was easier to move to the constructor for SgSourceFile
 
-  // DQ (10/15/2005): This has not been converted to a C++ string!
-  // DQ (5/24/2005): Now fixup the file info's file name in the global scope!
-  // printf ("In SgFile::doSetupForConstructor p_sourceFileNamesWithPath[%d] = %s \n",fileNameIndex,p_sourceFileNamesWithPath[fileNameIndex]);
-  // p_root->get_file_info()->set_filename(p_sourceFileNamesWithPath[fileNameIndex]);
 
-  // DQ (1/22/2008): This should have been set above!
-  // p_root->get_file_info()->set_filenameString(p_sourceFileNameWithPath);
-
-  // DQ (1/21/2008): This must be set for all languages
-     ROSE_ASSERT(p_root != NULL);
-     ROSE_ASSERT(p_root->get_file_info() != NULL);
-     ROSE_ASSERT(p_root->get_file_info()->get_filenameString().empty() == false);
-  // printf ("p_root->get_file_info()->get_filenameString() = %s \n",p_root->get_file_info()->get_filenameString().c_str());
-#endif
-
   // DQ (1/18/2006): Set the filename in the SgFile::p_file_info
      ROSE_ASSERT(get_file_info() != NULL);
      get_file_info()->set_filenameString(p_sourceFileNameWithPath);
 
-#if 0
-     printf ("In SgFile::doSetupForConstructor(): get_skipfinalCompileStep() = %s \n",
-          get_skipfinalCompileStep() ? "true" : "false");
-#endif
 
+
   // DQ (5/3/2007): Added assertion.
      ROSE_ASSERT (get_startOfConstruct() != NULL);
 
@@ -3208,6 +3306,140 @@
 #endif // USE_ROSE_OPEN_FORTRAN_PARSER_SUPPORT
    }
 
+
+#endif
+
+
+void
+SgSourceFile::doSetupForConstructor(const vector<string>& argv, SgProject* project)
+   {
+
+     SgFile::doSetupForConstructor(argv, project);
+     
+     // DQ (1/21/2008): Set the filename in the SgGlobal IR node so that the traversal to add CPP directives and comments will succeed.
+     ROSE_ASSERT (get_globalScope() != NULL);
+     ROSE_ASSERT(get_globalScope()->get_startOfConstruct() != NULL);
+
+     // DQ (8/21/2008): Modified to make endOfConstruct consistant (avoids warning in AST consistancy check).
+     // ROSE_ASSERT(p_root->get_endOfConstruct()   == NULL);
+     ROSE_ASSERT(get_globalScope()->get_endOfConstruct()   != NULL);
+
+     // p_root->get_file_info()->set_filenameString(p_sourceFileNameWithPath);
+     // ROSE_ASSERT(p_root->get_file_info()->get_filenameString().empty() == false);
+
+
+     get_globalScope()->get_startOfConstruct()->set_filenameString(p_sourceFileNameWithPath);
+     ROSE_ASSERT(get_globalScope()->get_startOfConstruct()->get_filenameString().empty() == false);
+
+     // DQ (8/21/2008): Uncommented to make the endOfConstruct consistant (avoids warning in AST consistancy check).
+     get_globalScope()->get_endOfConstruct()->set_filenameString(p_sourceFileNameWithPath);
+     ROSE_ASSERT(get_globalScope()->get_endOfConstruct()->get_filenameString().empty() == false);
+
+     
+   }
+
+void
+SgBinaryFile::doSetupForConstructor(const vector<string>& argv, SgProject* project)
+   {
+       SgFile::doSetupForConstructor(argv, project);
+
+   }
+
+void
+SgUnknownFile::doSetupForConstructor(const vector<string>& argv, SgProject* project)
+   {
+       SgFile::doSetupForConstructor(argv, project);
+
+   }
+
+void
+SgFile::doSetupForConstructor(const vector<string>& argv, SgProject* project)
+   {
+
+  // JJW 10-26-2007 ensure that this object is not on the stack
+     preventConstructionOnStack(this);
+
+
+  // Set the project early in the construction phase so that we can access data in 
+  // the parent if needed (useful for template handling but also makes sure the parent is
+  // set (and avoids fixup (currently done, but too late in the construction process for 
+  // the template support).
+     if (project != NULL)
+          set_parent(project);
+
+     ROSE_ASSERT (project != NULL);
+
+     ROSE_ASSERT(get_parent() != NULL);
+
+
+  // initalize all local variables to default values
+     initialization();
+
+     ROSE_ASSERT(get_parent() != NULL);
+
+  // DQ (4/21/2006): Setup the source filename as early as possible
+     //setupSourceFilename(argv);
+
+     Rose_STL_Container<string> fileList = CommandlineProcessing::generateSourceFilenames(argv);
+
+
+     if (fileList.empty() == false)
+     {
+
+       string sourceFilename = *(fileList.begin());
+
+       // printf ("Before conversion to absolute path: sourceFilename = %s \n",sourceFilename.c_str());
+
+       // sourceFilename = StringUtility::getAbsolutePathFromRelativePath(sourceFilename);
+       sourceFilename = StringUtility::getAbsolutePathFromRelativePath(sourceFilename, true);
+
+       set_sourceFileNameWithPath(sourceFilename);
+
+       //printf ("In SgFile::setupSourceFilename(const vector<string>& argv): p_sourceFileNameWithPath = %s \n",get_sourceFileNameWithPath().c_str());
+
+
+       set_sourceFileNameWithoutPath( ROSE::stripPathFromFileName(get_sourceFileNameWithPath().c_str()) );
+       get_file_info()->set_filenameString( get_sourceFileNameWithPath() );
+     }else{
+       //A file should never be created without a filename so this branch should be impossible
+       abort();
+     }
+
+     
+  // DQ (5/9/2007): Moved this call from above to where the file name is available so that we could include 
+  // the filename in the label.  This helps to identify the performance data with individual files where
+  // multiple source files are specificed on the command line.
+  // printf ("p_sourceFileNameWithPath = %s \n",p_sourceFileNameWithPath);
+     string timerLabel = "AST SgFile Constructor for " + p_sourceFileNameWithPath + ":";
+     TimingPerformance timer (timerLabel);
+
+  // Build a DEEP COPY of the input parameters!
+     vector<string> local_commandLineArgumentList = argv;
+
+  // Save the commandline as a list of strings (we made a deep copy because the "callFrontEnd()" function might change it!
+     set_originalCommandLineArgumentList( local_commandLineArgumentList );
+
+  // DQ (5/22/2005): Store the file name index in the SgFile object so that it can figure out 
+  // which file name applies to it.  This helps support functions such as "get_filename()" 
+  // used elsewhere in Sage III.  Not clear if we really need this!
+  // error checking
+     ROSE_ASSERT (argv.size() > 1);
+
+  // DQ (1/18/2006): Set the filename in the SgFile::p_file_info
+     ROSE_ASSERT(get_file_info() != NULL);
+     get_file_info()->set_filenameString(p_sourceFileNameWithPath);
+
+
+
+  // DQ (5/3/2007): Added assertion.
+     ROSE_ASSERT (get_startOfConstruct() != NULL);
+
+
+   }
+
+
+
+
 #if 1
 #define CASE_SENSITIVE_SYSTEM 1
 
@@ -3769,6 +4001,10 @@
                          frontendErrorLevel = binaryFile->buildAST(argv,inputCommandLine);
                          break;
                        }
+                    case V_SgUnknownFile:
+                       {
+                         break;
+                       }
 
                     default:
                        {
@@ -5289,6 +5525,8 @@
 "                             follow C99 standard, disable C++\n"
 "     -rose:Cxx_only, -rose:Cxx\n"
 "                             follow C++ 89 standard\n"
+"     -rose:OpenMP, -rose:openmp\n"   
+"                             follow OpenMP 3.0 C/C++ specification\n"
 "     -rose:UPC_only, -rose:UPC\n"   
 "                             follow Unified Parallel C 1.2 specification\n"
 "     -rose:upc_threads n     Enable UPC static threads compilation with n threads\n"
@@ -5749,3 +5987,4 @@
      return  returnList;
    }
  
+

Modified: branches/rice/src/midend/abstractHandle/loopAdapter.cpp
===================================================================
--- branches/rice/src/midend/abstractHandle/loopAdapter.cpp	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/abstractHandle/loopAdapter.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -10,8 +10,9 @@
 using namespace std;
 using namespace AbstractHandle;
 
-// an internal map to avoid duplicated nodes for a same file
+// an internal map to avoid duplicated nodes 
 map<string, abstract_node*> file_node_map;
+map<MyLoop*, abstract_node*> loop_node_map;
 
 /* Only handle for loops
 * */
@@ -31,12 +32,20 @@
  return getNode()->sourceFileName;
 }
 
-/* Assume MyLoop only works for flat list of loops, no real parent-child relation 
- * but file node can be treated as their parent here
+/* 
  * */
 abstract_node* loopNode::getParent() const
 {
-  return getFileNode();
+  if (getNode()->parent!=NULL)
+  {
+    abstract_node* result = loop_node_map[getNode()->parent];
+    if (result == NULL)
+      return new loopNode(getNode()->parent);
+    else
+      return result;
+  }
+  else
+    return getFileNode();
 }
 
 /* 
@@ -46,7 +55,10 @@
 {
  abstract_node* filenode = file_node_map[getNode()->sourceFileName];
  if (filenode==NULL)
+ {
    filenode = new fileNode (getNode()->sourceFileName);
+   file_node_map[getNode()->sourceFileName]=filenode;
+ }
  return filenode;
 }
 
@@ -60,16 +72,24 @@
 }
 
 // return the numbering within a scope (file)
-// MyLoop only cares about numbering inside its source file
-// The parameter has to be a fileNode
+// MyLoop can be attached to a file node or another loop node.
+// The parameter must be either of a fileNode or a loopNode
 size_t loopNode::getNumbering(const abstract_node * another_node) const
 {
   int number=1;
   const fileNode* file_node = dynamic_cast<const fileNode*> (another_node);
-  assert(file_node!=NULL);
-  vector<MyLoop*> *loops = file_node->getMLoops();
- for (vector<MyLoop *>::iterator i=(*loops).begin();
-      i!=(*loops).end(); i++)
+  const loopNode* p_loop_node = dynamic_cast<const loopNode*> (another_node);
+
+  vector<MyLoop*> loops;
+
+  if (file_node)
+    loops = file_node->getMLoops();
+  else if (p_loop_node)  
+    loops = p_loop_node->getChildren();
+  else
+    assert(false);
+ for (vector<MyLoop*>::iterator i=loops.begin();
+      i!=loops.end(); i++)
   {
     if ((*i)==getNode())
       break;
@@ -79,10 +99,45 @@
   return number;
 }
 
+AbstractHandle::abstract_node* loopNode::findNode(std::string construct_type_str, AbstractHandle::specifier mspecifier) const
+{
+   abstract_node* result=NULL;
+    //Get all matched nodes according to node type
+  vector<MyLoop*> loops = getChildren();  
+  for (vector<MyLoop *>::iterator i=loops.begin();i!=loops.end();i++)
+  {
+    abstract_node* cnode = new loopNode(*i);
+    if (mspecifier.get_type()==e_position)
+    {
+      if (isEqual(mspecifier.get_value().positions, cnode->getSourcePos()))
+      {
+        result = cnode;
+        break;
+      }
+    }
+    else if (mspecifier.get_type()==e_numbering)
+    {
+      if (mspecifier.get_value().int_v == cnode->getNumbering(this))
+      {
+        result = cnode;
+        break;
+      }
+    }
+    else 
+    {
+      cerr<<"error: unhandled specifier type in loopNode::findNode()"<<endl;
+      assert(false);
+    }
+  }//end for
+  return result;
+
+}
+
 std::string loopNode::toString() const
 {
   std::string result;
-  result= getNode()->loop_code;
+  //We ignore this for simplicity
+  //result= getNode()->loop_code;
   return result;
 }
 
@@ -115,7 +170,7 @@
   abstract_node* result=NULL;
 
   //Get all matched nodes according to node type
-  vector<MyLoop*> loops = *mLoops;  
+  vector<MyLoop*> loops = mLoops;  
 
   for (vector<MyLoop *>::iterator i=loops.begin();i!=loops.end();i++)
   {
@@ -127,6 +182,13 @@
         result = cnode;
         break;
       }
+    } else if (mspecifier.get_type()==e_numbering)
+    {
+      if (mspecifier.get_value().int_v == cnode->getNumbering(this))
+      {
+        result = cnode;
+        break;
+      }
     }
     else 
     {

Modified: branches/rice/src/midend/abstractHandle/loopAdapter.h
===================================================================
--- branches/rice/src/midend/abstractHandle/loopAdapter.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/abstractHandle/loopAdapter.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -21,11 +21,14 @@
    virtual bool hasSourcePos() const;
    virtual AbstractHandle::abstract_node* getFileNode() const;
    virtual AbstractHandle::abstract_node* getParent() const;
+   virtual AbstractHandle::abstract_node* findNode(std::string construct_type_str, AbstractHandle::specifier mspecifier) const;
    virtual std::string getFileName() const;
    virtual AbstractHandle::source_position getStartPos() const;
    virtual std::string toString() const;
    virtual size_t getNumbering( const abstract_node*  another_node) const;
    virtual bool operator == (const abstract_node & x) const;
+   //Additional stuff
+   std::vector<MyLoop*> getChildren() const {return mNode->children;};
 protected:
   MyLoop* mNode;
 };
@@ -48,11 +51,11 @@
   virtual bool operator == (const abstract_node & x) const;
 
   //Additional stuff
-  void setMLoops(std::vector<MyLoop*>* myloops ){mLoops = myloops;}
-  std::vector<MyLoop*>* getMLoops() const {return mLoops;}
+  void setMLoops(std::vector<MyLoop*> myloops ){mLoops = myloops;}
+  std::vector<MyLoop*> getMLoops() const {return mLoops;}
 
 protected:
   std::string mfileName;
-  std::vector<MyLoop*>* mLoops;
+  std::vector<MyLoop*> mLoops;
 };
 #endif

Modified: branches/rice/src/midend/abstractHandle/makefile-myloop
===================================================================
--- branches/rice/src/midend/abstractHandle/makefile-myloop	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/abstractHandle/makefile-myloop	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,11 +1,11 @@
 testMyLoop:testMyLoop.o abstract_handle.o loopAdapter.o
 	g++ -o testMyLoop testMyLoop.o abstract_handle.o loopAdapter.o
 testMyLoop.o:testMyLoop.cpp myloop.h abstract_handle.h loopAdapter.h 
-	g++ -c testMyLoop.cpp
+	g++ -c -g testMyLoop.cpp
 abstract_handle.o:abstract_handle.cpp abstract_handle.h 
-	g++ -c abstract_handle.cpp
+	g++ -c -g abstract_handle.cpp
 loopAdapter.o:myloop.h loopAdapter.cpp loopAdapter.h 
-	g++ -c loopAdapter.cpp
+	g++ -c -g loopAdapter.cpp
 
 clean:
 	rm -rf *.o testMyLoop

Modified: branches/rice/src/midend/abstractHandle/myloop.h
===================================================================
--- branches/rice/src/midend/abstractHandle/myloop.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/abstractHandle/myloop.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,17 +1,19 @@
 /*
  * A toy loop data structure demonstrating a thin client of abstract handles:
- * A simplest loop tool which keeps a flat list of loop information in a file
+ * A simplest loop tool which keeps a tree of loops in a file
  */
 #ifndef my_loop_INCLUDED
 #define my_loop_INCLUDED
 
 #include <string>
+#include <vector>
 class MyLoop 
 {
 public:  
   std::string sourceFileName;
   size_t line_number;
-  std::string loop_code;
+  std::vector<MyLoop*> children; 
+  MyLoop* parent;
 };
 
 #endif

Modified: branches/rice/src/midend/abstractHandle/testMyLoop.cpp
===================================================================
--- branches/rice/src/midend/abstractHandle/testMyLoop.cpp	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/abstractHandle/testMyLoop.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -10,32 +10,36 @@
 
 int main()
 {
-  // declare and init a list of loops using MyLoop  
+  //-------------Preparing the internal loop representation---------
+  // declare and initialize a list of loops using MyLoop  
+  // The loop tool should be able to generate its representation from 
+  // source code somehow. We fill it up manually here. 
   vector <MyLoop* > loops;
 
-  MyLoop loop1, loop2;
-
+  MyLoop loop1, loop2, loop3;
   loop1.sourceFileName="file1.c";
   loop1.line_number = 7;
-  loop1.loop_code = "for (i=0;i<100;i++) \n a[i]=0;";
-
+  loop1.parent = NULL;
   loop2.sourceFileName="file1.c";
-  loop2.line_number = 12;
-  loop2.loop_code = "for (i=0;i<100;i++) \n b[i]=0;";
-
+  loop2.line_number = 8;
+  loop2.parent=&loop1;
+  loop1.children.push_back(&loop2);
+  loop3.sourceFileName="file1.c";
+  loop3.line_number = 12;
+  loop3.parent=NULL;
   loops.push_back(&loop1);
-  loops.push_back(&loop2);
+  loops.push_back(&loop3);
 
+  //------------------ using abstract handles-------------
   //Generate the abstract handle  for the source file
   fileNode* filenode = new fileNode("file1.c");
-  filenode->setMLoops(&loops);
- 
+  filenode->setMLoops(loops);
   abstract_handle* file_handle = new abstract_handle(filenode);
   cout<<"Created a file handle:"<<endl<<file_handle->toString()<<endl;
 
-  //Create a loop handle within the file
+  //Create a loop handle within the file using numbering info.
   abstract_node* loop_node1= new loopNode(&loop1);
-  abstract_handle* loop_handle1= new abstract_handle(loop_node1);
+  abstract_handle* loop_handle1= new abstract_handle(loop_node1,e_numbering,file_handle);
   cout<<"Created a loop handle:"<<endl<<loop_handle1->toString()<<endl;
 
   //Create another loop handle within a file using its source position information
@@ -43,5 +47,10 @@
   abstract_handle* loop_handle2= new abstract_handle(file_handle,input1); 
   cout<<"Created a loop handle:"<<endl<<loop_handle2->toString()<<endl;
 
+  //Create yet another loop handle within a loop using its relative numbering information
+  string input2("ForStatement<numbering,1>");
+  abstract_handle* loop_handle3= new abstract_handle(loop_handle1,input2); 
+  cout<<"Created a loop handle:"<<endl<<loop_handle3->toString()<<endl;
+
   return 0;
 }

Modified: branches/rice/src/midend/astProcessing/AstDOTGeneration.C
===================================================================
--- branches/rice/src/midend/astProcessing/AstDOTGeneration.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/astProcessing/AstDOTGeneration.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -144,6 +144,75 @@
           nodeoption="color=\"orange\" ";
         }
      string nodelabel=string("\\n")+node->sage_class_name();
+
+  // DQ (10/29/2008): Added some support for additional output of internal names for specific IR nodes.
+  // In generall there are long list of these IR nodes in the binary and this helps make some sense of 
+  // the lists (sections, symbols, etc.).
+     SgAsmExecutableFileFormat* binaryFileFormatNode = isSgAsmExecutableFileFormat(node);
+     if (binaryFileFormatNode != NULL)
+        {
+       // The case of binary file format IR nodes can be especially confusing so we want the 
+       // default to output some more specific information for some IR nodes (e.g. sections).
+          string name;
+          SgAsmGenericSection* genericSection = isSgAsmGenericSection(node);
+          if (genericSection != NULL)
+             {
+               SgAsmGenericString* genericString = genericSection->get_name();
+               ROSE_ASSERT(genericString != NULL);
+
+               name = genericString->get_string();
+             }
+
+          SgAsmGenericSymbol* genericSymbol = isSgAsmGenericSymbol(node);
+          if (genericSymbol != NULL)
+             {
+               SgAsmGenericString* genericString = genericSymbol->get_name();
+               ROSE_ASSERT(genericString != NULL);
+
+               name = genericString->get_string();
+
+               if (name.empty() == true)
+                    name = "no_name_for_symbol";
+             }
+
+          SgAsmGenericDLL* genericDLL = isSgAsmGenericDLL(node);
+          if (genericDLL != NULL)
+             {
+               SgAsmGenericString* genericString = genericDLL->get_name();
+               ROSE_ASSERT(genericString != NULL);
+
+               name = genericString->get_string();
+             }
+
+          SgAsmPEImportHintName* peImportHintName = isSgAsmPEImportHintName(node);
+          if (peImportHintName != NULL)
+             {
+            // This does not use a SgAsmGenericString, at least not yet!
+               name = peImportHintName->get_name();
+             }
+
+#if 0
+       // This might not be the best way to implement this, since we want to detect common base classes of IR nodes.
+          switch (node->variantT())
+             {
+               case V_SgAsmElfSection:
+                  {
+                    SgAsmElfSection* n = isSgAsmElfSection(node);
+                    name = n->get_name();
+                    break;
+                  }
+
+               default:
+                  {
+                 // No additional information is suggested for the default case!
+                  }
+             }
+#endif
+
+          if (name.empty() == false)
+               nodelabel += string("\\n") + name;
+        }
+
      nodelabel += additionalNodeInfo(node);
 
   // DQ (11/1/2003) added mechanism to add additional options (to add color, etc.)

Modified: branches/rice/src/midend/astRewriteMechanism/rewriteMidLevelInterfaceTemplatesImpl.h
===================================================================
--- branches/rice/src/midend/astRewriteMechanism/rewriteMidLevelInterfaceTemplatesImpl.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/astRewriteMechanism/rewriteMidLevelInterfaceTemplatesImpl.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -333,7 +333,11 @@
 
   // We need the lifetime to be extended beyond that of this function (to avoid purify error)
   // SgFile transformationAST (transformation_argc,transformation_argv,errorCode);
-     SgSourceFile* transformationASTPointer = new SgSourceFile (transformation_argv,errorCode, 0, project);
+     //AS(10/04/08) Because it is hard to get all the initializations correct without doing determine file type we now require the
+     //calling of the constructor directly to create the AST
+  //   SgSourceFile* transformationASTPointer = new SgSourceFile (transformation_argv,errorCode, 0, project);
+     SgSourceFile* transformationASTPointer = isSgSourceFile(determineFileType(transformation_argv, errorCode, project));
+
      ROSE_ASSERT (transformationASTPointer != NULL);
      ROSE_ASSERT (errorCode <= 2);
 
@@ -407,6 +411,7 @@
   // specification via strings.
      NodeCollectionType dataCollection = synthesizedAttribute.treeFragementListArray;
 
+
   // Error checking
      bool notAnEmptyContainer = false;
      for (unsigned int i=0; i < dataCollection.size(); i++)
@@ -414,8 +419,12 @@
           if (dataCollection[i].size() > 0)
                notAnEmptyContainer = true;
         }
-     ROSE_ASSERT (notAnEmptyContainer == true);
 
+    
+     std::cout << "AST NODE " << astNode->class_name() << std::endl;
+     
+     ROSE_ASSERT (notAnEmptyContainer == true || isSgUnknownFile(astNode) != NULL );
+
      return dataCollection;
    }
 

Modified: branches/rice/src/midend/astUtil/astInterface/AstInterface.C
===================================================================
--- branches/rice/src/midend/astUtil/astInterface/AstInterface.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/astUtil/astInterface/AstInterface.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -625,7 +625,10 @@
 
   // Build the AST
   // std::cerr << "generating declaration: \n";
-     SgSourceFile* addDecls = new SgSourceFile(argv, error);
+     //SgSourceFile* addDecls = new SgSourceFile(argv, error);
+     //AS (10/04/08) using factory function to determine file type. This is due to
+     //cleanup of ROSE code
+     SgSourceFile* addDecls = isSgSourceFile(determineFileType(argv,error,0));
   // std::cerr << "Finished generating declaration \n";
 
   // system( "rm _astInterface_Tmp.c");
@@ -1761,6 +1764,8 @@
   return true;
 }
 
+//! Check if _s is an array access.
+//If so, store array name in array, and subscripts into index[], Liao 11/5/2008
 bool AstInterface::
 IsArrayAccess( const AstNodePtr& _s, AstNodePtr* array, AstNodeList* index)
 {

Modified: branches/rice/src/midend/binaryAnalyses/RoseBin_FlowAnalysis.h
===================================================================
--- branches/rice/src/midend/binaryAnalyses/RoseBin_FlowAnalysis.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/binaryAnalyses/RoseBin_FlowAnalysis.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -32,6 +32,16 @@
     }
 };
 
+class FindSgFunctionsVisitor: public std::binary_function<SgNode*, std::vector<SgFunctionDeclaration *>* , void* >
+{
+  public:
+    void* operator()(first_argument_type node, std::vector<SgFunctionDeclaration*>* insns ) const{
+      if (isSgFunctionDeclaration(node)) insns->push_back(isSgFunctionDeclaration(node));
+      return NULL;
+    }
+};
+
+
 class FindInstructionsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmInstruction *>* , void* >
 {
  public:
@@ -50,7 +60,7 @@
   }
 };
 
-class FindStatementsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmStatement *>* , void* >
+class FindAsmStatementsVisitor: public std::binary_function<SgNode*, std::vector<SgAsmStatement *>* , void* >
 {
  public:
   void* operator()(first_argument_type node, std::vector<SgAsmStatement*>* insns ) const{
@@ -59,6 +69,28 @@
   }
 };
 
+class FindStatementsVisitor: public std::binary_function<SgNode*, std::vector<SgStatement *>* , void* >
+{
+ public:
+  void* operator()(first_argument_type node, std::vector<SgStatement*>* insns ) const{
+    if (isSgStatement(node)) 
+      //      if (!isSgStatement(node)->get_file_info()->isCompilerGenerated())
+	insns->push_back(isSgStatement(node));
+	//}
+    return NULL;
+  }
+};
+
+class FindNodeVisitor: public std::binary_function<SgNode*, std::vector<SgLocatedNode *>* , void* >
+{
+ public:
+  void* operator()(first_argument_type node, std::vector<SgLocatedNode*>* insns ) const{
+    if (isSgNode(node)) 
+      insns->push_back(isSgLocatedNode(node));
+    return NULL;
+  }
+};
+
 // ************************************************************************************
 
 

Modified: branches/rice/src/midend/loopProcessing/depGraph/DepGraphBuild.h
===================================================================
--- branches/rice/src/midend/loopProcessing/depGraph/DepGraphBuild.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/loopProcessing/depGraph/DepGraphBuild.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -38,6 +38,7 @@
   const DomainCond& GetStmtDomain( LoopTransformInterface &fa, const AstNodePtr& s) 
      { return impl.GetStmtInfo(fa, s).domain; }
 
+  //! Compute the dependence (one of type set t) between two statements: n1 and n2
   void ComputeStmtDep(LoopTransformInterface &fa,const StmtNodeInfo& n1, const StmtNodeInfo& n2, int t);
   void ComputeDataDep(LoopTransformInterface &fa, const StmtNodeInfo& n1,
                       const StmtNodeInfo& n2, DepType t = DEPTYPE_ALL);

Modified: branches/rice/src/midend/loopProcessing/depInfo/DepInfo.C
===================================================================
--- branches/rice/src/midend/loopProcessing/depInfo/DepInfo.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/loopProcessing/depInfo/DepInfo.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -6,15 +6,18 @@
 class DepEDDTypeInfo : public DepInfoImpl
 {
   DepType t;
+  DepType st; //Supplementary information when t ==SCALAR_DEP or SCALAR_BACK_DEP
  public:
   DepEDDTypeInfo( DepType _t, int dim1, int dim2, bool p, int cl)
-    : DepInfoImpl( dim1, dim2,p, cl) { t = _t; }
+    : DepInfoImpl( dim1, dim2,p, cl) { t = _t; st = DEPTYPE_NONE; }
   DepEDDTypeInfo( const DepEDDTypeInfo &that) 
     : DepInfoImpl( that ) { t = that.t; }
   virtual ~DepEDDTypeInfo() {}
   virtual DepInfoImpl* Clone() const { return new DepEDDTypeInfo(*this); }
 
   virtual DepType GetDepType() const { return t; }
+  virtual DepType GetScalarDepType() const { return st; }
+  virtual void SetScalarDepType(DepType s_type) { st=s_type; }
 };
 
 class DepEDDRefInfo : public DepEDDTypeInfo
@@ -71,9 +74,26 @@
 DepInfo DepInfoGenerator:: 
 GetDepInfo( int nr, int nc, DepType t, const AstNodePtr& srcRef, const AstNodePtr& snkRef,
             bool p, int commLevel)
-  { return ( (t & DEPTYPE_DATA) || (t & DEPTYPE_INPUT) )? 
-                      DepInfo(new DepEDDRefInfo( t, nr, nc, srcRef, snkRef,p, commLevel))
-                     :  DepInfo(new DepEDDTypeInfo(t, nr, nc, p, commLevel)) ; }
+  {
+    DepInfo result;
+    if ( (t & DEPTYPE_DATA) || (t & DEPTYPE_INPUT) )
+    {
+      result= DepInfo(new DepEDDRefInfo( t, nr, nc, srcRef, snkRef,p, commLevel));
+    }
+    else
+    {
+      result= DepInfo(new DepEDDTypeInfo(t, nr, nc, p, commLevel)) ; 
+    }
+#if 0    
+    // Provide extra information for DEPTYPE_SCALAR and DEPTYPE_BACKSCALAR
+    if  ( (t & DEPTYPE_SCALAR) || (t & DEPTYPE_BACKSCALAR) )
+    {  // how to tell read/write access ??
+       if (srcRef == snkRef) // OUTPUT dependence for scalars
+          result.SetScalarDepType(DEPTYPE_OUTPUT);
+    }
+#endif    
+    return result;
+  }
 
 std::string DepType2String(DepType t) 
 {
@@ -100,6 +120,8 @@
   out << rows() << "*" << cols()<<" ";
   out << DepType2String(GetDepType()) << " commonlevel = " << CommonLevel() << " ";
   out << "CarryLevel = "<<CarryLevel()<< " ";
+  if ((GetDepType()==DEPTYPE_SCALAR)||(GetDepType()==DEPTYPE_BACKSCALAR))
+    out<< "Scalar dep type "<<DepType2String(GetScalarDepType()) ;
   if (is_precise()) 
       out << " Is precise ";
   out << AstToString(SrcRef())<<getAstLocation(SrcRef())<<"->" << AstToString(SnkRef())<<getAstLocation(SnkRef())<<" ";
@@ -444,8 +466,12 @@
     }
   }
   if (minLevel < 0) {
+    //Adjustment for DEPTYPE_BACKSCALAR. It must be loop-carried dependence
+    //For DEPTYPE_SCALAR with two same references to a variable, it also must be loop-carried dependence
      if (GetDepType() == DEPTYPE_BACKSCALAR)
         minLevel = maxLevel = num-1;
+     else if (GetScalarDepType() == DEPTYPE_OUTPUT)
+        minLevel = maxLevel = num-1;
      else
         minLevel = num;
   }

Modified: branches/rice/src/midend/loopProcessing/depInfo/DepInfo.h
===================================================================
--- branches/rice/src/midend/loopProcessing/depInfo/DepInfo.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/loopProcessing/depInfo/DepInfo.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -12,11 +12,22 @@
 #include <iostream>
 
 
-typedef enum { DEPTYPE_NONE = 0, DEPTYPE_TRUE = 1, DEPTYPE_ANTI = 2,
-               DEPTYPE_OUTPUT = 4, DEPTYPE_SCALAR = 8, DEPTYPE_BACKSCALAR = 16,
-               DEPTYPE_INPUT = 32, DEPTYPE_ARRAY = 39, 
-               DEPTYPE_IO = 64, DEPTYPE_DATA = 95, DEPTYPE_CTRL = 128, DEPTYPE_BACKCTRL = 256,
-               DEPTYPE_ALL = 479, DEPTYPE_TRANS = 512} DepType;
+typedef enum { 
+  DEPTYPE_NONE = 0,       // B00000000
+  DEPTYPE_TRUE = 1,       // B00000001
+  DEPTYPE_ANTI = 2,       // B00000010   
+  DEPTYPE_OUTPUT = 4,     // B00000100
+  DEPTYPE_SCALAR = 8,     // B00001000
+  DEPTYPE_BACKSCALAR = 16,// B00010000
+  DEPTYPE_INPUT = 32,     // B00100000
+  DEPTYPE_ARRAY = 39,     // B00100111  //union of true, anti, output, input dependencies
+  DEPTYPE_IO = 64,        // B01000000
+  DEPTYPE_DATA = 95,      // B01011111 //union of array, scalar/backscalar,IO,w/o input
+  DEPTYPE_CTRL = 128,     // B10000000
+  DEPTYPE_BACKCTRL = 256, //B1 00000000
+  DEPTYPE_ALL = 479,      //B1 11011111 //All but input dependence
+  DEPTYPE_TRANS = 512    //B10 00000000
+} DepType;
 std::string DepType2String( DepType t);
 typedef enum {DEP_SRC = 1, DEP_SINK = 2, DEP_SRC_SINK = 3} DepDirection;
 
@@ -51,6 +62,10 @@
    virtual DepInfoImpl* Clone() const 
      { return new DepInfoImpl(*this); }
    virtual DepType GetDepType() const { return DEPTYPE_NONE; }
+   // Liao, 11/4/2008. Additional information for SCALAR_DEP and SCALAR_BACK_DEP
+   // Reuse DEPTYPE_TRUE, DEPTYPE_ANTI, DEPTYPE_OUTPUT etc for them
+   virtual DepType GetScalarDepType() const { return DEPTYPE_NONE; }
+   virtual void SetScalarDepType(DepType st) {}
    virtual AstNodePtr SrcRef() const { return AST_NULL; }
    virtual AstNodePtr SnkRef() const { return AST_NULL; }
 
@@ -81,6 +96,16 @@
   int cols() const { return (ConstPtr() == 0)? 0 : ConstRef().cols(); }
   DepType GetDepType() const  
     { return (ConstPtr()==0)? DEPTYPE_NONE: ConstRef().GetDepType(); }
+    
+  DepType GetScalarDepType() const  
+    { return (ConstPtr()==0)? DEPTYPE_NONE: ConstRef().GetScalarDepType(); }
+  void SetScalarDepType(DepType st)
+    { 
+      if (ConstPtr()==0) 
+        return;
+      else 
+        NonConstRef().SetScalarDepType(st); 
+    }
   AstNodePtr SrcRef() const { return (ConstPtr()==0)?AST_NULL:ConstRef().SrcRef(); }
   AstNodePtr SnkRef() const { return (ConstPtr()==0)?AST_NULL:ConstRef().SnkRef(); }
   int CommonLevel() const { return  (ConstPtr()==0)?-1:ConstRef().CommonLevel(); }
@@ -138,6 +163,7 @@
 DepInfo Reverse( const DepInfo &d);
 DepInfo Closure( const DepInfo &d);
 
+//! A builder for DepInfo
 class DepInfoGenerator
 {
  public:

Modified: branches/rice/src/midend/loopProcessing/depInfo/DepInfoAnal.C
===================================================================
--- branches/rice/src/midend/loopProcessing/depInfo/DepInfoAnal.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/loopProcessing/depInfo/DepInfoAnal.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -19,6 +19,11 @@
 extern DepTestStatistics DepStats;
 #endif
 
+//Liao, 11/5/2008
+//Support extra dependence type information for DEPTYPE_SCALAR and DEPTYPE_BACKSCALAR
+//This global variable is used to store the temp type t, which gets discarded 
+//when calling ComputeGlobalScalarDep() and ComputePrivateScalarDep()
+static DepType scalar_dep_type = DEPTYPE_NONE;
 
 extern bool DebugDep();
 
@@ -50,6 +55,8 @@
       return col(n.first);
    }
 };
+//! Analyze variable references within a statement n, put read and write references
+// into two sets (rRefs and wRefs)
 bool AnalyzeStmtRefs(LoopTransformInterface &la, const AstNodePtr& n, 
                       CollectObject<AstNodePtr> &wRefs, 
                       CollectObject<AstNodePtr> &rRefs)
@@ -76,6 +83,7 @@
   return result;
 }
 
+//This is indeed a static function within this file, pos =1 (inDeps) or -1 (outDeps)
 DepInfo ComputePrivateDep( LoopTransformInterface &la, DepInfoAnal& anal,
                           const DepInfoAnal::StmtRefDep& ref, 
                           DepType t, int pos)
@@ -83,7 +91,7 @@
      const DepInfoAnal::LoopDepInfo& info1 = anal.GetStmtInfo(la, ref.r1.stmt);
      const DepInfoAnal::LoopDepInfo& info2 = anal.GetStmtInfo(la, ref.r2.stmt);
      int dim1 = info1.domain.NumOfLoops(), dim2 = info2.domain.NumOfLoops();
-
+     //Return default DepInfo if no common loops and pos <=0
      if (! ref.commLevel && pos <= 0)
        return DepInfo();
      DepInfo result=DepInfoGenerator::GetDepInfo( dim1, dim2, t, 
@@ -100,6 +108,25 @@
      }
      info2.domain.RestrictDepInfo( result, DEP_SINK);
      info1.domain.RestrictDepInfo( result, DEP_SRC);
+
+    //Extra info. for DEPTYPE_SCALAR and DEPTYPE_BACKSCALAR
+    if( ((result.GetDepType()==DEPTYPE_SCALAR) ||(result.GetDepType()==DEPTYPE_BACKSCALAR))
+      &&(scalar_dep_type!=DEPTYPE_NONE) )
+    {
+      if (pos>0) // inDeps
+        result.SetScalarDepType(scalar_dep_type);
+       else   //outDeps, reverse type 
+       {
+         if (scalar_dep_type==DEPTYPE_TRUE)
+           result.SetScalarDepType(DEPTYPE_ANTI);
+         else if (scalar_dep_type==DEPTYPE_ANTI)
+           result.SetScalarDepType(DEPTYPE_TRUE);
+         else if (scalar_dep_type==DEPTYPE_OUTPUT)
+           result.SetScalarDepType(DEPTYPE_INPUT);
+         else if (scalar_dep_type==DEPTYPE_INPUT)
+           result.SetScalarDepType(DEPTYPE_OUTPUT);
+       }
+    }
      return result;
   }
       
@@ -181,17 +208,18 @@
     assert(!info.IsTop());
     return info;
 }
-
 void DepInfoAnal :: 
 ComputePrivateScalarDep( LoopTransformInterface &fa, const StmtRefDep& ref,
                              DepInfoCollect &outDeps, DepInfoCollect &inDeps)
 {
    DepType t1 = DEPTYPE_SCALAR, t2 = DEPTYPE_BACKSCALAR;
+   // has common loops, or references involve two different variables
    if (ref.commLevel > 0 || ref.r1.ref != ref.r2.ref) {
      DepInfo d = ComputePrivateDep( fa, *this, ref, t1, 1);
      assert(!d.IsTop());
      outDeps(d);
    }
+   // has common loops and references involve two different variables
    if ( ref.commLevel > 0 && ref.r1.ref != ref.r2.ref) {
       StmtRefDep ref2(ref.r2, ref.r1, ref.commLoop, ref.commLevel);
       DepInfo d1 = ComputePrivateDep( fa, *this, ref2, t2, -1);
@@ -547,7 +575,7 @@
                              &r.commLevel);
   return r;
 }
-
+// t should be DEPTYPE_IO here
 void DepInfoAnal ::
 ComputeIODep(LoopTransformInterface &fa,  
              const AstNodePtr& s1,  const AstNodePtr& s2,
@@ -580,7 +608,6 @@
   }
 }
 
-
 void ComputeRefSetDep( DepInfoAnal& anal, LoopTransformInterface &la, 
                        DepInfoAnal::StmtRefDep& ref,
                        DoublyLinkedListWrap<AstNodePtr> *rs1, 
@@ -610,7 +637,11 @@
            else if (b1 || b2) 
                anal.ComputeGlobalScalarDep( la, ref, outDeps, inDeps);
            else 
+           {   
+               scalar_dep_type = t;
                anal.ComputePrivateScalarDep( la, ref, outDeps, inDeps);
+               scalar_dep_type = DEPTYPE_NONE; 
+           }
        }
        else if ( la.IsAliasedRef( r1, r2)) {
           anal.ComputeGlobalScalarDep( la, ref, outDeps, inDeps); 
@@ -646,6 +677,7 @@
 {
   DoublyLinkedListWrap<AstNodePtr> rRef1, wRef1, rRef2, wRef2;
   CollectDoublyLinkedList<AstNodePtr> crRef1(rRef1),cwRef1(wRef1),crRef2(rRef2),cwRef2(wRef2);
+
   if (!AnalyzeStmtRefs(fa, s1, cwRef1, crRef1) || 
         (s1 != s2 && !AnalyzeStmtRefs(fa, s2, cwRef2, crRef2))) {
        if (DebugDep())

Modified: branches/rice/src/midend/loopProcessing/depInfo/DepInfoAnal.h
===================================================================
--- branches/rice/src/midend/loopProcessing/depInfo/DepInfoAnal.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/midend/loopProcessing/depInfo/DepInfoAnal.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -70,6 +70,8 @@
                       const AstNodePtr& s1,  const AstNodePtr& s2,
                       DepInfoCollect &outDeps, DepInfoCollect &inDeps, 
                       DepType t = DEPTYPE_CTRL);
+  //! Compute all possible data dependencies among two references n1, n2 
+  //Store n1->n2 dependences in outDeps, n2->n1 oens int inDeps
   void ComputeDataDep( LoopTransformInterface &la, 
                       const AstNodePtr& n1,  const AstNodePtr& n2,
                       DepInfoCollect &outDeps, DepInfoCollect &inDeps, 
@@ -93,7 +95,8 @@
     DepInfo ComputeArrayDep(LoopTransformInterface &fa, DepInfoAnal& anal,
                        const DepInfoAnal::StmtRefDep& ref, DepType deptype);
 };
-
+//! Analyze variable references within a statement n, put read and write references
+// into two sets (rRefs and wRefs)
 bool AnalyzeStmtRefs(LoopTransformInterface &la, const AstNodePtr& n,
                       CollectObject<AstNodePtr> &wRefs, 
                       CollectObject<AstNodePtr> &rRefs);

Modified: branches/rice/src/util/support/CountRefHandle.h
===================================================================
--- branches/rice/src/util/support/CountRefHandle.h	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/src/util/support/CountRefHandle.h	2008-11-11 22:06:33 UTC (rev 119)
@@ -27,6 +27,8 @@
   
  protected:
    const T* ConstPtr() const { return obj;}
+   //We do want to modify obj in rare case
+   T* NonConstPtr() const { return obj;}
    T* UpdatePtr()
     { if (RefCount() > 1) {
         DecreaseUse();
@@ -37,6 +39,7 @@
      }
 
    const T& ConstRef() const { return *obj; }
+   T& NonConstRef() const { return *obj; }
    T& UpdateRef() { return *UpdatePtr(); }
 
  public:

Modified: branches/rice/tests/CompileTests/Makefile.am
===================================================================
--- branches/rice/tests/CompileTests/Makefile.am	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/tests/CompileTests/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -10,7 +10,7 @@
      C_tests C99_tests UPC_tests Cxx_tests C_subset_of_Cxx_tests \
      Fortran_tests copyAST_tests RoseExample_tests PythonExample_tests \
      colorAST_tests mergeAST_tests unparseToString_tests \
-     sourcePosition_tests \
+     sourcePosition_tests OpenMP_tests \
      OpenMP_C_tests boost_tests virtualCFG_tests uninitializedField_tests \
      A++Tests OvertureCode P++Tests A++Code ElsaTestCases \
      ExpressionTemplateExample_tests hiddenTypeAndDeclarationListTests

Copied: branches/rice/tests/CompileTests/OpenMP_tests (from rev 117, trunk/tests/CompileTests/OpenMP_tests)

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/3loops.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/3loops.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/3loops.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,19 +0,0 @@
-#include <stdio.h>
-#if defined (_OPENMP)
-#include <omp.h>
-#endif
-
-int main(void)
-{
-int i,jj,kkk;
-double a[10][9][8];
-
-#pragma omp parallel for
-for(i=0;i<10;i++){
- for(jj=0;jj<9;jj++){
-   for (kkk=0;kkk<8;kkk++){
-      a[i][jj][kkk]=9.9;
-      printf("a[%d][%d][%d]=%f ",i,jj,kkk,a[i][jj][kkk]);
-  } }}
-
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/3loops.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/3loops.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/3loops.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/3loops.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#if defined (_OPENMP)
+#include <omp.h>
+#endif
+
+int main(void)
+{
+int i,jj,kkk;
+double a[10][9][8];
+
+#pragma omp parallel for
+for(i=0;i<10;i++){
+ for(jj=0;jj<9;jj++){
+   for (kkk=0;kkk<8;kkk++){
+      a[i][jj][kkk]=9.9;
+      printf("a[%d][%d][%d]=%f ",i,jj,kkk,a[i][jj][kkk]);
+  } }}
+
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/Makefile.am
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/Makefile.am	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,107 +0,0 @@
-include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs
-
-noinst_PROGRAMS = parseOmp
-parseOmp_SOURCES = parseOmp.C
-
-INCLUDES = $(ROSE_INCLUDES)
-LDADD    = $(LIBS_WITH_RPATH) $(ROSE_LIBS)
-
-C_TESTCODES_REQUIRED_TO_PASS = \
-	3loops.c \
-	atomic.c \
-	collapse.c \
-	copyin.c \
-	copyprivate2.c \
-	copyprivate3.c \
-	copyprivate.c \
-	critical.c \
-	critical_dead.c \
-	critical_orphaned.c \
-	dynamicChunk.c \
-	empty.c \
-	expressions.c \
-	falsesharing.c \
-	firstlastprivate.c \
-	flush.c \
-	get_max_threads.c \
-	hello.c \
-	hello-ordered.c \
-	lastprivate0.c \
-	lastprivate.c \
-	limits_threads.c \
-	lockarray.c \
-	lu_factorization.c \
-	masterSingle.c \
-	matrix_vector.c \
-	nestedpar1.c \
-	nestedpar.c \
-	omp1.c \
-	ompfor.c \
-	ordered2.c \
-	ordered.c \
-	orphaned-directives.c \
-	parallel.c \
-	parallelfor.c \
-	private.c \
-	privatej.c \
-	recursive.c \
-	reduction2.c \
-	reduction.c \
-	section.c \
-	set_num_threads.c \
-	single_copyprivate.c \
-	spmd1.c \
-	staticChunk.c \
-	subteam2.c \
-	subteam.c \
-	task_largenumber.c \
-	task_orphaned.c \
-	task_untied.c \
-	task_underIf.c \
-	task_wait.c \
-	threadprivate2.c \
-	threadprivate3.c \
-	threadprivate.c \
-	threadProcessor.c \
-	variables.c
-
-CXX_TESTCODES_REQUIRED_TO_PASS = \
-	task_link.cpp \
-	task_tree.cpp 
-
-TESTCODE_CURRENTLY_FAILING =  
-
-ROSE_FLAGS = -rose:openmp --edg:no_warnings -w -rose:verbose 0 --edg:restrict
-# used to find omp.h, added it as one of  rose headers
-TESTCODE_INCLUDES = ${ROSE_INCLUDES}
-
-PASSING_C_TEST_Objects = ${C_TESTCODES_REQUIRED_TO_PASS:.c=.o}
-
-PASSING_CXX_TEST_Objects = ${CXX_TESTCODES_REQUIRED_TO_PASS:.cpp=.o}
-
-$(PASSING_C_TEST_Objects): parseOmp $(srcdir)/$(@:.o=.c)
-	./parseOmp ${ROSE_FLAGS} ${TESTCODE_INCLUDES} -c $(srcdir)/$(@:.o=.c)
-
-$(PASSING_CXX_TEST_Objects): parseOmp $(srcdir)/$(@:.o=.cpp)
-	./parseOmp ${ROSE_FLAGS} ${TESTCODE_INCLUDES} -c $(srcdir)/$(@:.o=.cpp)
-
-ALL_TESTCODES = \
-${C_TESTCODES_REQUIRED_TO_PASS} \
-${CXX_TESTCODES_REQUIRED_TO_PASS} \
-${TESTCODE_CURRENTLY_FAILING}
-
-
-check-local:
-	@echo "Test for ROSE OpenMP Parser."
-	@$(MAKE) $(PASSING_C_TEST_Objects) 
-	@$(MAKE) $(PASSING_CXX_TEST_Objects)
-	@echo "***********************************************************************************************************"
-	@echo "****** ROSE/tests/CompileTests/OpenMP_tests: make check rule complete (terminated normally) ******"
-	@echo "***********************************************************************************************************"
-
-EXTRA_DIST = $(ALL_TESTCODES) README
-
-clean-local:
-	rm -f *.o rose_*.* *.out
-	rm -rf QMTest
-	

Copied: branches/rice/tests/CompileTests/OpenMP_tests/Makefile.am (from rev 117, trunk/tests/CompileTests/OpenMP_tests/Makefile.am)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/Makefile.am	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/Makefile.am	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,107 @@
+include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs
+
+noinst_PROGRAMS = parseOmp
+parseOmp_SOURCES = parseOmp.C
+
+INCLUDES = $(ROSE_INCLUDES)
+LDADD    = $(LIBS_WITH_RPATH) $(ROSE_LIBS)
+
+C_TESTCODES_REQUIRED_TO_PASS = \
+	3loops.c \
+	atomic.c \
+	collapse.c \
+	copyin.c \
+	copyprivate2.c \
+	copyprivate3.c \
+	copyprivate.c \
+	critical.c \
+	critical_dead.c \
+	critical_orphaned.c \
+	dynamicChunk.c \
+	empty.c \
+	expressions.c \
+	falsesharing.c \
+	firstlastprivate.c \
+	flush.c \
+	get_max_threads.c \
+	hello.c \
+	hello-ordered.c \
+	lastprivate0.c \
+	lastprivate.c \
+	limits_threads.c \
+	lockarray.c \
+	lu_factorization.c \
+	masterSingle.c \
+	matrix_vector.c \
+	nestedpar1.c \
+	nestedpar.c \
+	omp1.c \
+	ompfor.c \
+	ordered2.c \
+	ordered.c \
+	orphaned-directives.c \
+	parallel.c \
+	parallelfor.c \
+	private.c \
+	privatej.c \
+	recursive.c \
+	reduction2.c \
+	reduction.c \
+	section.c \
+	set_num_threads.c \
+	single_copyprivate.c \
+	spmd1.c \
+	staticChunk.c \
+	subteam2.c \
+	subteam.c \
+	task_largenumber.c \
+	task_orphaned.c \
+	task_untied.c \
+	task_underIf.c \
+	task_wait.c \
+	threadprivate2.c \
+	threadprivate3.c \
+	threadprivate.c \
+	threadProcessor.c \
+	variables.c
+
+CXX_TESTCODES_REQUIRED_TO_PASS = \
+	task_link.cpp \
+	task_tree.cpp 
+
+TESTCODE_CURRENTLY_FAILING =  
+
+ROSE_FLAGS = -rose:openmp --edg:no_warnings -w -rose:verbose 0 --edg:restrict
+# used to find omp.h, added it as one of  rose headers
+TESTCODE_INCLUDES = ${ROSE_INCLUDES}
+
+PASSING_C_TEST_Objects = ${C_TESTCODES_REQUIRED_TO_PASS:.c=.o}
+
+PASSING_CXX_TEST_Objects = ${CXX_TESTCODES_REQUIRED_TO_PASS:.cpp=.o}
+
+$(PASSING_C_TEST_Objects): parseOmp $(srcdir)/$(@:.o=.c)
+	./parseOmp ${ROSE_FLAGS} ${TESTCODE_INCLUDES} -c $(srcdir)/$(@:.o=.c)
+
+$(PASSING_CXX_TEST_Objects): parseOmp $(srcdir)/$(@:.o=.cpp)
+	./parseOmp ${ROSE_FLAGS} ${TESTCODE_INCLUDES} -c $(srcdir)/$(@:.o=.cpp)
+
+ALL_TESTCODES = \
+${C_TESTCODES_REQUIRED_TO_PASS} \
+${CXX_TESTCODES_REQUIRED_TO_PASS} \
+${TESTCODE_CURRENTLY_FAILING}
+
+
+check-local:
+	@echo "Test for ROSE OpenMP Parser."
+	@$(MAKE) $(PASSING_C_TEST_Objects) 
+	@$(MAKE) $(PASSING_CXX_TEST_Objects)
+	@echo "***********************************************************************************************************"
+	@echo "****** ROSE/tests/CompileTests/OpenMP_tests: make check rule complete (terminated normally) ******"
+	@echo "***********************************************************************************************************"
+
+EXTRA_DIST = $(ALL_TESTCODES) README
+
+clean-local:
+	rm -f *.o rose_*.* *.out
+	rm -rf QMTest
+	

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/README
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/README	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/README	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,22 +0,0 @@
-This is a project to 
-* use Flex/Bison to parse OpenMP pragmas based on Markus's contributions
-* support the latest OpenMP 3.0 syntax
-* refine the OmpAttribute data structure to separate interface from implementation
-
-File List:
-
-* OpenMP persistent attributes:  OmpAttribute.C and OmpAttribute.h
-  Moved to src/frontend/SageIII
-
-* Flex scanner:   omplexer.ll (omplexer.cc )
-  Bison parser:   ompparser.yy (ompparser.cc, ompparser.h)
-
-  Moved to src/frontend/CxxFrontend/EDG_SAGE_Connection
-
-* test parser:    parseOmp.C 
-
-By Liao, 9/19/2008
-Latest modified: 10/28/2008
-
-
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/README (from rev 117, trunk/tests/CompileTests/OpenMP_tests/README)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/README	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/README	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,22 @@
+This is a project to 
+* use Flex/Bison to parse OpenMP pragmas based on Markus's contributions
+* support the latest OpenMP 3.0 syntax
+* refine the OmpAttribute data structure to separate interface from implementation
+
+File List:
+
+* OpenMP persistent attributes:  OmpAttribute.C and OmpAttribute.h
+  Moved to src/frontend/SageIII
+
+* Flex scanner:   omplexer.ll (omplexer.cc )
+  Bison parser:   ompparser.yy (ompparser.cc, ompparser.h)
+
+  Moved to src/frontend/CxxFrontend/EDG_SAGE_Connection
+
+* test parser:    parseOmp.C 
+
+By Liao, 9/19/2008
+Latest modified: 10/28/2008
+
+
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/atomic.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/atomic.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/atomic.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,13 +0,0 @@
-#include <omp.h>
-
-int main (void)
-{
-
-int a;
-#pragma omp parallel 
-{
-#pragma omp atomic
-  a+=1;
-}
-
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/atomic.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/atomic.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/atomic.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/atomic.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,13 @@
+#include <omp.h>
+
+int main (void)
+{
+
+int a;
+#pragma omp parallel 
+{
+#pragma omp atomic
+  a+=1;
+}
+
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/collapse.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/collapse.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/collapse.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,14 +0,0 @@
-/* Based on OMP 3.0 A.10 Example A.10.1
- */
-void foo()
-{
-  int j,k;
-  int jlast, klast;
-#pragma omp parallel for private(j,k), collapse(2), lastprivate (jlast, klast)
-  for (k=1;k<=100;k++)
-    for (j=1;j<=100;j++)
-    {
-      jlast = j;
-      klast = k;
-    } 
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/collapse.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/collapse.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/collapse.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/collapse.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,14 @@
+/* Based on OMP 3.0 A.10 Example A.10.1
+ */
+void foo()
+{
+  int j,k;
+  int jlast, klast;
+#pragma omp parallel for private(j,k), collapse(2), lastprivate (jlast, klast)
+  for (k=1;k<=100;k++)
+    for (j=1;j<=100;j++)
+    {
+      jlast = j;
+      klast = k;
+    } 
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/copyin.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/copyin.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/copyin.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,33 +0,0 @@
-/*
-test for copyin 
-*/
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif 
-
-float x;
-int y;
-struct s_zi
-{
-  int id;
-  char name[20];
-  float height;
-};
-
-struct s_zi z={123,"hello",1.75};
-
-#pragma omp threadprivate(x,y,z)
-
-int main (int argc, char * argv[])
-{
-    x=1555.0;
-    y=765;
-#pragma omp parallel copyin(x,y,z)
-  {
- printf("x=%f, y=%d,z.name=%s\n",x,y,z.name);
-  }
-
-  return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/copyin.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/copyin.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/copyin.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/copyin.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,33 @@
+/*
+test for copyin 
+*/
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif 
+
+float x;
+int y;
+struct s_zi
+{
+  int id;
+  char name[20];
+  float height;
+};
+
+struct s_zi z={123,"hello",1.75};
+
+#pragma omp threadprivate(x,y,z)
+
+int main (int argc, char * argv[])
+{
+    x=1555.0;
+    y=765;
+#pragma omp parallel copyin(x,y,z)
+  {
+ printf("x=%f, y=%d,z.name=%s\n",x,y,z.name);
+  }
+
+  return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/copyprivate.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/copyprivate.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/copyprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,32 +0,0 @@
-/*
-A variable is both threadprivate and copyprivate.
-*/
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif 
-float x=0.0;
-int y=0;
-#pragma omp threadprivate(x,y)
- 
-void init ()
-{
-  #pragma omp single copyprivate(x,y)
-  {
-    x=1.0;
-    y=1;
-  }
- printf("x=%f, y=%d\n",x,y);
-}
- 
-int main (int argc, char * argv[])
-{
-#ifdef _OPENMP
-omp_set_num_threads(4);
-#endif
-#pragma omp parallel
-  {
-    init ();
-  }
-  return 0;
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/copyprivate.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/copyprivate.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/copyprivate.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/copyprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,32 @@
+/*
+A variable is both threadprivate and copyprivate.
+*/
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif 
+float x=0.0;
+int y=0;
+#pragma omp threadprivate(x,y)
+ 
+void init ()
+{
+  #pragma omp single copyprivate(x,y)
+  {
+    x=1.0;
+    y=1;
+  }
+ printf("x=%f, y=%d\n",x,y);
+}
+ 
+int main (int argc, char * argv[])
+{
+#ifdef _OPENMP
+omp_set_num_threads(4);
+#endif
+#pragma omp parallel
+  {
+    init ();
+  }
+  return 0;
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/copyprivate2.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/copyprivate2.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/copyprivate2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,25 +0,0 @@
-/*single and copyprivate*/
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif 
- 
- 
-int main (int argc, char * argv[])
-{
-float x=0.0;
-int y=0;
-#ifdef _OPENMP
-omp_set_num_threads(4);
-#endif
-#pragma omp parallel private(x,y)
-  {
-  #pragma omp single copyprivate(x,y)
-  {
-    x=546.0;
-    y=777;
-  }
- printf("x=%f, y=%d\n",x,y);
-  }
-  return 0;
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/copyprivate2.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/copyprivate2.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/copyprivate2.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/copyprivate2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,25 @@
+/*single and copyprivate*/
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif 
+ 
+ 
+int main (int argc, char * argv[])
+{
+float x=0.0;
+int y=0;
+#ifdef _OPENMP
+omp_set_num_threads(4);
+#endif
+#pragma omp parallel private(x,y)
+  {
+  #pragma omp single copyprivate(x,y)
+  {
+    x=546.0;
+    y=777;
+  }
+ printf("x=%f, y=%d\n",x,y);
+  }
+  return 0;
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/copyprivate3.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/copyprivate3.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/copyprivate3.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,38 +0,0 @@
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif
-
-#define LOOPCOUNT 100
-
-int main(void)
-{
-  int result = 0;
-  int nr_iterations = 0;
-  int i;
-  int j;
-
-#pragma omp parallel private(i,j)
-  {
-    for (i = 0; i < LOOPCOUNT; i++)
-      {
-#pragma omp single copyprivate(j)
-        {
-          nr_iterations++;
-          j = i;
-        }
-        /*      #pragma omp barrier */
-#pragma omp critical
-        {
-          result = result + j - i;
-        }
-#pragma omp barrier
-      }                         /* end of for */
-
-  }                             /* end of parallel */
-
- printf("result=%d nr_iterations=%d\n",result, nr_iterations);
-  return (result == 0) && (nr_iterations == LOOPCOUNT);
-}
-
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/copyprivate3.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/copyprivate3.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/copyprivate3.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/copyprivate3.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,38 @@
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+#define LOOPCOUNT 100
+
+int main(void)
+{
+  int result = 0;
+  int nr_iterations = 0;
+  int i;
+  int j;
+
+#pragma omp parallel private(i,j)
+  {
+    for (i = 0; i < LOOPCOUNT; i++)
+      {
+#pragma omp single copyprivate(j)
+        {
+          nr_iterations++;
+          j = i;
+        }
+        /*      #pragma omp barrier */
+#pragma omp critical
+        {
+          result = result + j - i;
+        }
+#pragma omp barrier
+      }                         /* end of for */
+
+  }                             /* end of parallel */
+
+ printf("result=%d nr_iterations=%d\n",result, nr_iterations);
+  return (result == 0) && (nr_iterations == LOOPCOUNT);
+}
+
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/critical.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/critical.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/critical.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,15 +0,0 @@
-#include <omp.h>
-
-int main (void)
-{
-
-int a=0,b=0;
-#pragma omp parallel 
-{
-#pragma omp critical (aaa)
-  a=a+1;
-#pragma omp critical (bbb)
-  b=b+1;
-}
-
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/critical.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/critical.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/critical.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/critical.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,15 @@
+#include <omp.h>
+
+int main (void)
+{
+
+int a=0,b=0;
+#pragma omp parallel 
+{
+#pragma omp critical (aaa)
+  a=a+1;
+#pragma omp critical (bbb)
+  b=b+1;
+}
+
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/critical_dead.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/critical_dead.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/critical_dead.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,20 +0,0 @@
-int counter = 0;
-void foo()
-{
-#pragma omp critical
-  {
-if (counter <100)
-   counter++;
-else 
-  return;
-//    foo();
- }
-  foo();
-}
-
-int main()
-{
- foo();
-  return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/critical_dead.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/critical_dead.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/critical_dead.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/critical_dead.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,20 @@
+int counter = 0;
+void foo()
+{
+#pragma omp critical
+  {
+if (counter <100)
+   counter++;
+else 
+  return;
+//    foo();
+ }
+  foo();
+}
+
+int main()
+{
+ foo();
+  return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/critical_orphaned.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/critical_orphaned.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/critical_orphaned.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,15 +0,0 @@
-int counter = 0;
-int foo()
-{
-#pragma omp critical
-  {
-  counter++;
- }
-return 0; 
-}
-
-int main()
-{
- foo();
-  return 0;
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/critical_orphaned.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/critical_orphaned.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/critical_orphaned.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/critical_orphaned.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,15 @@
+int counter = 0;
+int foo()
+{
+#pragma omp critical
+  {
+  counter++;
+ }
+return 0; 
+}
+
+int main()
+{
+ foo();
+  return 0;
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/dynamicChunk.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/dynamicChunk.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/dynamicChunk.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include <omp.h>
-int main(void)
-{
-double a[1000];
-  int i;
-int n;
-scanf("%d",&n);
-#pragma omp for schedule(dynamic,50)
-  for (i=0;i<n;i++)
-   {
-    a[i]=(double)i/2.0;
-   }
-printf("a[878]=%f\n",a[878]);
-
-
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/dynamicChunk.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/dynamicChunk.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/dynamicChunk.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/dynamicChunk.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <omp.h>
+int main(void)
+{
+double a[1000];
+  int i;
+int n;
+scanf("%d",&n);
+#pragma omp for schedule(dynamic,50)
+  for (i=0;i<n;i++)
+   {
+    a[i]=(double)i/2.0;
+   }
+printf("a[878]=%f\n",a[878]);
+
+
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/empty.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/empty.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/empty.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,28 +0,0 @@
-/*
-1. how to include header
-2. parallel region
-3. runtime routine
-4. undeterminated execution order
-5. control number of threads
-
-By C. Liao
-*/
-#include <stdio.h>
-
-#ifdef _OPENMP
-#include <omp.h>
-#endif
-
-void main(void)
-{
-int i=0;
-
-#pragma omp parallel 
-{
-#ifdef _OPENMP
- i=omp_get_thread_num();
-#endif
- printf("Hello,world! I am thread %d\n",i);
-}
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/empty.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/empty.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/empty.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/empty.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,28 @@
+/*
+1. how to include header
+2. parallel region
+3. runtime routine
+4. undeterminated execution order
+5. control number of threads
+
+By C. Liao
+*/
+#include <stdio.h>
+
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+void main(void)
+{
+int i=0;
+
+#pragma omp parallel 
+{
+#ifdef _OPENMP
+ i=omp_get_thread_num();
+#endif
+ printf("Hello,world! I am thread %d\n",i);
+}
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/expressions.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/expressions.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/expressions.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,28 +0,0 @@
-/* some simple expressions */
-void foo()
-{
-int i;
-#pragma omp task if (99)
-i=i++;
-
-#pragma omp task if (i)
-i=i++;
-
-#pragma omp task if (i=0)
-i=i++;
-
-#pragma omp task if (i+=0)
-i=i++;
-
-#pragma omp task if (i==0)
-i=i++;
-
-#pragma omp task if (i!=0)
-i=i++;
-
-#pragma omp task if (i<0)
-i=i++;
-
-#pragma omp task if (i>0)
-i=i++;
-} 

Copied: branches/rice/tests/CompileTests/OpenMP_tests/expressions.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/expressions.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/expressions.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/expressions.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,28 @@
+/* some simple expressions */
+void foo()
+{
+int i;
+#pragma omp task if (99)
+i=i++;
+
+#pragma omp task if (i)
+i=i++;
+
+#pragma omp task if (i=0)
+i=i++;
+
+#pragma omp task if (i+=0)
+i=i++;
+
+#pragma omp task if (i==0)
+i=i++;
+
+#pragma omp task if (i!=0)
+i=i++;
+
+#pragma omp task if (i<0)
+i=i++;
+
+#pragma omp task if (i>0)
+i=i++;
+} 

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/falsesharing.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/falsesharing.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/falsesharing.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,24 +0,0 @@
-#include <stdio.h>
-#include <omp.h>
-static long num_steps = 100000; 
-double step;
-#define NUM_THREADS 20
-
-void main ()
-{	  int i;
-	  int id;
- 	  double x, pi, sum[NUM_THREADS];
-	  step = 1.0/(double) num_steps;
-	  omp_set_num_threads(NUM_THREADS);
-#pragma omp parallel 
-{
-	  id = omp_get_thread_num();
-	  for (i=id, sum[id]=0.0;i< num_steps; i=i+NUM_THREADS){
-		  x = (i+0.5)*step;
-		  sum[id] += 4.0/(1.0+x*x);
-	  }
-}
-	  for(i=0, pi=0.0;i<NUM_THREADS;i++)pi += sum[i] * step;
-     printf("PI=%f\n",pi);
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/falsesharing.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/falsesharing.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/falsesharing.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/falsesharing.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <omp.h>
+static long num_steps = 100000; 
+double step;
+#define NUM_THREADS 20
+
+void main ()
+{	  int i;
+	  int id;
+ 	  double x, pi, sum[NUM_THREADS];
+	  step = 1.0/(double) num_steps;
+	  omp_set_num_threads(NUM_THREADS);
+#pragma omp parallel 
+{
+	  id = omp_get_thread_num();
+	  for (i=id, sum[id]=0.0;i< num_steps; i=i+NUM_THREADS){
+		  x = (i+0.5)*step;
+		  sum[id] += 4.0/(1.0+x*x);
+	  }
+}
+	  for(i=0, pi=0.0;i<NUM_THREADS;i++)pi += sum[i] * step;
+     printf("PI=%f\n",pi);
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/firstlastprivate.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/firstlastprivate.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/firstlastprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,40 +0,0 @@
-#include <stdio.h>
-#include <omp.h>
-#include <sys/times.h>
-#include <time.h>
-
-#ifndef CLK_TCK
-#define CLK_TCK 60
-#endif
-
-
-double get_seconds() /*routine to read time*/
-{
-  struct tms rusage;
-  times(&rusage);
-  return (double) (rusage.tms_utime)/CLK_TCK;
-}
-
-
-int main()
-{
-  int i,sum=0;
-  int num_steps=10000000;
-  double sec0, sec;
-
-
-  sec=0.0;
-  sec0=get_seconds();
-  omp_set_num_threads(4);
-
-#pragma omp parallel for firstprivate (sum) lastprivate (sum)
-for(i=1;i<=num_steps;i++)
-{
-  sum=sum + i;
-}
- sec=sec+(get_seconds() -sec0);
- printf("sum of %d = %d  spent time:%f seconds\n",num_steps,sum, sec);
-
- return 1;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/firstlastprivate.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/firstlastprivate.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/firstlastprivate.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/firstlastprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,40 @@
+#include <stdio.h>
+#include <omp.h>
+#include <sys/times.h>
+#include <time.h>
+
+#ifndef CLK_TCK
+#define CLK_TCK 60
+#endif
+
+
+double get_seconds() /*routine to read time*/
+{
+  struct tms rusage;
+  times(&rusage);
+  return (double) (rusage.tms_utime)/CLK_TCK;
+}
+
+
+int main()
+{
+  int i,sum=0;
+  int num_steps=10000000;
+  double sec0, sec;
+
+
+  sec=0.0;
+  sec0=get_seconds();
+  omp_set_num_threads(4);
+
+#pragma omp parallel for firstprivate (sum) lastprivate (sum)
+for(i=1;i<=num_steps;i++)
+{
+  sum=sum + i;
+}
+ sec=sec+(get_seconds() -sec0);
+ printf("sum of %d = %d  spent time:%f seconds\n",num_steps,sum, sec);
+
+ return 1;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/flush.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/flush.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/flush.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,17 +0,0 @@
-int
-main (void)
-{
-  int a = 1, b=2;
-#pragma omp parallel if (a) num_threads(4)
-  {
-#pragma omp flush    
-    if (a != 0)
-      {
-#pragma omp flush(a,b)
-      }
-    if (a != 0)
-      {
-#pragma omp barrier
-      }
-  }
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/flush.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/flush.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/flush.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/flush.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,17 @@
+int
+main (void)
+{
+  int a = 1, b=2;
+#pragma omp parallel if (a) num_threads(4)
+  {
+#pragma omp flush    
+    if (a != 0)
+      {
+#pragma omp flush(a,b)
+      }
+    if (a != 0)
+      {
+#pragma omp barrier
+      }
+  }
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/get_max_threads.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/get_max_threads.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/get_max_threads.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif
-
-int main(void)
-{
-int i=0;
-#pragma omp parallel 
-{
-#ifdef _OPENMP
- i=omp_get_max_threads();
-#endif
- printf("Hello,world! I am thread %d\n",i);
-}
-return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/get_max_threads.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/get_max_threads.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/get_max_threads.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/get_max_threads.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+int main(void)
+{
+int i=0;
+#pragma omp parallel 
+{
+#ifdef _OPENMP
+ i=omp_get_max_threads();
+#endif
+ printf("Hello,world! I am thread %d\n",i);
+}
+return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/hello-ordered.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/hello-ordered.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/hello-ordered.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,15 +0,0 @@
-#include <stdio.h>
-#if defined(_OPENMP)
-#include <omp.h>
-#endif
-
-int main(void)
-{
-int i;
-#pragma omp parallel for ordered
-for (i=0;i<100;i++)
-{
-#pragma omp ordered  
-  printf("%2d,Hello,world.!\n",i);
-}
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/hello-ordered.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/hello-ordered.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/hello-ordered.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/hello-ordered.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#if defined(_OPENMP)
+#include <omp.h>
+#endif
+
+int main(void)
+{
+int i;
+#pragma omp parallel for ordered
+for (i=0;i<100;i++)
+{
+#pragma omp ordered  
+  printf("%2d,Hello,world.!\n",i);
+}
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/hello.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/hello.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/hello.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,28 +0,0 @@
-/*
-1. how to include header
-2. parallel region
-3. runtime routine
-4. undeterminated execution order
-5. control number of threads
-
-By C. Liao
-*/
-#include <stdio.h>
-
-#ifdef _OPENMP
-#include <omp.h>
-#endif
-
-int main(void)
-{
-int i=0;
-#pragma omp parallel default(shared)
-{
-#ifdef _OPENMP
- i=omp_get_thread_num();
-#endif
- printf("Hello,world! I am thread %d\n",i);
-}
-return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/hello.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/hello.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/hello.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/hello.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,28 @@
+/*
+1. how to include header
+2. parallel region
+3. runtime routine
+4. undeterminated execution order
+5. control number of threads
+
+By C. Liao
+*/
+#include <stdio.h>
+
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+int main(void)
+{
+int i=0;
+#pragma omp parallel default(shared)
+{
+#ifdef _OPENMP
+ i=omp_get_thread_num();
+#endif
+ printf("Hello,world! I am thread %d\n",i);
+}
+return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/lastprivate.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/lastprivate.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/lastprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,16 +0,0 @@
-#include <omp.h>
-#define n 100
-int a[n];
-int main()
-{
-  int i,j;
-  j = 0;
-  #pragma omp parallel for lastprivate(j)
-   for(i=1; i<=n; i++){
-      if(i == 1 || i == n)
-         j = j + 1;
-      a[i] = a[i] + j;
-   }
-}
-
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/lastprivate.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/lastprivate.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/lastprivate.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/lastprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,16 @@
+#include <omp.h>
+#define n 100
+int a[n];
+int main()
+{
+  int i,j;
+  j = 0;
+  #pragma omp parallel for lastprivate(j)
+   for(i=1; i<=n; i++){
+      if(i == 1 || i == n)
+         j = j + 1;
+      a[i] = a[i] + j;
+   }
+}
+
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/lastprivate0.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/lastprivate0.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/lastprivate0.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,42 +0,0 @@
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif
-int main(void)
-{
-int i,is=0;
-
-#pragma omp parallel for private(is)
-for (i=0;i<100;i++)
-  is = is+i;
-printf("%d=%d\n ",i,is);
-
-is=0;
-
-#pragma omp parallel for firstprivate(is)
-for (i=0;i<100;i++)
-  is = is+i;
-printf("%d=%d\n ",i,is);
-
-is=0;
-
-#pragma omp parallel for lastprivate(is)
-for (i=0;i<100;i++)
-  is = is+i;
-printf("%d=%d\n ",i,is);
-
-is=0;
-
-//#pragma omp parallel for lastprivate(is)
-#pragma omp parallel for schedule(static,30) firstprivate(is) lastprivate(is)
-for (i=0;i<100;i++)
-  is = is+i;
-
-/*The value of is depends on the num of threads and schedule method*/
-printf("%d=%d\n ",i,is);
-
-is=0;
-for (i=90;i<100;i++)
-  is = is+i;
-printf("%d=%d\n ",i,is);
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/lastprivate0.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/lastprivate0.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/lastprivate0.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/lastprivate0.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,42 @@
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+int main(void)
+{
+int i,is=0;
+
+#pragma omp parallel for private(is)
+for (i=0;i<100;i++)
+  is = is+i;
+printf("%d=%d\n ",i,is);
+
+is=0;
+
+#pragma omp parallel for firstprivate(is)
+for (i=0;i<100;i++)
+  is = is+i;
+printf("%d=%d\n ",i,is);
+
+is=0;
+
+#pragma omp parallel for lastprivate(is)
+for (i=0;i<100;i++)
+  is = is+i;
+printf("%d=%d\n ",i,is);
+
+is=0;
+
+//#pragma omp parallel for lastprivate(is)
+#pragma omp parallel for schedule(static,30) firstprivate(is) lastprivate(is)
+for (i=0;i<100;i++)
+  is = is+i;
+
+/*The value of is depends on the num of threads and schedule method*/
+printf("%d=%d\n ",i,is);
+
+is=0;
+for (i=90;i<100;i++)
+  is = is+i;
+printf("%d=%d\n ",i,is);
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/limits_threads.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/limits_threads.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/limits_threads.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,28 +0,0 @@
-/*
-1. how to include header
-2. parallel region
-3. runtime routine
-4. undeterminated execution order
-5. control number of threads
-
-By C. Liao
-*/
-#include <stdio.h>
-
-#ifdef _OPENMP
-#include <omp.h>
-#endif
-
-int main(void)
-{
-int i=0;
-#pragma omp parallel 
-{
-#ifdef _OPENMP
- i=omp_get_thread_num();
-#endif
- printf("Hello,world! I am thread %d\n",i);
-}
-return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/limits_threads.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/limits_threads.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/limits_threads.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/limits_threads.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,28 @@
+/*
+1. how to include header
+2. parallel region
+3. runtime routine
+4. undeterminated execution order
+5. control number of threads
+
+By C. Liao
+*/
+#include <stdio.h>
+
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+int main(void)
+{
+int i=0;
+#pragma omp parallel 
+{
+#ifdef _OPENMP
+ i=omp_get_thread_num();
+#endif
+ printf("Hello,world! I am thread %d\n",i);
+}
+return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/lockarray.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/lockarray.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/lockarray.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,75 +0,0 @@
-/*
-test fine grained locks instead of critical section
-by Chunhua Liao
-*/
-#include <stdio.h>
-
-#ifdef __OPENMP
-#include <omp.h>
-#define LOCKNUM 100
-#endif
-
-#define SIZE 5000
-int main(void)
-{
-int a[SIZE];
-int i,j,sum,lock_index;
-
-#ifdef __OPENMP
-  omp_lock_t lck[LOCKNUM];
-  for (i=0;i<LOCKNUM;i++)
-    omp_init_lock(&(lck[i]));
-#endif
-
-for (i=0;i<SIZE;i++)
-  a[i]=0;
-
-#pragma omp parallel private (i,j,lock_index)
- {
-
-/*critical version*/
-
-#pragma omp for schedule(dynamic,1)
-    for (i=0;i<SIZE;i++)
-  {
-    j=(i*i)%SIZE;
-  #pragma omp critical
-     {
-      a[j]=a[j]+5;
-     }
-   }
-
-/* fine grained lock version*/
-
-#pragma omp for schedule(dynamic,1)
-    for (i=0;i<SIZE;i++)
-   {
-     j=(i*i)%SIZE;
-#ifdef __OPENMP
-      lock_index= j%LOCKNUM; 
-//    omp_set_lock(lck[lock_index]);
-#endif
-      a[j]=a[j]-5;
-#ifdef __OPENMP
-//    omp_unset_lock(lck[lock_index]);
-#endif
-   }
-
-/*verify the result*/
-   sum=0;
-#pragma omp for reduction (+:sum)
-    for (i=0;i<SIZE;i++)
-   {
-    sum+=a[i];
-   }
-
- }
-
-/* destroy locks*/
-#ifdef __OPENMP
-for (i=0;i<LOCKNUM;i++)
-  omp_destroy_lock(&(lck[i]));
-#endif
-printf("sum of a[] = %d\n",sum);
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/lockarray.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/lockarray.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/lockarray.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/lockarray.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,75 @@
+/*
+test fine grained locks instead of critical section
+by Chunhua Liao
+*/
+#include <stdio.h>
+
+#ifdef __OPENMP
+#include <omp.h>
+#define LOCKNUM 100
+#endif
+
+#define SIZE 5000
+int main(void)
+{
+int a[SIZE];
+int i,j,sum,lock_index;
+
+#ifdef __OPENMP
+  omp_lock_t lck[LOCKNUM];
+  for (i=0;i<LOCKNUM;i++)
+    omp_init_lock(&(lck[i]));
+#endif
+
+for (i=0;i<SIZE;i++)
+  a[i]=0;
+
+#pragma omp parallel private (i,j,lock_index)
+ {
+
+/*critical version*/
+
+#pragma omp for schedule(dynamic,1)
+    for (i=0;i<SIZE;i++)
+  {
+    j=(i*i)%SIZE;
+  #pragma omp critical
+     {
+      a[j]=a[j]+5;
+     }
+   }
+
+/* fine grained lock version*/
+
+#pragma omp for schedule(dynamic,1)
+    for (i=0;i<SIZE;i++)
+   {
+     j=(i*i)%SIZE;
+#ifdef __OPENMP
+      lock_index= j%LOCKNUM; 
+//    omp_set_lock(lck[lock_index]);
+#endif
+      a[j]=a[j]-5;
+#ifdef __OPENMP
+//    omp_unset_lock(lck[lock_index]);
+#endif
+   }
+
+/*verify the result*/
+   sum=0;
+#pragma omp for reduction (+:sum)
+    for (i=0;i<SIZE;i++)
+   {
+    sum+=a[i];
+   }
+
+ }
+
+/* destroy locks*/
+#ifdef __OPENMP
+for (i=0;i<LOCKNUM;i++)
+  omp_destroy_lock(&(lck[i]));
+#endif
+printf("sum of a[] = %d\n",sum);
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/lu_factorization.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/lu_factorization.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/lu_factorization.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,22 +0,0 @@
-//from BikEfficient2001
-//LU-factorization without pivoting
-// outermost loop k is not parallelizable 
-// inner loop i is.
-//
-int main(void)
-{
-  int i,j,k,n=500;
-  double a[n][n];
-  for (k = 0; k < n - 1; k++)
-    {
-      for (i = k + 1; i < n; i++)
-	{
-	  a[i][k] = a[i][k] / a[k][k];
-	  for (j = k + 1; j < n; j++)
-	    a[i][j] = a[i][j] - a[i][k] * a[k][j];
-	}
-    }
-
-  return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/lu_factorization.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/lu_factorization.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/lu_factorization.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/lu_factorization.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,22 @@
+//from BikEfficient2001
+//LU-factorization without pivoting
+// outermost loop k is not parallelizable 
+// inner loop i is.
+//
+int main(void)
+{
+  int i,j,k,n=500;
+  double a[n][n];
+  for (k = 0; k < n - 1; k++)
+    {
+      for (i = k + 1; i < n; i++)
+	{
+	  a[i][k] = a[i][k] / a[k][k];
+	  for (j = k + 1; j < n; j++)
+	    a[i][j] = a[i][j] - a[i][k] * a[k][j];
+	}
+    }
+
+  return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/masterSingle.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/masterSingle.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/masterSingle.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,15 +0,0 @@
-#include <omp.h>
-
-int main (void)
-{
-
-int a,b;
-#pragma omp parallel 
-{
-#pragma omp master
-  a=a+1;
-#pragma omp single
-  b=b+1;
-}
-
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/masterSingle.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/masterSingle.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/masterSingle.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/masterSingle.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,15 @@
+#include <omp.h>
+
+int main (void)
+{
+
+int a,b;
+#pragma omp parallel 
+{
+#pragma omp master
+  a=a+1;
+#pragma omp single
+  b=b+1;
+}
+
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/matrix_vector.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/matrix_vector.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/matrix_vector.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,32 +0,0 @@
-// double-precision floating-point matrix-vector product
-// from BikEfficient2001
-// segmentation fault ???
-// May 30, 2008
-#include <stdio.h>
-#define SIZE 5000
-int
-main ()
-{
-  double d, a[SIZE][SIZE], x[SIZE], y[SIZE];
-  int i,j,n;
-  n=SIZE;
-  for (i = 0; i < n; i++)
-  {
-      y[i]= (double)i*i; 
-      for (j = 0; j < n; j++)
-        a[i][j] = (double)(i/j);
-  }        
-
-  for (i = 0; i < n; i++)
-    {
-      d = 0.0;
-      for (j = 0; j < n; j++)
-	{
-	  d += a[i][j] * y[j];
-	}
-      x[i] = d;
-    }
-  printf("%f\n",x[0]);
-
-  return 0;
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/matrix_vector.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/matrix_vector.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/matrix_vector.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/matrix_vector.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,32 @@
+// double-precision floating-point matrix-vector product
+// from BikEfficient2001
+// segmentation fault ???
+// May 30, 2008
+#include <stdio.h>
+#define SIZE 5000
+int
+main ()
+{
+  double d, a[SIZE][SIZE], x[SIZE], y[SIZE];
+  int i,j,n;
+  n=SIZE;
+  for (i = 0; i < n; i++)
+  {
+      y[i]= (double)i*i; 
+      for (j = 0; j < n; j++)
+        a[i][j] = (double)(i/j);
+  }        
+
+  for (i = 0; i < n; i++)
+    {
+      d = 0.0;
+      for (j = 0; j < n; j++)
+	{
+	  d += a[i][j] * y[j];
+	}
+      x[i] = d;
+    }
+  printf("%f\n",x[0]);
+
+  return 0;
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/nestedpar.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/nestedpar.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/nestedpar.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,25 +0,0 @@
-#include<omp.h>
-#include <stdio.h>
-
-void paroutput(char* s)
-{
-#pragma omp parallel
-printf("%s\n",s);
-}
-
-int main(void)
-{
- #pragma omp parallel
- {
-  paroutput("before single");
-
- #pragma omp single
-  {
-   paroutput("inside single");
-  }
-
-  paroutput("after single");
- }
-}
-
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/nestedpar.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/nestedpar.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/nestedpar.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/nestedpar.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,25 @@
+#include<omp.h>
+#include <stdio.h>
+
+void paroutput(char* s)
+{
+#pragma omp parallel
+printf("%s\n",s);
+}
+
+int main(void)
+{
+ #pragma omp parallel
+ {
+  paroutput("before single");
+
+ #pragma omp single
+  {
+   paroutput("inside single");
+  }
+
+  paroutput("after single");
+ }
+}
+
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/nestedpar1.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/nestedpar1.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/nestedpar1.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,30 +0,0 @@
-#include<omp.h>
-#include <stdio.h>
-
-void paroutput(char* s)
-{
-}
-
-int main(void)
-{
-#ifdef _OPENMP
-   omp_set_nested(1);
-#endif
-
- #pragma omp parallel
- {
-   #pragma omp parallel
-   printf("before single.\n");
-   
- #pragma omp single
-  {
-
-   #pragma omp parallel
-   printf("Inside single.\n");
-  }
-   #pragma omp parallel
-   printf("after single.\n");
- }
-}
-
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/nestedpar1.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/nestedpar1.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/nestedpar1.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/nestedpar1.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,30 @@
+#include<omp.h>
+#include <stdio.h>
+
+void paroutput(char* s)
+{
+}
+
+int main(void)
+{
+#ifdef _OPENMP
+   omp_set_nested(1);
+#endif
+
+ #pragma omp parallel
+ {
+   #pragma omp parallel
+   printf("before single.\n");
+   
+ #pragma omp single
+  {
+
+   #pragma omp parallel
+   printf("Inside single.\n");
+  }
+   #pragma omp parallel
+   printf("after single.\n");
+ }
+}
+
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/omp1.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/omp1.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/omp1.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,20 +0,0 @@
-/*Example to show outlining vs. inlining*/
-
-#ifdef _OPENMP
-#include <omp.h>
-#endif 
-
-void do_sth(int ar1,int ar2, int ar3)
-{
-}
-
-int main(void)
-{
-  int a,b,c;
-
-#pragma omp parallel private(c)
-  do_sth(a,b,c);
-  
-  return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/omp1.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/omp1.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/omp1.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/omp1.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,20 @@
+/*Example to show outlining vs. inlining*/
+
+#ifdef _OPENMP
+#include <omp.h>
+#endif 
+
+void do_sth(int ar1,int ar2, int ar3)
+{
+}
+
+int main(void)
+{
+  int a,b,c;
+
+#pragma omp parallel private(c)
+  do_sth(a,b,c);
+  
+  return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/ompfor.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/ompfor.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/ompfor.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,23 +0,0 @@
-/*
-1. with and without omp for
-2. default loop scheduling: implementation dependent
-*/
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif 
-int a[20];
-int main(void)
-{
-  int i;
-// #pragma omp parallel
-//#pragma omp parallel for schedule(dynamic,2)
-#pragma omp parallel for schedule (auto)
-  for (i=0;i<20;i++)
-   {
-    a[i]=i*2;
-    printf("Iteration %2d is carried out by thread %2d\n",\
-           i, omp_get_thread_num());
-   }
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/ompfor.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/ompfor.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/ompfor.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/ompfor.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,23 @@
+/*
+1. with and without omp for
+2. default loop scheduling: implementation dependent
+*/
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif 
+int a[20];
+int main(void)
+{
+  int i;
+// #pragma omp parallel
+//#pragma omp parallel for schedule(dynamic,2)
+#pragma omp parallel for schedule (auto)
+  for (i=0;i<20;i++)
+   {
+    a[i]=i*2;
+    printf("Iteration %2d is carried out by thread %2d\n",\
+           i, omp_get_thread_num());
+   }
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/ordered.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/ordered.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/ordered.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,17 +0,0 @@
-#include <stdio.h>
-#include <omp.h>
-
-int main (void)
-{
-
-  int i,myval;
-#pragma omp parallel for private(myval) ordered
-   for(i=1; i<=100; i++){
-      myval=i*i; 
-      #pragma omp ordered
-      {
-         printf("%d %d\n", i, myval);
-      }
-   }
-
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/ordered.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/ordered.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/ordered.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/ordered.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <omp.h>
+
+int main (void)
+{
+
+  int i,myval;
+#pragma omp parallel for private(myval) ordered
+   for(i=1; i<=100; i++){
+      myval=i*i; 
+      #pragma omp ordered
+      {
+         printf("%d %d\n", i, myval);
+      }
+   }
+
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/ordered2.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/ordered2.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/ordered2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include <omp.h>
-void main(void)
-{
-int i=0,t_id;
-#pragma omp parallel for ordered private (t_id)
-//#pragma omp parallel for private (t_id)
-for (i=0;i<100;i++)
-{
-t_id= omp_get_thread_num();
-
-#pragma omp ordered
- {
-  printf("I am i=%d in thread %d\n",i,t_id);
- }
-}
-
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/ordered2.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/ordered2.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/ordered2.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/ordered2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <omp.h>
+void main(void)
+{
+int i=0,t_id;
+#pragma omp parallel for ordered private (t_id)
+//#pragma omp parallel for private (t_id)
+for (i=0;i<100;i++)
+{
+t_id= omp_get_thread_num();
+
+#pragma omp ordered
+ {
+  printf("I am i=%d in thread %d\n",i,t_id);
+ }
+}
+
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/orphaned-directives.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/orphaned-directives.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/orphaned-directives.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,27 +0,0 @@
-#include <stdio.h>
-
-#if defined(_OPENMP)
-#include <omp.h>
-#endif /* _OPENMP */
-
-static double a[1000];
-
-static void init(void)
-{
-  int i;
-   i=i+5; 
-#pragma omp for
-  for (i=0;i<1000;i++)
-   {
-    a[i]=(double)i/2.0;
-   }
-}
-
-int main(void){
-
-#pragma omp parallel
- {
-  init();
- }
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/orphaned-directives.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/orphaned-directives.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/orphaned-directives.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/orphaned-directives.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+#if defined(_OPENMP)
+#include <omp.h>
+#endif /* _OPENMP */
+
+static double a[1000];
+
+static void init(void)
+{
+  int i;
+   i=i+5; 
+#pragma omp for
+  for (i=0;i<1000;i++)
+   {
+    a[i]=(double)i/2.0;
+   }
+}
+
+int main(void){
+
+#pragma omp parallel
+ {
+  init();
+ }
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/parallel.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/parallel.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/parallel.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,7 +0,0 @@
-int main(void)
-{
-  int i, a[1000];
-#pragma omp parallel if(i<100)
-    a[i]=i*2;
-return 1;
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/parallel.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/parallel.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/parallel.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/parallel.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,7 @@
+int main(void)
+{
+  int i, a[1000];
+#pragma omp parallel if(i<100)
+    a[i]=i*2;
+return 1;
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/parallelfor.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/parallelfor.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/parallelfor.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,9 +0,0 @@
-#include <omp.h>
-int main(void)
-{
-  int i, a[1000];
-#pragma omp parallel for if(1)
-  for (i=0;i<1000;i++)
-    a[i]=i*2;
-return 1;
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/parallelfor.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/parallelfor.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/parallelfor.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/parallelfor.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,9 @@
+#include <omp.h>
+int main(void)
+{
+  int i, a[1000];
+#pragma omp parallel for if(1)
+  for (i=0;i<1000;i++)
+    a[i]=i*2;
+return 1;
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/parseOmp.C
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/parseOmp.C	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/parseOmp.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,34 +0,0 @@
-/*
- * Parsing OpenMP pragma text
-by Liao, 9/17/2008
-Last Modified: 9/19/2008
-*/
-#include "rose.h"
-#include <iostream>
-#include <string>
-#include "OmpAttribute.h"
-using namespace OmpSupport;
-
-class visitorTraversal : public AstSimpleProcessing
-{
-  protected: 
-    virtual void visit(SgNode* n);
-};
-
-void visitorTraversal::visit(SgNode* node)
-{
-  OmpAttribute* attribute = getOmpAttribute(node);
-  if (attribute)
-    attribute->print();//debug only for now
-}
-
-// must have argc and argv here!!
-int main(int argc, char * argv[])
-
-{
-  SgProject *project = frontend (argc, argv);
-  visitorTraversal myvisitor;
-  myvisitor.traverseInputFiles(project,preorder);
-
-  return backend(project);
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/parseOmp.C (from rev 117, trunk/tests/CompileTests/OpenMP_tests/parseOmp.C)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/parseOmp.C	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/parseOmp.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,34 @@
+/*
+ * Parsing OpenMP pragma text
+by Liao, 9/17/2008
+Last Modified: 9/19/2008
+*/
+#include "rose.h"
+#include <iostream>
+#include <string>
+#include "OmpAttribute.h"
+using namespace OmpSupport;
+
+class visitorTraversal : public AstSimpleProcessing
+{
+  protected: 
+    virtual void visit(SgNode* n);
+};
+
+void visitorTraversal::visit(SgNode* node)
+{
+  OmpAttribute* attribute = getOmpAttribute(node);
+  if (attribute)
+    attribute->print();//debug only for now
+}
+
+// must have argc and argv here!!
+int main(int argc, char * argv[])
+
+{
+  SgProject *project = frontend (argc, argv);
+  visitorTraversal myvisitor;
+  myvisitor.traverseInputFiles(project,preorder);
+
+  return backend(project);
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/private.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/private.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/private.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,25 +0,0 @@
-/*
-*/
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif 
-
-float x;
-int y;
-
-int main (int argc, char * argv[])
-{
-#ifdef _OPENMP
-   omp_set_num_threads(4);
-#endif
-    x=1.0;
-    y=1;
-#pragma omp parallel private(x,y)
-  {
- printf("x=%f, y=%d\n",x,y);
-  }
-
-  return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/private.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/private.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/private.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/private.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,25 @@
+/*
+*/
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif 
+
+float x;
+int y;
+
+int main (int argc, char * argv[])
+{
+#ifdef _OPENMP
+   omp_set_num_threads(4);
+#endif
+    x=1.0;
+    y=1;
+#pragma omp parallel private(x,y)
+  {
+ printf("x=%f, y=%d\n",x,y);
+  }
+
+  return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/privatej.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/privatej.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/privatej.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,25 +0,0 @@
-/*
-What will happen if the loop indices inside an omp for is not private?
-by C. Liao
- */
-#include <stdio.h>
-#ifdef _OPENMP 
-#include <omp.h>
-#endif
-
-int main()
-{
- int a[1000][1000];
- int i,j;
-
- #pragma omp parallel for 
-   for (i=0;i<1000;i++)
-     for (j=0;j<1000;j++)
-       a[i][j]=999;
-
-   for (i=0;i<1000;i++)
-     for (j=0;j<1000;j++)
-       if(a[i][j]!=999) printf("a[%d][%d]!=999\n",i,j);
-  return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/privatej.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/privatej.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/privatej.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/privatej.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,25 @@
+/*
+What will happen if the loop indices inside an omp for is not private?
+by C. Liao
+ */
+#include <stdio.h>
+#ifdef _OPENMP 
+#include <omp.h>
+#endif
+
+int main()
+{
+ int a[1000][1000];
+ int i,j;
+
+ #pragma omp parallel for 
+   for (i=0;i<1000;i++)
+     for (j=0;j<1000;j++)
+       a[i][j]=999;
+
+   for (i=0;i<1000;i++)
+     for (j=0;j<1000;j++)
+       if(a[i][j]!=999) printf("a[%d][%d]!=999\n",i,j);
+  return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/recursive.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/recursive.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/recursive.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,16 +0,0 @@
-int counter = 0;
-int foo()
-{
-#pragma omp critical
-  {
-  counter++;
-  if (counter <100)
-    foo();
- }
-}
-
-int main()
-{
- foo();
-  return 0;
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/recursive.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/recursive.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/recursive.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/recursive.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,16 @@
+int counter = 0;
+int foo()
+{
+#pragma omp critical
+  {
+  counter++;
+  if (counter <100)
+    foo();
+ }
+}
+
+int main()
+{
+ foo();
+  return 0;
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/reduction.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/reduction.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/reduction.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,43 +0,0 @@
-/*
-1. A local copy of reduction variable  is made and initialized depending on the op(e.g. 0 for +).
-2. Compiler finds standard reduction expressions containing op and uses them to update the local copy. 
-3. Local copies are reduced into a single value and combined with the original global value.
-
-*/
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif
-
-int main()
-{
-  int i;
-  long sum=0;
-  int total=100;
-
-#pragma omp parallel for reduction(+:sum)
- for (i=0; i<= total; i++){
-  sum = sum + i;
- }
-
-/******************************************/
-/*
- long sum0;
-#pragma omp parallel private(sum0)
-{
-  sum0=0; 
-
- #pragma omp for private(i)
- for (i=0; i<= total; i++)
-   sum0=sum0+i;
-
- #pragma omp critical
-  sum = sum + sum0; 
-*/
-/******************************************/
-
- printf("sum of 1 to %d = %d\n",total,sum);
-
- return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/reduction.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/reduction.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/reduction.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/reduction.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,43 @@
+/*
+1. A local copy of reduction variable  is made and initialized depending on the op(e.g. 0 for +).
+2. Compiler finds standard reduction expressions containing op and uses them to update the local copy. 
+3. Local copies are reduced into a single value and combined with the original global value.
+
+*/
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+int main()
+{
+  int i;
+  long sum=0;
+  int total=100;
+
+#pragma omp parallel for reduction(+:sum)
+ for (i=0; i<= total; i++){
+  sum = sum + i;
+ }
+
+/******************************************/
+/*
+ long sum0;
+#pragma omp parallel private(sum0)
+{
+  sum0=0; 
+
+ #pragma omp for private(i)
+ for (i=0; i<= total; i++)
+   sum0=sum0+i;
+
+ #pragma omp critical
+  sum = sum + sum0; 
+*/
+/******************************************/
+
+ printf("sum of 1 to %d = %d\n",total,sum);
+
+ return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/reduction2.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/reduction2.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/reduction2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,20 +0,0 @@
-#include <stdio.h>
-#include <omp.h>
-
-#define NUM_THREADS 4
-
-void main ()
-{
- int i,total=1000000;
- double res=0.0;
-
- omp_set_num_threads(NUM_THREADS);
-
- #pragma omp parallel for reduction(+:res) 
- for (i=0; i<= total; i++){
-  res = res + i;
-  res = res - 2*i;
-  }
- 
- printf("the sum of 1000000 is :%.0f\n", res);
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/reduction2.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/reduction2.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/reduction2.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/reduction2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include <omp.h>
+
+#define NUM_THREADS 4
+
+void main ()
+{
+ int i,total=1000000;
+ double res=0.0;
+
+ omp_set_num_threads(NUM_THREADS);
+
+ #pragma omp parallel for reduction(+:res) 
+ for (i=0; i<= total; i++){
+  res = res + i;
+  res = res - 2*i;
+  }
+ 
+ printf("the sum of 1000000 is :%.0f\n", res);
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/section.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/section.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/section.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,34 +0,0 @@
-#include <omp.h>
-#include <assert.h>
-int main(){
-  int sum=7;
-  int known_sum;
-  int i;
-#pragma omp parallel
-  {
-#pragma omp sections reduction(+:sum) private(i)
-    {
-#pragma omp section
-      {
-        for (i=1;i<400;i++){
-          sum += i;
-        }
-      }
-#pragma omp section
-      {
-        for(i=400;i<700;i++)
-          sum += i;
-      }
-#pragma omp section
-      {
-        for(i=700;i<1000;i++)
-           sum += i;
-      }
-
-    }/* end of section reduction.*/
-  }                      /* end of parallel */
-  known_sum=(999*1000)/2+7;
-  assert (known_sum==sum);
-  return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/section.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/section.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/section.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/section.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,34 @@
+#include <omp.h>
+#include <assert.h>
+int main(){
+  int sum=7;
+  int known_sum;
+  int i;
+#pragma omp parallel
+  {
+#pragma omp sections reduction(+:sum) private(i)
+    {
+#pragma omp section
+      {
+        for (i=1;i<400;i++){
+          sum += i;
+        }
+      }
+#pragma omp section
+      {
+        for(i=400;i<700;i++)
+          sum += i;
+      }
+#pragma omp section
+      {
+        for(i=700;i<1000;i++)
+           sum += i;
+      }
+
+    }/* end of section reduction.*/
+  }                      /* end of parallel */
+  known_sum=(999*1000)/2+7;
+  assert (known_sum==sum);
+  return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/set_num_threads.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/set_num_threads.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/set_num_threads.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,27 +0,0 @@
-#include <stdio.h>
-#include <assert.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif
-
-int main(void)
-{
-  int counter=0, nthreads;
-#ifdef _OPENMP
-  omp_set_num_threads(-8);
-#endif  
-  #pragma omp parallel 
-  {
-  #pragma omp critical
-    counter ++;
-    nthreads = omp_get_num_threads();
-  }
-  printf("number threads is:%d\n",nthreads);
-#ifdef _OPENMP
-  assert(counter == 7);
-#else
-  assert (counter ==1 );
-#endif  
-  return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/set_num_threads.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/set_num_threads.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/set_num_threads.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/set_num_threads.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <assert.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+int main(void)
+{
+  int counter=0, nthreads;
+#ifdef _OPENMP
+  omp_set_num_threads(-8);
+#endif  
+  #pragma omp parallel 
+  {
+  #pragma omp critical
+    counter ++;
+    nthreads = omp_get_num_threads();
+  }
+  printf("number threads is:%d\n",nthreads);
+#ifdef _OPENMP
+  assert(counter == 7);
+#else
+  assert (counter ==1 );
+#endif  
+  return 0;
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/single_copyprivate.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/single_copyprivate.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/single_copyprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,73 +0,0 @@
-
-#include <omp.h>
-#include <stdio.h>
-#define LOOPCOUNT 200
-int
-check_single_copyprivate (FILE * logFile)
-{
-  int result = 0;
-  int nr_iterations = 0;
-  int i;
-#pragma omp parallel private(i)
-  {
-    for (i = 0; i < LOOPCOUNT; i++)
-      {
-	int j;
-	/*
-	   int thread;
-	   thread=omp_get_thread_num();
-	 */
-#pragma omp single copyprivate(j)
-	{
-	  nr_iterations++;
-	  j = i;
-	  /*printf("thread %d assigns ,j=%d,i=%d\n",thread,j,i); */
-	}
-	/*      #pragma omp barrier */
-#pragma omp critical
-	{
-	  /*printf("thread=%d,j=%d,i=%d\n",thread,j,i); */
-	  result = result + j - i;
-	}
-#pragma omp barrier
-      }				/* end of for */
-
-  }				/* end of parallel */
-  return (result == 0) && (nr_iterations == LOOPCOUNT);
-}
-
-
-
-int
-crosscheck_single_copyprivate (FILE * logFile)
-{
-  int result = 0;
-  int nr_iterations = 0;
-  int i;
-#pragma omp parallel private(i)
-  {
-    for (i = 0; i < LOOPCOUNT; i++)
-      {
-	int j;
-	/*
-	   int thread;
-	   thread=omp_get_thread_num();
-	 */
-#pragma omp single private(j)
-	{
-	  nr_iterations++;
-	  j = i;
-	  /*printf("thread %d assigns ,j=%d,i=%d\n",thread,j,i); */
-	}
-	/*      #pragma omp barrier */
-#pragma omp critical
-	{
-	  /*printf("thread=%d,j=%d,i=%d\n",thread,j,i); */
-	  result = result + j - i;
-	}
-#pragma omp barrier
-      }				/* end of for */
-
-  }				/* end of parallel */
-  return (result == 0) && (nr_iterations == LOOPCOUNT);
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/single_copyprivate.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/single_copyprivate.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/single_copyprivate.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/single_copyprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,73 @@
+
+#include <omp.h>
+#include <stdio.h>
+#define LOOPCOUNT 200
+int
+check_single_copyprivate (FILE * logFile)
+{
+  int result = 0;
+  int nr_iterations = 0;
+  int i;
+#pragma omp parallel private(i)
+  {
+    for (i = 0; i < LOOPCOUNT; i++)
+      {
+	int j;
+	/*
+	   int thread;
+	   thread=omp_get_thread_num();
+	 */
+#pragma omp single copyprivate(j)
+	{
+	  nr_iterations++;
+	  j = i;
+	  /*printf("thread %d assigns ,j=%d,i=%d\n",thread,j,i); */
+	}
+	/*      #pragma omp barrier */
+#pragma omp critical
+	{
+	  /*printf("thread=%d,j=%d,i=%d\n",thread,j,i); */
+	  result = result + j - i;
+	}
+#pragma omp barrier
+      }				/* end of for */
+
+  }				/* end of parallel */
+  return (result == 0) && (nr_iterations == LOOPCOUNT);
+}
+
+
+
+int
+crosscheck_single_copyprivate (FILE * logFile)
+{
+  int result = 0;
+  int nr_iterations = 0;
+  int i;
+#pragma omp parallel private(i)
+  {
+    for (i = 0; i < LOOPCOUNT; i++)
+      {
+	int j;
+	/*
+	   int thread;
+	   thread=omp_get_thread_num();
+	 */
+#pragma omp single private(j)
+	{
+	  nr_iterations++;
+	  j = i;
+	  /*printf("thread %d assigns ,j=%d,i=%d\n",thread,j,i); */
+	}
+	/*      #pragma omp barrier */
+#pragma omp critical
+	{
+	  /*printf("thread=%d,j=%d,i=%d\n",thread,j,i); */
+	  result = result + j - i;
+	}
+#pragma omp barrier
+      }				/* end of for */
+
+  }				/* end of parallel */
+  return (result == 0) && (nr_iterations == LOOPCOUNT);
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/spmd1.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/spmd1.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/spmd1.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,34 +0,0 @@
-/*
-1. manual control over work sharing
-*/
-#ifdef _OPENMP
-#include <omp.h>
-#endif 
-#include <stdio.h>
-
-#define N 20
-int a[N];
-int main(void)
-{
-  int i;
-  int id, Nthrds, istart, iend;
-#pragma omp parallel private(i,id,Nthrds,istart,iend)
-{
-/* each thread get self ID and total number of threads
-   then decide which portion of work to do
-*/
-  id = omp_get_thread_num();
-  Nthrds = omp_get_num_threads();
-  istart= id* N/ Nthrds;
-  iend = (id+1)*N/Nthrds; 
-
-//  for (i=0;i<20;i++)
-   for (i=istart;i<iend;i++)
-   {
-    a[i]=i*2;
-    printf("Iteration %2d is carried out by thread %2d\n",\
-           i, omp_get_thread_num());
-   }
-}
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/spmd1.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/spmd1.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/spmd1.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/spmd1.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,34 @@
+/*
+1. manual control over work sharing
+*/
+#ifdef _OPENMP
+#include <omp.h>
+#endif 
+#include <stdio.h>
+
+#define N 20
+int a[N];
+int main(void)
+{
+  int i;
+  int id, Nthrds, istart, iend;
+#pragma omp parallel private(i,id,Nthrds,istart,iend)
+{
+/* each thread get self ID and total number of threads
+   then decide which portion of work to do
+*/
+  id = omp_get_thread_num();
+  Nthrds = omp_get_num_threads();
+  istart= id* N/ Nthrds;
+  iend = (id+1)*N/Nthrds; 
+
+//  for (i=0;i<20;i++)
+   for (i=istart;i<iend;i++)
+   {
+    a[i]=i*2;
+    printf("Iteration %2d is carried out by thread %2d\n",\
+           i, omp_get_thread_num());
+   }
+}
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/staticChunk.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/staticChunk.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/staticChunk.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,18 +0,0 @@
-#include <omp.h>
-#include <stdio.h>
-int main(void)
-{
-double a[1000];
-  int i;
-int n;
-scanf("%d",&n);
-#pragma omp for schedule(static)
-  for (i=0;i<n;i++)
-   {
-    a[i]=(double)i/2.0;
-   }
-printf("a[878]=%f\n",a[878]);
-
-
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/staticChunk.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/staticChunk.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/staticChunk.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/staticChunk.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,18 @@
+#include <omp.h>
+#include <stdio.h>
+int main(void)
+{
+double a[1000];
+  int i;
+int n;
+scanf("%d",&n);
+#pragma omp for schedule(static)
+  for (i=0;i<n;i++)
+   {
+    a[i]=(double)i/2.0;
+   }
+printf("a[878]=%f\n",a[878]);
+
+
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/subteam.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/subteam.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/subteam.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,38 +0,0 @@
-#include <stdio.h>
-
-#if defined(_OPENMP)
-#include <omp.h>
-#endif /* _OPENMP */
-
-#define NUMELEMENT 10000000
-static double a[NUMELEMENT];
-
-static void init(void)
-{
-  int i,j,k;
-   i=i+5; 
-/*assume onthread 1,3 */
-#pragma omp for
-  for (i=0;i<NUMELEMENT;i++)
-   {
-    a[i]=(double)i/2.0;
-    a[i]=(double)i/2.0;
-    a[i]=(double)i/2.0;
-    a[i]=(double)i/2.0;
-   }
-/*default team, on all threads*/
-#pragma omp single 
-  {
-    j=omp_get_thread_num();
-   printf("I am the single one: %d\n",j );
-  }
-}
-
-int main(void){
-
-#pragma omp parallel
- {
-  init();
- }
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/subteam.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/subteam.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/subteam.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/subteam.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,38 @@
+#include <stdio.h>
+
+#if defined(_OPENMP)
+#include <omp.h>
+#endif /* _OPENMP */
+
+#define NUMELEMENT 10000000
+static double a[NUMELEMENT];
+
+static void init(void)
+{
+  int i,j,k;
+   i=i+5; 
+/*assume onthread 1,3 */
+#pragma omp for
+  for (i=0;i<NUMELEMENT;i++)
+   {
+    a[i]=(double)i/2.0;
+    a[i]=(double)i/2.0;
+    a[i]=(double)i/2.0;
+    a[i]=(double)i/2.0;
+   }
+/*default team, on all threads*/
+#pragma omp single 
+  {
+    j=omp_get_thread_num();
+   printf("I am the single one: %d\n",j );
+  }
+}
+
+int main(void){
+
+#pragma omp parallel
+ {
+  init();
+ }
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/subteam2.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/subteam2.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/subteam2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,86 +0,0 @@
-/* test two omp for loops in two subteams
- and a single thread in the 3rd subteam
-*/ 
-#include <stdio.h>
-#include <stdlib.h>
-
-#if defined(_OPENMP)
-#include <omp.h>
-#endif /* _OPENMP */
-
-/*by Liao, new data types and functions to support thread subteams*/
-/*compiler generated new data type to store thread ids in a subteam*/
-
-typedef struct{
-   int iCount;
-   int *iThreadIds;
-} omp_id_set_t;
-omp_id_set_t idSet1,idSet2,idSet3;
-
-extern int __ompc_is_in_idset();
-extern void __ompc_subteam_create();
-void *subteam1, *subteam2, *subteam3; /*use it as &threadsubteam*/
-
-#define NUMELEMENT 100
-
-int main(void){
-
-  int a[NUMELEMENT];
-  int i,j=0,k,sum=0,sum2=0;
-
-/* assume 5 threads */
-#ifdef _OPENMP
-  omp_set_num_threads(5);
-#endif
-/* manual code to generate the thread subteams' ID sets currently */
-/*stuff code to get ids from the thread ids in the subteam*/
- idSet1.iCount=2;
- idSet1.iThreadIds=(int *)malloc(2*sizeof(int));
- idSet1.iThreadIds[0]=1;
- idSet1.iThreadIds[1]=3;
-
- idSet2.iCount=2;
- idSet2.iThreadIds=(int *)malloc(2*sizeof(int));
- idSet2.iThreadIds[0]=0;
- idSet2.iThreadIds[1]=2;
-
- idSet3.iCount=1;
- idSet3.iThreadIds=(int *)malloc(1*sizeof(int));
- idSet3.iThreadIds[0]=1;
-
-
-#pragma omp parallel
- {
-/* onthreads(0,2) */
-#pragma omp for reduction(+:sum)
-  for (i=1;i<=NUMELEMENT;i++)
-   {
-     sum = sum +i;
-   }
-
-/* onthreads(1,3) */
-#pragma omp for schedule(dynamic,5)
-  for (i=0;i<NUMELEMENT;i++)
-   {
-    a[i]=9;
-   }
-
-/* onthread 4 */
-#pragma omp single 
-  {
-#ifdef _OPENMP
-    j=omp_get_thread_num();
-#endif
-   printf("I am the single one: %d\n",j );
-  }
- }/*end of parallel */
-
-/*------verify results---------------*/
-    for (i=0;i<NUMELEMENT;i++)
-   {
-    sum2=sum2+a[i];
-   }
- printf("sum=%d\n",sum);
- printf("sum2=%d\n",sum2);
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/subteam2.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/subteam2.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/subteam2.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/subteam2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,86 @@
+/* test two omp for loops in two subteams
+ and a single thread in the 3rd subteam
+*/ 
+#include <stdio.h>
+#include <stdlib.h>
+
+#if defined(_OPENMP)
+#include <omp.h>
+#endif /* _OPENMP */
+
+/*by Liao, new data types and functions to support thread subteams*/
+/*compiler generated new data type to store thread ids in a subteam*/
+
+typedef struct{
+   int iCount;
+   int *iThreadIds;
+} omp_id_set_t;
+omp_id_set_t idSet1,idSet2,idSet3;
+
+extern int __ompc_is_in_idset();
+extern void __ompc_subteam_create();
+void *subteam1, *subteam2, *subteam3; /*use it as &threadsubteam*/
+
+#define NUMELEMENT 100
+
+int main(void){
+
+  int a[NUMELEMENT];
+  int i,j=0,k,sum=0,sum2=0;
+
+/* assume 5 threads */
+#ifdef _OPENMP
+  omp_set_num_threads(5);
+#endif
+/* manual code to generate the thread subteams' ID sets currently */
+/*stuff code to get ids from the thread ids in the subteam*/
+ idSet1.iCount=2;
+ idSet1.iThreadIds=(int *)malloc(2*sizeof(int));
+ idSet1.iThreadIds[0]=1;
+ idSet1.iThreadIds[1]=3;
+
+ idSet2.iCount=2;
+ idSet2.iThreadIds=(int *)malloc(2*sizeof(int));
+ idSet2.iThreadIds[0]=0;
+ idSet2.iThreadIds[1]=2;
+
+ idSet3.iCount=1;
+ idSet3.iThreadIds=(int *)malloc(1*sizeof(int));
+ idSet3.iThreadIds[0]=1;
+
+
+#pragma omp parallel
+ {
+/* onthreads(0,2) */
+#pragma omp for reduction(+:sum)
+  for (i=1;i<=NUMELEMENT;i++)
+   {
+     sum = sum +i;
+   }
+
+/* onthreads(1,3) */
+#pragma omp for schedule(dynamic,5)
+  for (i=0;i<NUMELEMENT;i++)
+   {
+    a[i]=9;
+   }
+
+/* onthread 4 */
+#pragma omp single 
+  {
+#ifdef _OPENMP
+    j=omp_get_thread_num();
+#endif
+   printf("I am the single one: %d\n",j );
+  }
+ }/*end of parallel */
+
+/*------verify results---------------*/
+    for (i=0;i<NUMELEMENT;i++)
+   {
+    sum2=sum2+a[i];
+   }
+ printf("sum=%d\n",sum);
+ printf("sum2=%d\n",sum2);
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/task_largenumber.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/task_largenumber.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_largenumber.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,24 +0,0 @@
-#include <stdio.h>
-#include <omp.h>
-
-#define LARGE_NUMBER 10000000
-double item[LARGE_NUMBER];
-void process (double input)
-{
-  printf("processing %f by thread %d\n",input, omp_get_thread_num());
-}
-int
-main ()
-{
-#pragma omp parallel
-  {
-#pragma omp single
-    {
-      int i;
-      printf("Using %d threads.\n",omp_get_num_threads());
-      for (i = 0; i < LARGE_NUMBER; i++)
-        #pragma omp task
-         process (item[i]);
-    }
-  }
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/task_largenumber.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/task_largenumber.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/task_largenumber.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_largenumber.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <omp.h>
+
+#define LARGE_NUMBER 10000000
+double item[LARGE_NUMBER];
+void process (double input)
+{
+  printf("processing %f by thread %d\n",input, omp_get_thread_num());
+}
+int
+main ()
+{
+#pragma omp parallel
+  {
+#pragma omp single
+    {
+      int i;
+      printf("Using %d threads.\n",omp_get_num_threads());
+      for (i = 0; i < LARGE_NUMBER; i++)
+        #pragma omp task
+         process (item[i]);
+    }
+  }
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/task_link.cpp
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/task_link.cpp	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_link.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,86 +0,0 @@
-/*
- * The single thread will join to do the processing?
- * The other threads can do the processing before 
- * the single thread finishes generating tasks?
- * 
- * Based on OMP spec. 3.0 Example A.13.3c
- * By Liao
- * 9/12/2008
- */
-#include <iostream>
-#include <omp.h>
-using namespace std;
-class node
-{
-public:  
-  int data;
-  node *next;
-  node(int i):data(i){}
-  void setNext(node* n){next = n;}
-};
-
-void process (node * p)
-{
-  cout<<"Found node:"<<p->data;
-#if _OPENMP  
-  cout<<" by thread:"<<omp_get_thread_num();
-#endif  
-  cout<<endl;
-}
-
-node* root;
-
-void init()
-{
-  root = new node(1);
-  node* node2= new node(2);
-  root->setNext(node2);
-  node* node3= new node(3);
-  node2->setNext(node3);
-  node* node4 = new node(4);
-  node3->setNext(node4);
-  node* node5 = new node(5);
-  node4->setNext(node5);
-
-  node* node6= new node(6);
-  node5->setNext(node6);
-  node* node7= new node(7);
-  node6->setNext(node7);
-  node* node8= new node(8);
-  node7->setNext(node8);
-  node* node9= new node(9);
-  node8->setNext(node9);
-  node* node10= new node(10);
-  node9->setNext(node10);
-}
-void
-increment_list_items (node * head)
-{
-#pragma omp parallel
-  {
-#pragma omp single
-    {
-#if _OPENMP      
-      cout<<"Total threads :"<<omp_get_num_threads();
-      cout<<", reported by thread:"<<omp_get_thread_num()<<endl;
-#endif      
-      node *p = head;
-      while (p)
-	{
-// p is firstprivate by default
-//#pragma omp task if (0)
-#pragma omp task 
-	  process (p);
-//#pragma omp taskwait          
-	  p = p->next;
-	} // end while
-    } // end single
-  }// end parallel
-}
-
-int main()
-{
-  init();
-  increment_list_items(root);
-  return 0;
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/task_link.cpp (from rev 117, trunk/tests/CompileTests/OpenMP_tests/task_link.cpp)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/task_link.cpp	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_link.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,86 @@
+/*
+ * The single thread will join to do the processing?
+ * The other threads can do the processing before 
+ * the single thread finishes generating tasks?
+ * 
+ * Based on OMP spec. 3.0 Example A.13.3c
+ * By Liao
+ * 9/12/2008
+ */
+#include <iostream>
+#include <omp.h>
+using namespace std;
+class node
+{
+public:  
+  int data;
+  node *next;
+  node(int i):data(i){}
+  void setNext(node* n){next = n;}
+};
+
+void process (node * p)
+{
+  cout<<"Found node:"<<p->data;
+#if _OPENMP  
+  cout<<" by thread:"<<omp_get_thread_num();
+#endif  
+  cout<<endl;
+}
+
+node* root;
+
+void init()
+{
+  root = new node(1);
+  node* node2= new node(2);
+  root->setNext(node2);
+  node* node3= new node(3);
+  node2->setNext(node3);
+  node* node4 = new node(4);
+  node3->setNext(node4);
+  node* node5 = new node(5);
+  node4->setNext(node5);
+
+  node* node6= new node(6);
+  node5->setNext(node6);
+  node* node7= new node(7);
+  node6->setNext(node7);
+  node* node8= new node(8);
+  node7->setNext(node8);
+  node* node9= new node(9);
+  node8->setNext(node9);
+  node* node10= new node(10);
+  node9->setNext(node10);
+}
+void
+increment_list_items (node * head)
+{
+#pragma omp parallel
+  {
+#pragma omp single
+    {
+#if _OPENMP      
+      cout<<"Total threads :"<<omp_get_num_threads();
+      cout<<", reported by thread:"<<omp_get_thread_num()<<endl;
+#endif      
+      node *p = head;
+      while (p)
+	{
+// p is firstprivate by default
+//#pragma omp task if (0)
+#pragma omp task 
+	  process (p);
+//#pragma omp taskwait          
+	  p = p->next;
+	} // end while
+    } // end single
+  }// end parallel
+}
+
+int main()
+{
+  init();
+  increment_list_items(root);
+  return 0;
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/task_orphaned.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/task_orphaned.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_orphaned.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,6 +0,0 @@
-extern void process();
-void foo()
-{
- #pragma omp task
- process();
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/task_orphaned.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/task_orphaned.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/task_orphaned.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_orphaned.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,6 @@
+extern void process();
+void foo()
+{
+ #pragma omp task
+ process();
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/task_tree.cpp
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/task_tree.cpp	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_tree.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,111 +0,0 @@
-/*
- * OMP 3.0 p.178
- * Example A.13.1c
- *
- * OpenMP tasks will be executed asynchronously 
- * Assuming pre-order/post-order of traversal is wrong
- * unless #pragma omp taskwait is used in the end
- * 9/12/2008
- */
-#include<iostream> 
-#ifdef _OPENMP
-#include<omp.h>
-#endif
-
-using namespace std;
-
-//A simple binary tree node
-class node {
-  public:
-    int id;
-    node* parent;
-    class node* left; // class node or node here? Both
-    node* right;
-    node(int id):id(id){}
-    void setLeft(node* child) { left = child; child->parent = this;}
-    void setRight(node* child){ right = child; child->parent = this;}
-};
-
-void process(node* n) 
-{
-#pragma omp critical  
-  printf("Found node %d\n",n->id);
-}
-
-void traverse (struct node *p)
-{
-  //process(p); // pre-order
-  if (p->left)
-  {
-#pragma omp task
-    traverse(p->left);
-  }
- // else // very wrong!!
-  
-  if(p->right) 
-  {
-#pragma omp task
-     traverse(p->right);
-  }
-//#pragma omp taskwait     
-  process(p); // post-order   
-}
-
-
-struct node * tree;
-/*!
- *      1
- *     /  \
- *    2    3
- *   /  \  / \
- *  4   5  6  7
- * /\   /\
- * 8 9 10
- *
- */
-void init()
-{
-  tree = new node(1);
-  node* child2 = new node(2);  
-  node* child3 = new node(3);  
-  node* child4 = new node(4);  
-  node* child5 = new node(5);  
-  node* child6 = new node(6);  
-  node* child7 = new node(7);  
-  node* child8 = new node(8);  
-  node* child9 = new node(9);  
-  node* child10 = new node(10);  
-
-  tree->setLeft(child2);
-  tree->setRight(child3);
-
-  child2->setLeft(child4);
-  child2->setRight(child5);
-  
-  child3->setLeft(child6);
-  child3->setRight(child7);
-
-  child4->setLeft(child8);
-  child4->setRight(child9);
-
-  child5->setLeft(child10);
-}
-
-int main()
-{
-  init(); 
-#ifdef _OPENMP  
-  omp_set_num_threads(4);
-#endif  
-
-//// wrong? seg fault
-//#pragma omp parallel  
-
-//#pragma omp parallel sections
-#pragma omp parallel 
-{
-#pragma omp single
-  traverse(tree);
-}
-  return 0;
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/task_tree.cpp (from rev 117, trunk/tests/CompileTests/OpenMP_tests/task_tree.cpp)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/task_tree.cpp	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_tree.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,111 @@
+/*
+ * OMP 3.0 p.178
+ * Example A.13.1c
+ *
+ * OpenMP tasks will be executed asynchronously 
+ * Assuming pre-order/post-order of traversal is wrong
+ * unless #pragma omp taskwait is used in the end
+ * 9/12/2008
+ */
+#include<iostream> 
+#ifdef _OPENMP
+#include<omp.h>
+#endif
+
+using namespace std;
+
+//A simple binary tree node
+class node {
+  public:
+    int id;
+    node* parent;
+    class node* left; // class node or node here? Both
+    node* right;
+    node(int id):id(id){}
+    void setLeft(node* child) { left = child; child->parent = this;}
+    void setRight(node* child){ right = child; child->parent = this;}
+};
+
+void process(node* n) 
+{
+#pragma omp critical  
+  printf("Found node %d\n",n->id);
+}
+
+void traverse (struct node *p)
+{
+  //process(p); // pre-order
+  if (p->left)
+  {
+#pragma omp task
+    traverse(p->left);
+  }
+ // else // very wrong!!
+  
+  if(p->right) 
+  {
+#pragma omp task
+     traverse(p->right);
+  }
+//#pragma omp taskwait     
+  process(p); // post-order   
+}
+
+
+struct node * tree;
+/*!
+ *      1
+ *     /  \
+ *    2    3
+ *   /  \  / \
+ *  4   5  6  7
+ * /\   /\
+ * 8 9 10
+ *
+ */
+void init()
+{
+  tree = new node(1);
+  node* child2 = new node(2);  
+  node* child3 = new node(3);  
+  node* child4 = new node(4);  
+  node* child5 = new node(5);  
+  node* child6 = new node(6);  
+  node* child7 = new node(7);  
+  node* child8 = new node(8);  
+  node* child9 = new node(9);  
+  node* child10 = new node(10);  
+
+  tree->setLeft(child2);
+  tree->setRight(child3);
+
+  child2->setLeft(child4);
+  child2->setRight(child5);
+  
+  child3->setLeft(child6);
+  child3->setRight(child7);
+
+  child4->setLeft(child8);
+  child4->setRight(child9);
+
+  child5->setLeft(child10);
+}
+
+int main()
+{
+  init(); 
+#ifdef _OPENMP  
+  omp_set_num_threads(4);
+#endif  
+
+//// wrong? seg fault
+//#pragma omp parallel  
+
+//#pragma omp parallel sections
+#pragma omp parallel 
+{
+#pragma omp single
+  traverse(tree);
+}
+  return 0;
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/task_underIf.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/task_underIf.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_underIf.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,31 +0,0 @@
-/* test pragma under the true body of if statement 
- *  two cases: inside {} or directly attached to true/false body
- *
- *  Liao, 10/1/2008
- * */
-extern void process(int);
-extern void process2(int);
-int item[100];
-void foo(int i)
-{
-  if (i%2==0)
-    #pragma omp task
-    process (item[i]);
-  else
-   #pragma omp task
-    process2(item[i]);
-
-   if (i%2==0)
-   {
-    #pragma omp task
-    process (item[i]);
-   }
-  else
-  {
-    #pragma omp task
-    process2(item[i]);
-  }
-   
-}
-
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/task_underIf.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/task_underIf.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/task_underIf.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_underIf.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,31 @@
+/* test pragma under the true body of if statement 
+ *  two cases: inside {} or directly attached to true/false body
+ *
+ *  Liao, 10/1/2008
+ * */
+extern void process(int);
+extern void process2(int);
+int item[100];
+void foo(int i)
+{
+  if (i%2==0)
+    #pragma omp task
+    process (item[i]);
+  else
+   #pragma omp task
+    process2(item[i]);
+
+   if (i%2==0)
+   {
+    #pragma omp task
+    process (item[i]);
+   }
+  else
+  {
+    #pragma omp task
+    process2(item[i]);
+  }
+   
+}
+
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/task_untied.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/task_untied.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_untied.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,49 +0,0 @@
-/*
- * the task-generation loop is put into a untied task
- * So when the thread running task-generation loop get preempted to
- * conduct the generated tasks,
- * the other threads can resume the task-generation task, which
- * is not tied to the original thread.
- */
-#include <stdio.h>
-#include <omp.h>
-
-#define LARGE_NUMBER 10000000
-double item[LARGE_NUMBER];
-void process (double input)
-{
-  printf("processing %f by thread %d\n",input, omp_get_thread_num());
-}
-int
-main ()
-{
-#pragma omp parallel
-  {
-#pragma omp single
-    {
-      int i;
-      printf("Using %d threads.\n",omp_get_num_threads());
-/*
- untied cannot be used with omp single
- So another level of task is needed to used untied here!!
-
- explicit tasks: 
-  * generated by #omp task
-  * tied or untied
-
- implicit tasks: 
-  * generated by #omp parallel
-  * always tied!!
-*/   
-#pragma omp task untied
-// i is firstprivate, item is shared
-      {
-	for (i = 0; i < LARGE_NUMBER; i++)
-	{
-#pragma omp task
-	  process (item[i]);
-	}
-      }
-    }
-  }
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/task_untied.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/task_untied.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/task_untied.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_untied.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,49 @@
+/*
+ * the task-generation loop is put into a untied task
+ * So when the thread running task-generation loop get preempted to
+ * conduct the generated tasks,
+ * the other threads can resume the task-generation task, which
+ * is not tied to the original thread.
+ */
+#include <stdio.h>
+#include <omp.h>
+
+#define LARGE_NUMBER 10000000
+double item[LARGE_NUMBER];
+void process (double input)
+{
+  printf("processing %f by thread %d\n",input, omp_get_thread_num());
+}
+int
+main ()
+{
+#pragma omp parallel
+  {
+#pragma omp single
+    {
+      int i;
+      printf("Using %d threads.\n",omp_get_num_threads());
+/*
+ untied cannot be used with omp single
+ So another level of task is needed to used untied here!!
+
+ explicit tasks: 
+  * generated by #omp task
+  * tied or untied
+
+ implicit tasks: 
+  * generated by #omp parallel
+  * always tied!!
+*/   
+#pragma omp task untied
+// i is firstprivate, item is shared
+      {
+	for (i = 0; i < LARGE_NUMBER; i++)
+	{
+#pragma omp task
+	  process (item[i]);
+	}
+      }
+    }
+  }
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/task_wait.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/task_wait.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_wait.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,47 +0,0 @@
-
-/* input: result
- * 5 : 5
- * 10: 55
- * 20: 6756
- * 30: 832040
- * 40: 102334155
- * 50: runs for quite a while. for int type and return negative values
- *     using unsigned long int: 3 996 334 433
- *
- * Based on A.13.4c, p182 of OMP 3.0 spec.
- *
- * How much speedup can we get when omp taskwait is used??
- *
- * 9/15/2008
- */
-#include <stdio.h>
-unsigned long int input = 50;
-
-unsigned long int fib(unsigned long int n) {
-  unsigned long int i, j;
-  if (n<2)
-    return n;
-  else 
-  {
-    #pragma omp task shared(i)
-     i=fib(n-1);
-    #pragma omp task shared(j)
-    j=fib(n-2);
-    #pragma omp taskwait
-     return i+j;
-  }
-}
-
-int main()
-{
-  unsigned long int result = 0;
-#pragma omp parallel
-  {
-   #pragma omp single
-    {
-      result = fib(input);
-    }
-  }
-  printf("Fibonacci number for %d is:%u\n",input, result);
-  return 0;
- }

Copied: branches/rice/tests/CompileTests/OpenMP_tests/task_wait.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/task_wait.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/task_wait.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/task_wait.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,47 @@
+
+/* input: result
+ * 5 : 5
+ * 10: 55
+ * 20: 6756
+ * 30: 832040
+ * 40: 102334155
+ * 50: runs for quite a while. for int type and return negative values
+ *     using unsigned long int: 3 996 334 433
+ *
+ * Based on A.13.4c, p182 of OMP 3.0 spec.
+ *
+ * How much speedup can we get when omp taskwait is used??
+ *
+ * 9/15/2008
+ */
+#include <stdio.h>
+unsigned long int input = 50;
+
+unsigned long int fib(unsigned long int n) {
+  unsigned long int i, j;
+  if (n<2)
+    return n;
+  else 
+  {
+    #pragma omp task shared(i)
+     i=fib(n-1);
+    #pragma omp task shared(j)
+    j=fib(n-2);
+    #pragma omp taskwait
+     return i+j;
+  }
+}
+
+int main()
+{
+  unsigned long int result = 0;
+#pragma omp parallel
+  {
+   #pragma omp single
+    {
+      result = fib(input);
+    }
+  }
+  printf("Fibonacci number for %d is:%u\n",input, result);
+  return 0;
+ }

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/threadProcessor.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/threadProcessor.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/threadProcessor.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include <omp.h>
-#include <pthread.h>
-extern int pthread_num_processors_np(void);
-int main(void)
-{
-int tid,procid;
-omp_set_num_threads(4);
-
-#pragma omp parallel private(tid,procid)
-{
-  tid=omp_get_thread_num();
-  procid=pthread_num_processors_np();
-  printf("Hello,world.! by thread %d  on processor %d\n",tid,procid);
-
-}
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/threadProcessor.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/threadProcessor.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/threadProcessor.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/threadProcessor.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <omp.h>
+#include <pthread.h>
+extern int pthread_num_processors_np(void);
+int main(void)
+{
+int tid,procid;
+omp_set_num_threads(4);
+
+#pragma omp parallel private(tid,procid)
+{
+  tid=omp_get_thread_num();
+  procid=pthread_num_processors_np();
+  printf("Hello,world.! by thread %d  on processor %d\n",tid,procid);
+
+}
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/threadprivate.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/threadprivate.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/threadprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,15 +0,0 @@
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif 
-int counter=0;
-#pragma omp threadprivate(counter)
-int main(void)
-{
- int i;
-#pragma omp parallel for
- for(i=0;i<10000;i++)
-    counter++;
-#pragma omp parallel
-  printf("counter=%d\n",counter);
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/threadprivate.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/threadprivate.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/threadprivate.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/threadprivate.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif 
+int counter=0;
+#pragma omp threadprivate(counter)
+int main(void)
+{
+ int i;
+#pragma omp parallel for
+ for(i=0;i<10000;i++)
+    counter++;
+#pragma omp parallel
+  printf("counter=%d\n",counter);
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/threadprivate2.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/threadprivate2.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/threadprivate2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif 
-int counter=0;
-#pragma omp threadprivate(counter)
-int main(void)
-{
- int i;
-#pragma omp parallel for
- for(i=0;i<10000;i++)
-    counter++;
-#pragma omp parallel for
- for(i=0;i<10000;i++)
-    counter+=3;
-#pragma omp parallel
-  printf("counter=%d\n",counter);
-}

Copied: branches/rice/tests/CompileTests/OpenMP_tests/threadprivate2.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/threadprivate2.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/threadprivate2.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/threadprivate2.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif 
+int counter=0;
+#pragma omp threadprivate(counter)
+int main(void)
+{
+ int i;
+#pragma omp parallel for
+ for(i=0;i<10000;i++)
+    counter++;
+#pragma omp parallel for
+ for(i=0;i<10000;i++)
+    counter+=3;
+#pragma omp parallel
+  printf("counter=%d\n",counter);
+}

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/threadprivate3.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/threadprivate3.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/threadprivate3.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,35 +0,0 @@
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#endif
-
-static int sum0=0;
-#pragma omp threadprivate(sum0)
-
-int main()
-{
-  int sum=0,sum1=0;
-  int i;
-#pragma omp parallel
-  {
-     sum0=0;
-#pragma omp for
-       for (i=1;i<=1000;i++)
-          {
-	         sum0=sum0+i;
-          }                       /*end of for*/
-#pragma omp critical
-         {
-    printf("partial sum0 is:%d\n",sum0);
-     sum= sum+sum0;
-          }    /*end of critical*/
-  }           /* end of parallel*/
-  
-   for (i=1;i<=1000;i++)
-      {
-         sum1=sum1+i;
-      }                       /*end of for*/
-  printf("sum=%d; sum1=%d\n",sum,sum1);
-  return(sum==sum1);
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/threadprivate3.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/threadprivate3.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/threadprivate3.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/threadprivate3.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+static int sum0=0;
+#pragma omp threadprivate(sum0)
+
+int main()
+{
+  int sum=0,sum1=0;
+  int i;
+#pragma omp parallel
+  {
+     sum0=0;
+#pragma omp for
+       for (i=1;i<=1000;i++)
+          {
+	         sum0=sum0+i;
+          }                       /*end of for*/
+#pragma omp critical
+         {
+    printf("partial sum0 is:%d\n",sum0);
+     sum= sum+sum0;
+          }    /*end of critical*/
+  }           /* end of parallel*/
+  
+   for (i=1;i<=1000;i++)
+      {
+         sum1=sum1+i;
+      }                       /*end of for*/
+  printf("sum=%d; sum1=%d\n",sum,sum1);
+  return(sum==sum1);
+}
+

Deleted: branches/rice/tests/CompileTests/OpenMP_tests/variables.c
===================================================================
--- trunk/tests/CompileTests/OpenMP_tests/variables.c	2008-11-06 00:24:03 UTC (rev 117)
+++ branches/rice/tests/CompileTests/OpenMP_tests/variables.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -1,58 +0,0 @@
-/*
-test input
-
-  handling of variable scopes:
-   private, firstprivate, lastprivate
-   shared : from the same scope or from upper level scope
-By C. Liao
-*/
-#include <stdio.h>
-
-#ifdef _OPENMP
-#include "omp.h"
-#endif
-
-int gi=0;
-int m=1;
-double mm=9.0;
-#pragma omp threadprivate(m)
-//#pragma omp threadprivate(mm)
-
-int main(void)
-{
- int i;
- int k_3;
- int gj=0;
- double j=0.5;
-// m=1;
-// mm=9.0;
- k_3=7;
-
-#pragma omp parallel private (i) firstprivate(k_3) reduction(+:gi,gj) private(mm)
- {
- int k=1;
-#ifdef  _OPENMP 
- i=omp_get_thread_num();
-#endif
- printf("Hello,world! I am thread %d\n",i);
-//#pragma omp for shared(mm) 
-// shared () cannot be used with 'omp for' according to the specification 
-#pragma omp for
-for (i=0;i<100;i++)
- {i+=mm;}
-
-#pragma omp single 
- printf("mm is:%f\n",mm);
-#pragma omp critical
- gi=i+j+k+k_3;
-// int i=5;
- gi+=i;
-#pragma omp atomic
- j++;
- gj+=m+mm;
-
- }
-printf("gi is %d,gj is %d\n",gi,gj);
-return 0;
-}
-

Copied: branches/rice/tests/CompileTests/OpenMP_tests/variables.c (from rev 117, trunk/tests/CompileTests/OpenMP_tests/variables.c)
===================================================================
--- branches/rice/tests/CompileTests/OpenMP_tests/variables.c	                        (rev 0)
+++ branches/rice/tests/CompileTests/OpenMP_tests/variables.c	2008-11-11 22:06:33 UTC (rev 119)
@@ -0,0 +1,58 @@
+/*
+test input
+
+  handling of variable scopes:
+   private, firstprivate, lastprivate
+   shared : from the same scope or from upper level scope
+By C. Liao
+*/
+#include <stdio.h>
+
+#ifdef _OPENMP
+#include "omp.h"
+#endif
+
+int gi=0;
+int m=1;
+double mm=9.0;
+#pragma omp threadprivate(m)
+//#pragma omp threadprivate(mm)
+
+int main(void)
+{
+ int i;
+ int k_3;
+ int gj=0;
+ double j=0.5;
+// m=1;
+// mm=9.0;
+ k_3=7;
+
+#pragma omp parallel private (i) firstprivate(k_3) reduction(+:gi,gj) private(mm)
+ {
+ int k=1;
+#ifdef  _OPENMP 
+ i=omp_get_thread_num();
+#endif
+ printf("Hello,world! I am thread %d\n",i);
+//#pragma omp for shared(mm) 
+// shared () cannot be used with 'omp for' according to the specification 
+#pragma omp for
+for (i=0;i<100;i++)
+ {i+=mm;}
+
+#pragma omp single 
+ printf("mm is:%f\n",mm);
+#pragma omp critical
+ gi=i+j+k+k_3;
+// int i=5;
+ gi+=i;
+#pragma omp atomic
+ j++;
+ gj+=m+mm;
+
+ }
+printf("gi is %d,gj is %d\n",gi,gj);
+return 0;
+}
+

Modified: branches/rice/tests/roseTests/programTransformationTests/finiteDifferencingDemo.C
===================================================================
--- branches/rice/tests/roseTests/programTransformationTests/finiteDifferencingDemo.C	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/tests/roseTests/programTransformationTests/finiteDifferencingDemo.C	2008-11-11 22:06:33 UTC (rev 119)
@@ -29,7 +29,7 @@
 
 vector<SgFunctionDefinition*> functions;
 
-class FindFunctionsVisitor: public AstSimpleProcessing {
+class FindFunctionsVis: public AstSimpleProcessing {
   public:
   virtual void visit(SgNode* n) {
     if (isSgFunctionDefinition(n)) {
@@ -53,7 +53,7 @@
   sageProject = isSgProject(tempProject);
   ROSE_ASSERT (sageProject);
 
-  FindFunctionsVisitor().traverse(sageProject, preorder);
+  FindFunctionsVis().traverse(sageProject, preorder);
 
   for (unsigned int x = 0; x < functions.size(); ++x) {
     SgBasicBlock* body = functions[x]->get_body();

Modified: branches/rice/tutorial/abstractHandle2.cpp
===================================================================
--- branches/rice/tutorial/abstractHandle2.cpp	2008-11-10 03:37:44 UTC (rev 118)
+++ branches/rice/tutorial/abstractHandle2.cpp	2008-11-11 22:06:33 UTC (rev 119)
@@ -20,19 +20,19 @@
 
   // Generate a file handle from the first file of the project
   abstract_node* file_node= new roseNode((project->get_fileList())[0]);
-  abstract_handle* handle1 = new abstract_handle(file_node);
-  cout<<"Created a file handle:\n"<<handle1->toString()<<endl<<endl;;
+  abstract_handle* handle0 = new abstract_handle(file_node);
+  cout<<"Created a file handle:\n"<<handle0->toString()<<endl<<endl;;
 
   //Create a handle to a namespace given its name and parent handle 
-  string input1("NamespaceDeclarationStatement<name,space1>");
-  abstract_handle* handle0 = new abstract_handle(handle1,input1);
-  cout<<"Created a handle:\n"<<handle0->toString()<<endl<<endl;
-  cout<<"It points to:\n"<<handle0->getNode()->toString()<<endl<<endl;
+  string input1="NamespaceDeclarationStatement<name,space1>";
+  abstract_handle* handle1 = new abstract_handle(handle0,input1);
+  cout<<"Created a handle:\n"<<handle1->toString()<<endl<<endl;
+  cout<<"It points to:\n"<<handle1->getNode()->toString()<<endl<<endl;
 
   // Create a handle within the file, given a string specifying  
   // its construct type (class declaration) and source position 
-  string input("ClassDeclaration<position,4.3-9.2>");
-  abstract_handle* handle2 = new abstract_handle(handle1,input);
+  string input="ClassDeclaration<position,4.3-9.2>";
+  abstract_handle* handle2 = new abstract_handle(handle0,input);
 
   cout<<"Created a handle:\n"<<handle2->toString()<<endl<<endl;
   cout<<"It points to:\n"<<handle2->getNode()->toString()<<endl<<endl;;



More information about the Rose-commits mailing list