Skip to content

Commit 1d81108

Browse files
committed
Change if-switch into a single if statement
1 parent 1b0aaef commit 1d81108

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/Target/DirectX/DXILPrepare.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,10 @@ class DXILPrepareModule : public ModulePass {
240240
for (size_t Idx = 0, End = F.arg_size(); Idx < End; ++Idx)
241241
F.removeParamAttrs(Idx, AttrMask);
242242

243-
// Match FnAttrs of lifetime intrinsics in LLVM 3.7
244-
if (F.isIntrinsic())
245-
switch (F.getIntrinsicID())
246-
case Intrinsic::lifetime_start:
247-
case Intrinsic::lifetime_end:
248-
F.removeFnAttr(Attribute::Memory);
243+
// Lifetime intrinsics in LLVM 3.7 do not have the memory FnAttr
244+
if (Intrinsic::ID IID = F.getIntrinsicID();
245+
IID == Intrinsic::lifetime_start || IID == Intrinsic::lifetime_end)
246+
F.removeFnAttr(Attribute::Memory);
249247

250248
for (auto &BB : F) {
251249
IRBuilder<> Builder(&BB);

0 commit comments

Comments
 (0)