[PATCH] D44589: [Sema] Make deprecation fix-it replace all multi-parameter ObjC method slots.
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 16 15:52:41 PDT 2018
aaron.ballman added a reviewer: rsmith.
aaron.ballman added inline comments.
================
Comment at: clang/include/clang/Sema/DelayedDiagnostic.h:198-199
+ assert(Kind == Availability && "Not an availability diagnostic.");
+ return MultiSourceLocation(ArrayRef<SourceLocation>(
+ AvailabilityData.SelectorLocs, AvailabilityData.NumSelectorLocs));
+ }
----------------
You can use `makeArrayRef()` here instead of the explicit template argument constructor.
================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:7196
+ SmallVector<StringRef, 12> SelectorSlotNames;
+ auto NumParams = parseObjCMethodName(Replacement, SelectorSlotNames,
+ S.getLangOpts());
----------------
Do not use `auto` here, as the type is not explicitly spelled out in the initialization.
================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:7207-7217
+ } else {
+ FixIts.push_back(FixItHint::CreateInsertion(
+ SelectorLocs[I], SelectorSlotNames[I]));
+ }
+ }
+ } else {
+ FixIts.push_back(FixItHint::CreateReplacement(UseRange, Replacement));
----------------
You can elide a lot of braces here.
https://reviews.llvm.org/D44589
More information about the cfe-commits
mailing list