This is an archive of the discontinued LLVM Phabricator instance.

tsan: remove unused pc arguments
ClosedPublic

Authored by dvyukov on Jul 28 2021, 9:42 AM.

Details

Summary

Remove pc argument of ThreadIgnoreEnd, ThreadIgnoreSyncEnd
and AcquireGlobal functions. It's unused and in some places
we don't even have a pc and pass 0 anyway.
Don't confuse readers and don't pretend that pc is needed
and that passing 0 is somehow deficient.

Use simpler convention for ThreadIgnoreBegin and ThreadIgnoreSyncBegin:
accept only pc instread of pc+save_stack. 0 pc means "don't save stack".

Diff Detail

Event Timeline

dvyukov requested review of this revision.Jul 28 2021, 9:42 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 9:42 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Jul 28 2021, 11:00 AM
This revision is now accepted and ready to land.Jul 28 2021, 11:00 AM
This revision was landed with ongoing or failed builds.Jul 28 2021, 11:07 AM
This revision was automatically updated to reflect the committed changes.
haowei added a subscriber: haowei.Jul 28 2021, 4:21 PM

Hi, this change breaks clang mac build.

We are seeing build errors like:

[703/1571] Building CXX object compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan_osx_dynamic.dir/rtl/tsan_interceptors_mac.cpp.o
FAILED: compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan_osx_dynamic.dir/rtl/tsan_interceptors_mac.cpp.o 
/opt/s/w/ir/x/w/staging/llvm_build/./bin/clang++ --target=x86_64-apple-darwin19.6.0 --sysroot=/opt/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__func__=__FUNCTION__ -Dclang_rt_tsan_osx_dynamic_EXPORTS -I/opt/s/w/ir/x/w/llvm-project/compiler-rt/lib/tsan/.. -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffile-prefix-map=/opt/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-bins=../staging/llvm_build/runtimes/runtimes-bins -ffile-prefix-map=/opt/s/w/ir/x/w/llvm-project/= -no-canonical-prefixes -O3 -DNDEBUG -arch arm64 -arch x86_64 -arch x86_64h -isysroot /opt/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -fPIC  -stdlib=libc++ -mmacosx-version-min=10.7 -isysroot /opt/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -Werror=thread-safety -Werror=thread-safety-reference -Werror=thread-safety-beta -O3 -UNDEBUG -MD -MT compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan_osx_dynamic.dir/rtl/tsan_interceptors_mac.cpp.o -MF compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan_osx_dynamic.dir/rtl/tsan_interceptors_mac.cpp.o.d -o compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan_osx_dynamic.dir/rtl/tsan_interceptors_mac.cpp.o -c /opt/s/w/ir/x/w/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
/opt/s/w/ir/x/w/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp:368:5: error: no matching function for call to 'ThreadIgnoreEnd'
    ThreadIgnoreEnd(thr, pc);
    ^~~~~~~~~~~~~~~
/opt/s/w/ir/x/w/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h:739:6: note: candidate function not viable: requires single argument 'thr', but 2 arguments were provided
void ThreadIgnoreEnd(ThreadState *thr);
     ^
1 error generated.

Could you fix it.