This is an archive of the discontinued LLVM Phabricator instance.

tsan: add pragma line to buildgo.sh
ClosedPublic

Authored by dvyukov on Jul 19 2021, 6:55 AM.

Details

Summary

Add pragma line so that errors messages point to the actual
source files rather than to the concatenated gotsan.cpp.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Jul 19 2021, 6:55 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2021, 6:55 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Jul 19 2021, 8:27 AM
melver added inline comments.
compiler-rt/lib/tsan/go/buildgo.sh
174

If this ever grows, it'd be cleaner as:

for F in $SRCS; do
  (
    echo "#line 1 \"$F\""
    ... other stuff ...
    cat $F
  ) >> $DIR/gotsan.cpp
done

As-is, this would just save you typing $DIR/gotsan.cpp twice.

This revision is now accepted and ready to land.Jul 19 2021, 8:27 AM
vitalybuka accepted this revision.Jul 19 2021, 11:49 AM
vitalybuka added inline comments.
compiler-rt/lib/tsan/go/buildgo.sh
174
# not needed rm -f $DIR/gotsan.cpp
for F in $SRCS; do
	echo "#line 1 \"$F\""
	cat $F
done > $DIR/gotsan.cpp
dvyukov updated this revision to Diff 360010.Jul 19 2021, 10:16 PM

change code to not repeat $DIR/gotsan.cpp

dvyukov marked an inline comment as done.Jul 19 2021, 10:17 PM
dvyukov added inline comments.
compiler-rt/lib/tsan/go/buildgo.sh
174

Even better! Done.

This revision was landed with ongoing or failed builds.Jul 19 2021, 10:22 PM
This revision was automatically updated to reflect the committed changes.
dvyukov marked an inline comment as done.