This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizers] Remove obsolete OpenFile from sanitizer_solaris.cc
ClosedPublic

Authored by ro on Jun 25 2019, 5:37 AM.

Details

Summary

I noticed that the instance of OpenFile in sanitizer_solaris.cc is no longer needed.

Removed as follows, tested on x86_64-pc-solaris2.11. Ok for trunk?

Diff Detail

Repository
rL LLVM

Event Timeline

ro created this revision.Jun 25 2019, 5:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2019, 5:37 AM
Herald added subscribers: Restricted Project, fedor.sergeev, kubamracek. · View Herald Transcript
ro added a reviewer: samsonov.Jun 25 2019, 5:50 AM
ro added a comment.Jul 2 2019, 12:42 AM

Ping? It's been a week and the patch is as obvious as it gets.

Are you sure it's unused? I see several uses of this function:

lib$ grep OpenFile sanitizer_common/*.{h,cc} tsan/rtl/*.cc
sanitizer_common/sanitizer_file.h:fd_t OpenFile(const char *filename, FileAccessMode mode,
sanitizer_common/sanitizer_posix.h:// Don't use directly, use __sanitizer::OpenFile() instead.
sanitizer_common/sanitizer_coverage_libcdep_new.cc:static fd_t OpenFile(const char* path) {
sanitizer_common/sanitizer_coverage_libcdep_new.cc: fd_t fd = OpenFile(path, WrOnly, &err);
sanitizer_common/sanitizer_coverage_libcdep_new.cc: fd_t fd = OpenFile(file_path);
sanitizer_common/sanitizer_file.cc: fd = OpenFile(full_path, WrOnly);
sanitizer_common/sanitizer_file.cc: fd_t fd = OpenFile(file_name, RdOnly, errno_p);
sanitizer_common/sanitizer_file.cc: fd_t fd = OpenFile(file_name, RdOnly, errno_p);
sanitizer_common/sanitizer_linux_libcdep.cc: fd_t fd = OpenFile("/proc/self/statm", RdOnly);
sanitizer_common/sanitizer_posix.cc:fd_t OpenFile(const char *filename, FileAccessMode mode, error_t *errno_p) {
sanitizer_common/sanitizer_posix.cc: fd_t fd = OpenFile(file_name, RdOnly);
sanitizer_common/sanitizer_rtems.cc:fd_t OpenFile(const char *filename, FileAccessMode mode, error_t *errno_p) {
sanitizer_common/sanitizer_solaris.cc:uptr OpenFile(const char *filename, bool write) {
sanitizer_common/sanitizer_win.cc: fd_t fd = OpenFile(modname, RdOnly, nullptr);
sanitizer_common/sanitizer_win.cc:fd_t OpenFile(const char *filename, FileAccessMode mode, error_t *last_error) {
tsan/rtl/tsan_rtl.cc: fd_t fd = OpenFile(filename.data(), WrOnly);

ro added a comment.Jul 2 2019, 12:53 AM

Are you sure it's unused? I see several uses of this function:

True, but with the instance in sanitizer_solaris.cc removed, the one in sanitizer_posix.cc is used: sanitizer_file.h declares a default for the
last arg.

Both make and make check-all complete successfully without it.

dvyukov accepted this revision.Jul 2 2019, 1:05 AM

Then looks like the right thing to do.
Do you have commit access? Or you want me to submit this?

This revision is now accepted and ready to land.Jul 2 2019, 1:05 AM
ro added a comment.Jul 2 2019, 1:09 AM

Then looks like the right thing to do.
Do you have commit access? Or you want me to submit this?

I do and will commit the patch soon.

Thanks.

Rainer
This revision was automatically updated to reflect the committed changes.