Skip to content

Commit a29e85d

Browse files
[llvm-exegesis] Change preprocessor directives for getCurrentTID
This patch changes the preprocessor directives surrounding getCurrentTID, particularly moving it out of the block that is only defined when not building for Android. The getCurrentTID function is called in places that only require Linux definitions, so this function should have the same preprocessor scoping around it to prevent link time failures.
1 parent d26dd58 commit a29e85d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace llvm {
2323
namespace exegesis {
2424

25-
#if defined(__linux__) && !defined(__ANDROID__)
25+
#if defined(__linux__)
2626

2727
long SubprocessMemory::getCurrentTID() {
2828
// We're using the raw syscall here rather than the gettid() function provided
@@ -31,6 +31,8 @@ long SubprocessMemory::getCurrentTID() {
3131
return syscall(SYS_gettid);
3232
}
3333

34+
#if !defined(__ANDROID__)
35+
3436
Error SubprocessMemory::initializeSubprocessMemory(pid_t ProcessID) {
3537
// Add the PID to the shared memory name so that if we're running multiple
3638
// processes at the same time, they won't interfere with each other.
@@ -157,7 +159,8 @@ Expected<int> SubprocessMemory::setupAuxiliaryMemoryInSubprocess(
157159

158160
SubprocessMemory::~SubprocessMemory() {}
159161

160-
#endif // defined(__linux__) && !defined(__ANDROID__)
162+
#endif // !defined(__ANDROID__)
163+
#endif // defined(__linux__)
161164

162165
} // namespace exegesis
163166
} // namespace llvm

0 commit comments

Comments
 (0)