Skip to content

Commit e7b2bc0

Browse files
committed
Basic: Adjust condition for include after macro removal in upstream LLVM
`HAVE_SYS_RESOURCE_H` was removed in llvm/llvm-project#123288, so this header is no longer included at this particular location on rebranch, which breaks the Linux build, where it is not transitively included either. Use the same condition as in the use site (`getChildrenMaxResidentSetSize`) instead. Also, don't wrap `HAVE_GETRUSAGE` in `defined()` in case it does get defined to 0.
1 parent 94b40d1 commit e7b2bc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Basic/Statistic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#ifdef HAVE_SYS_TIME_H
3434
#include <sys/time.h>
3535
#endif
36-
#ifdef HAVE_SYS_RESOURCE_H
36+
#if HAVE_GETRUSAGE && !defined(__HAIKU__)
3737
#include <sys/resource.h>
3838
#endif
3939
#ifdef HAVE_PROC_PID_RUSAGE
@@ -383,7 +383,7 @@ void UnifiedStatsReporter::recordJobMaxRSS(long rss) {
383383
}
384384

385385
int64_t UnifiedStatsReporter::getChildrenMaxResidentSetSize() {
386-
#if defined(HAVE_GETRUSAGE) && !defined(__HAIKU__)
386+
#if HAVE_GETRUSAGE && !defined(__HAIKU__)
387387
struct rusage RU;
388388
::getrusage(RUSAGE_CHILDREN, &RU);
389389
int64_t M = static_cast<int64_t>(RU.ru_maxrss);

0 commit comments

Comments
 (0)