Skip to content

Commit 13eb481

Browse files
committed
Basic: simplify runtime type selection (NFC)
Rather than an if repeating the condition, simplify using a ternary for the value. NFC.
1 parent 108630d commit 13eb481

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/Basic/LangOptions.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,8 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
302302
}
303303

304304
// Set the "runtime" platform condition.
305-
if (EnableObjCInterop)
306-
addPlatformConditionValue(PlatformConditionKind::Runtime, "_ObjC");
307-
else
308-
addPlatformConditionValue(PlatformConditionKind::Runtime, "_Native");
305+
addPlatformConditionValue(PlatformConditionKind::Runtime,
306+
EnableObjCInterop ? "_ObjC" : "_Native");
309307

310308
// Set the "targetEnvironment" platform condition if targeting a simulator
311309
// environment. Otherwise _no_ value is present for targetEnvironment; it's

0 commit comments

Comments
 (0)