Author: dgilmore
Date: 2012-08-19 19:57:14 -0400 (Sun, 19 Aug 2012)
New Revision: 4009

Modified:
   trunk/configure
   trunk/configure.ac
   trunk/osprey/Makefile.gsetup.in
   trunk/osprey/common/com/ir_reader.cxx
   trunk/osprey/common/com/wn.cxx
   trunk/osprey/common/com/wn_core.h
Log:
Add configuration option --enable-whirl-id.

This configure option enables the debugging ID field in WHIRL nodes.

Changed CPP macro name from USE_UNIQUE_MAP_ID_FOR_DEBUG to
WHIRL_USE_UNIQUE_ID_FOR_DEBUG to better describe the
functionality being added.

CR: David Coakley



Modified: trunk/configure
===================================================================
--- trunk/configure     2012-08-19 23:53:31 UTC (rev 4008)
+++ trunk/configure     2012-08-19 23:57:14 UTC (rev 4009)
@@ -273,7 +273,7 @@
 
 ac_subdirs_all="$ac_subdirs_all osprey/cygnus"
 ac_subdirs_all="$ac_subdirs_all osprey-gcc-4.2.0"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME 
PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix 
program_transform_name bindir sbindir libexecdir datadir sysconfdir 
sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir 
build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build 
build_cpu build_vendor build_os host host_cpu host_vendor host_os target 
target_cpu target_vendor target_os MACHINE_TYPE CROSS_TARGET BUILD_ABI 
BUILD_ARCH BUILD_HOST BUILD_TARGET BUILD_VENDOR BUILD_OPTIMIZE 
BUILD_FFE_OPTIMIZE BUILD_LIB_OPTIMIZE BUILD_COMPILER BUILD_BOTH 
LIB_MACHINE_TYPE LIB_BUILD_TARGET LIB_BUILD_ABI LIB_BUILD_ARCH LIB_BUILD_HOST 
LIB2_MACHINE_TYPE LIB2_BUILD_TARGET LIB2_BUILD_ABI LIB2_BUILD_ARCH 
LIB2_BUILD_HOST BUILD_MULTILIB COMPILER_TARG_DIR TARG_INFO_NAME BUILD_GNU3 
BUILD_FORTRAN BUILD_SKIP_IPA BUILD_TYPE GCC_CONFIGURE_TARG GCC_DIR LIBLIST 
subdirs LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME 
PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix 
program_transform_name bindir sbindir libexecdir datadir sysconfdir 
sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir 
build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build 
build_cpu build_vendor build_os host host_cpu host_vendor host_os target 
target_cpu target_vendor target_os MACHINE_TYPE CROSS_TARGET BUILD_ABI 
BUILD_ARCH BUILD_HOST BUILD_TARGET BUILD_VENDOR BUILD_OPTIMIZE 
BUILD_FFE_OPTIMIZE BUILD_LIB_OPTIMIZE BUILD_COMPILER BUILD_BOTH 
LIB_MACHINE_TYPE LIB_BUILD_TARGET LIB_BUILD_ABI LIB_BUILD_ARCH LIB_BUILD_HOST 
LIB2_MACHINE_TYPE LIB2_BUILD_TARGET LIB2_BUILD_ABI LIB2_BUILD_ARCH 
LIB2_BUILD_HOST BUILD_MULTILIB COMPILER_TARG_DIR TARG_INFO_NAME BUILD_GNU3 
BUILD_FORTRAN WHIRL_HAS_ID_FIELD BUILD_SKIP_IPA BUILD_TYPE GCC_CONFIGURE_TARG 
GCC_DIR LIBLIST subdirs LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -793,6 +793,7 @@
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-gnu3           Enable GNU3-based C/C++ frontend
   --disable-fortran       Disable Fortran language support
+  --enable-whirl-id       Enable debugging ID in WHIRL node
   --disable-ipa           Disable IPA compilation support (EXPERIMENTAL)
   --disable-shared        Disable shared libraries (EXPERIMENTAL)
 
@@ -1496,6 +1497,24 @@
 fi
 
 
+# Set whether WHIRL a node contains a debugging ID
+# Check whether --enable-whirl_id or --disable-whirl_id was given.
+if test "${enable_whirl_id+set}" = set; then
+  enableval="$enable_whirl_id"
+
+fi;
+
+if test "x$enable_whirl_id" = "xyes"; then
+
+  WHIRL_HAS_ID_FIELD=YES
+
+else
+
+  WHIRL_HAS_ID_FIELD=NO
+
+fi
+
+
 # Set whether to skip IPA support (default NO).
 # Check whether --enable-ipa or --disable-ipa was given.
 if test "${enable_ipa+set}" = set; then
@@ -1756,6 +1775,7 @@
 
 
 
+
 # List of configurable files to create in object directory.
                                                                                
                                                                                
                                                                                
                                                   
ac_config_files="$ac_config_files Makefile osprey/Makefile.gsetup 
osprey/targdir/libspin/Makefile osprey/targdir/libspin_4_2_0/Makefile 
osprey/targdir/include/Makefile osprey/targdir/driver/Makefile 
osprey/targdir/libiberty/Makefile osprey/targdir/targ_info/Makefile 
osprey/targdir/be/Makefile osprey/targdir/libelf/Makefile 
osprey/targdir/libelfutil/Makefile osprey/targdir/libdwarf/Makefile 
osprey/targdir/libunwindP/Makefile osprey/targdir/cg/Makefile 
osprey/targdir/wopt/Makefile osprey/targdir/ipl/Makefile 
osprey/targdir/lno/Makefile osprey/targdir/lw_inline/Makefile 
osprey/targdir/ipa/Makefile osprey/targdir/whirl2c/Makefile 
osprey/targdir/libcomutil/Makefile osprey/targdir/ir_tools/Makefile 
osprey/targdir/libcmplrs/Makefile osprey/targdir/wgen/Makefile 
osprey/targdir/libcif/Makefile osprey/targdir/arith/Makefile 
osprey/targdir/orc_ict/Makefile osprey/targdir/orc_intel/Makefile 
osprey/targdir/libkapi/Makefile"
 
@@ -2576,6 +2596,7 @@
 s,@TARG_INFO_NAME@,$TARG_INFO_NAME,;t t
 s,@BUILD_GNU3@,$BUILD_GNU3,;t t
 s,@BUILD_FORTRAN@,$BUILD_FORTRAN,;t t
+s,@WHIRL_HAS_ID_FIELD@,$WHIRL_HAS_ID_FIELD,;t t
 s,@BUILD_SKIP_IPA@,$BUILD_SKIP_IPA,;t t
 s,@BUILD_TYPE@,$BUILD_TYPE,;t t
 s,@GCC_CONFIGURE_TARG@,$GCC_CONFIGURE_TARG,;t t

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac  2012-08-19 23:53:31 UTC (rev 4008)
+++ trunk/configure.ac  2012-08-19 23:57:14 UTC (rev 4009)
@@ -144,6 +144,16 @@
   BUILD_FORTRAN=YES
 ])
 
+# Set whether WHIRL a node contains a debugging ID
+AC_ARG_ENABLE([whirl_id],
+  AS_HELP_STRING([--enable-whirl-id], [Enable debugging ID in WHIRL node]))
+
+AS_IF([test "x$enable_whirl_id" = "xyes"], [
+  WHIRL_HAS_ID_FIELD=YES
+], [
+  WHIRL_HAS_ID_FIELD=NO
+])
+
 # Set whether to skip IPA support (default NO).
 AC_ARG_ENABLE([ipa],
   AS_HELP_STRING([--disable-ipa], [Disable IPA compilation support 
(EXPERIMENTAL)]))
@@ -383,6 +393,7 @@
 AC_SUBST([TARG_INFO_NAME])
 AC_SUBST([BUILD_GNU3])
 AC_SUBST([BUILD_FORTRAN])
+AC_SUBST([WHIRL_HAS_ID_FIELD])
 AC_SUBST([BUILD_SKIP_IPA])
 AC_SUBST([BUILD_TYPE])
 AC_SUBST([GCC_CONFIGURE_TARG])

Modified: trunk/osprey/Makefile.gsetup.in
===================================================================
--- trunk/osprey/Makefile.gsetup.in     2012-08-19 23:53:31 UTC (rev 4008)
+++ trunk/osprey/Makefile.gsetup.in     2012-08-19 23:57:14 UTC (rev 4009)
@@ -159,6 +159,9 @@
 ifndef GCC_DIR
      GCC_DIR = @GCC_DIR@
 endif
+ifndef WHIRL_HAS_ID_FIELD
+     WHIRL_HAS_ID_FIELD = @WHIRL_HAS_ID_FIELD@
+endif
 
 #  For cross compilers, there are really 3 separate variables:
 #  the build host (machine you are building on), 
@@ -663,6 +666,9 @@
 ifeq ($(BUILD_TYPE), SHARED)
 STD_COMPILE_OPTS += -DSHARED_BUILD
 endif
+ifeq ($(WHIRL_HAS_ID_FIELD), YES)
+STD_COMPILE_OPTS += -DWHIRL_USE_UNIQUE_ID_FOR_DEBUG
+endif
 
 #
 #  Assign STD_C++_OPTS here

Modified: trunk/osprey/common/com/ir_reader.cxx
===================================================================
--- trunk/osprey/common/com/ir_reader.cxx       2012-08-19 23:53:31 UTC (rev 
4008)
+++ trunk/osprey/common/com/ir_reader.cxx       2012-08-19 23:57:14 UTC (rev 
4009)
@@ -966,7 +966,7 @@
        return;
     } else {
        if (IR_dump_wn_id) {
-#ifdef USE_UNIQUE_MAP_ID_FOR_DEBUG
+#ifdef WHIRL_USE_UNIQUE_ID_FOR_DEBUG
            fprintf(ir_ofile, "[%6u] ", WN_id(wn));
 #endif
        }
@@ -1385,7 +1385,7 @@
 static void ir_put_marker(const char *str, INT indent)
 {
   if (IR_dump_wn_id) {
-#ifdef USE_UNIQUE_MAP_ID_FOR_DEBUG
+#ifdef WHIRL_USE_UNIQUE_ID_FOR_DEBUG
     indent += 9;
 #endif
   }

Modified: trunk/osprey/common/com/wn.cxx
===================================================================
--- trunk/osprey/common/com/wn.cxx      2012-08-19 23:53:31 UTC (rev 4008)
+++ trunk/osprey/common/com/wn.cxx      2012-08-19 23:57:14 UTC (rev 4009)
@@ -545,7 +545,7 @@
 {
    if (n && (n == trace_wn_node 
              || trace_wn_mapid != -1 && WN_map_id(n) == trace_wn_mapid
-#ifdef USE_UNIQUE_MAP_ID_FOR_DEBUG
+#ifdef WHIRL_USE_UNIQUE_ID_FOR_DEBUG
              || trace_wn_id != 0 && trace_wn_id == WN_id(n)
 #endif
              ) ) {
@@ -557,7 +557,7 @@
 
 void Set_Trace_Wn_id(UINT32 wn_id) 
 { 
-#ifdef USE_UNIQUE_MAP_ID_FOR_DEBUG
+#ifdef WHIRL_USE_UNIQUE_ID_FOR_DEBUG
    trace_wn_id = wn_id; 
    copied_ids.insert(wn_id);
 #endif
@@ -565,7 +565,7 @@
 
 void Trace_Wn_Copy(const WN *wn, const WN *src_wn)
 {
-#ifdef USE_UNIQUE_MAP_ID_FOR_DEBUG
+#ifdef WHIRL_USE_UNIQUE_ID_FOR_DEBUG
    set<UINT32>::iterator itr = copied_ids.find(WN_id(src_wn));
    if (itr != copied_ids.end()) {
       // found src_wn's wn_id in copied list

Modified: trunk/osprey/common/com/wn_core.h
===================================================================
--- trunk/osprey/common/com/wn_core.h   2012-08-19 23:53:31 UTC (rev 4008)
+++ trunk/osprey/common/com/wn_core.h   2012-08-19 23:57:14 UTC (rev 4009)
@@ -490,7 +490,7 @@
       mUINT32           kid_count   :14; /* gives kid_count for free */
       mINT64            map_id      :30;
       TYPE_ID           desc        : 6;  /* descriptor type */
-#ifdef USE_UNIQUE_MAP_ID_FOR_DEBUG
+#ifdef WHIRL_USE_UNIQUE_ID_FOR_DEBUG
       UINT32            wn_id;            /* unique id for the whirl node */
 #endif
    } common;
@@ -587,7 +587,7 @@
   friend void Check_Traced_Wn_Node(WN *);
   void set_unique_id() {
      the_unique_id++;
-#ifdef USE_UNIQUE_MAP_ID_FOR_DEBUG
+#ifdef WHIRL_USE_UNIQUE_ID_FOR_DEBUG
      common.wn_id = the_unique_id;
 #endif
      Check_Traced_Wn_Node(this);
@@ -688,7 +688,7 @@
   friend inline TYPE_ID     WN_desc (const WN *);
   friend inline void        WN_set_desc (WN *, TYPE_ID);
   friend inline INT32       WN_map_id (const WN *);
-#ifdef USE_UNIQUE_MAP_ID_FOR_DEBUG
+#ifdef WHIRL_USE_UNIQUE_ID_FOR_DEBUG
   friend inline UINT32      WN_id (const WN *);
 #endif
   friend inline TY_IDX      WN_ty (const WN *, const int);
@@ -842,7 +842,7 @@
    Check_Traced_Wn_Node(wn);
 #endif
 }
-#ifdef USE_UNIQUE_MAP_ID_FOR_DEBUG
+#ifdef WHIRL_USE_UNIQUE_ID_FOR_DEBUG
 inline UINT32      WN_id (const WN *wn) { return wn->common.wn_id; }
 #endif
 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to