This is an archive of the discontinued LLVM Phabricator instance.

[clang] Replace getOS() == llvm::Triple::*BSD with isOS*BSD() [NFCI]
ClosedPublic

Authored by mgorny on Dec 20 2018, 12:34 AM.

Details

Summary

Replace multiple comparisons of getOS() value with FreeBSD, NetBSD,
OpenBSD and DragonFly with matching isOS*BSD() methods. This should
improve the consistency of coding style without changing the behavior.
Direct getOS() comparisons were left whenever used in switch or switch-
like context.

Diff Detail

Repository
rC Clang

Event Timeline

mgorny created this revision.Dec 20 2018, 12:34 AM
mgorny updated this revision to Diff 179021.Dec 20 2018, 12:35 AM
krytarowski accepted this revision.Dec 20 2018, 1:07 AM
This revision is now accepted and ready to land.Dec 20 2018, 1:07 AM
brad accepted this revision.Dec 20 2018, 1:51 AM
krytarowski added inline comments.Dec 20 2018, 2:06 AM
lib/Basic/Targets/ARM.cpp
285

Actually we could use IsNetBSD and IsOpenBSD here.

mgorny updated this revision to Diff 179031.Dec 20 2018, 2:35 AM
mgorny marked 2 inline comments as done.
mgorny added inline comments.
lib/Basic/Targets/ARM.cpp
285

Good catch. Thanks!

krytarowski accepted this revision.Dec 20 2018, 2:39 AM
brad accepted this revision.Dec 20 2018, 3:39 AM
dim accepted this revision.Dec 20 2018, 4:38 AM
This revision was automatically updated to reflect the committed changes.

This causes test case failures due to no longer linking with -lrt on Linux.

lib/Driver/ToolChains/CommonArgs.cpp
606

Looks like this is missing a ! here.

This causes test case failures due to no longer linking with -lrt on Linux.

Never mind, already fixed :-) Thanks!

No problem. I'm sorry about my initial mistake. Apparently it slipped me even though I've double checked it originally.