This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Change label dumping, UID dumping


On Tue, 28 Aug 2007, Richard Guenther wrote:

> 
> This changes label dumping if we use the DECL_UID from
> 
> <D12345>:;
> 
> to
> 
> <D.12345>:;
> 
> that is, dump DECL_UID like we do everywhere else.  It also changes
> dumping of referenced vars from
> 
> Variable: <retval>, UID 6367, intD.2
> 
> to
> 
> Variable: <retval>, UID D.6367, intD.2
> 
> (same rationale).
> 
> Any strong feelings about such changes?  It makes matching up dump-files
> a lot easier.

FYI I'm using the following script to match dump-files, it takes three
arguments, the first two are two dump files with still the same IL to
generate UID substitutions from, the third one is the dump file to
apply the substitutions to.

  match-uids a/t.i.033t.dce b/t.i.033t.dce a/t.i.101t.ivopts \
	| diff -u - b/t.i.101t.ivopts

then shows (nicer) differences of the two ivopts dumps based on UID
fixups generated from the two (identical apart from UIDs) dce dumps.

Richard.

#!/bin/sh

TMP1=`mktemp /tmp/match-uids.XXXXXX`
TMP2=`mktemp /tmp/match-uids.XXXXXX`

sed -e 's/\(D\.[0-9]*\)\([^0-9]\)/\1@\2/g' $1 | tr '@' '\n' | grep 'D\.[0-9]*$' | sed -e 's/.*\(D\.[0-9]*\)$/\1/' | awk '{ print 2*NR, $0 }' > $TMP1
sed -e 's/\(D\.[0-9]*\)\([^0-9]\)/\1@\2/g' $2 | tr '@' '\n' | grep 'D\.[0-9]*$' | sed -e 's/.*\(D\.[0-9]*\)$/\1/' | awk '{ print 2*NR+1, $0 }' > $TMP2

if test `wc -l $TMP1 | cut -f 1 -d ' '` -ne `wc -l $TMP2 | cut -f 1 -d ' '`; then
  echo Use two files with the same IL as base
  exit 1
fi

TMP3=`mktemp /tmp/match-uids-commands.XXXXXXX`
sort -n -m $TMP1 $TMP2 | tr '\n' ' ' | sed -e 's/[0-9]* D\.\([0-9]*\) [0-9]* D\.\([0-9]*\) /s\/D\\.\1\\([^0-9]\\)\/D@\2\\1\/g\n/g' | sort | uniq > $TMP3
sed -f $TMP3 $3 | tr '@' '.'


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]