This is an archive of the discontinued LLVM Phabricator instance.

Fix LLVM_ENABLE_THREADS check from 26a92d5852b2c6bf77efd26f6c0194c913f40285
ClosedPublic

Authored by arichardson on Aug 16 2021, 2:31 AM.

Details

Summary

We should be using #if instead of #ifdef here since LLVM_ENABLE_THREADS
is set using #cmakedefine01 so is always defined.

Since the other branch has never been used I wonder if we should just remove it instead?

Diff Detail

Event Timeline

arichardson created this revision.Aug 16 2021, 2:31 AM
arichardson requested review of this revision.Aug 16 2021, 2:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2021, 2:31 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman accepted this revision.Aug 16 2021, 6:07 AM

LGTM!

Since the other branch has never been used I wonder if we should just remove it instead?

I don't think removing the other branch entirely is a good approach because then the call will silently be a noop when threads are disabled. I'd rather we keep the support, or turn the other branch into a loud breakage so that callers of it find out at compile time that it's not supported when threads are disabled.

This revision is now accepted and ready to land.Aug 16 2021, 6:07 AM