Skip to content

Commit c7debcc

Browse files
neildharfacebook-github-bot
authored andcommitted
Removing API usage not applicable on iOS (stat and fstat) in libhermes
Summary: This diff just removes references to functions that use (either directly or transitively) those functions, and relies on linker DCE to clean up the rest. Trying to extricate all uses of these functions would otherwise result in very significant changes. This diff makes two changes: 1. In raw_fd_ostream, fall back to a default buffer size when building for iOS. 2. Update a function in LLVM that was marked as "used" to suppress warnings, to instead use the new `[[maybe_unused]]` attribute. This allows the function, and the calls to stat it retains, to be stripped. Reviewed By: tmikov, TheSavior Differential Revision: D53133166 fbshipit-source-id: f425762bc6b7072cbd8235c65e9cf652cecb981c
1 parent b686d8f commit c7debcc

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

external/llvh/lib/Support/Signals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static FormattedNumber format_ptr(void *PC) {
103103
}
104104

105105
/// Helper that launches llvm-symbolizer and symbolizes a backtrace.
106-
LLVM_ATTRIBUTE_USED
106+
[[maybe_unused]]
107107
static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace,
108108
int Depth, llvh::raw_ostream &OS) {
109109
if (DisableSymbolicationFlag)

external/llvh/lib/Support/raw_ostream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ size_t raw_fd_ostream::preferred_buffer_size() const {
764764
if (IsWindowsConsole)
765765
return 0;
766766
return raw_ostream::preferred_buffer_size();
767-
#elif !defined(__minix)
767+
#elif !defined(__minix) && !(defined(__APPLE__) && defined(HERMES_IS_MOBILE_BUILD))
768768
// Minix has no st_blksize.
769769
assert(FD >= 0 && "File not yet open!");
770770
struct stat statbuf;

0 commit comments

Comments
 (0)