Skip to content

Commit 446d1c1

Browse files
committed
[NFC] Revert SmallVector<T> -> SmallVector<T, N> fixes
With the change to include `SmallVector.h` directly in `LLVM.h` rather than forward declaring in the only case it matters (ie. Clang <= 5), these fixes are no longer needed. Since defaulted version is preferred when there's no better choice (which is presumably the case if that's how they were originally added), use it instead. Some uses were instead changed to add `llvm::` so remove that too.
1 parent 44a1fe8 commit 446d1c1

File tree

11 files changed

+14
-14
lines changed

11 files changed

+14
-14
lines changed

lib/AST/RequirementMachine/ConcreteContraction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Optional<Type> ConcreteContraction::substTypeParameterRec(
301301

302302
// An unresolved DependentMemberType stores an identifier. Handle this
303303
// by performing a name lookup into the base type.
304-
SmallVector<TypeDecl *, 2> concreteDecls;
304+
SmallVector<TypeDecl *> concreteDecls;
305305
lookupConcreteNestedType(*substBaseType, memberType->getName(), concreteDecls);
306306

307307
auto *typeDecl = findBestConcreteNestedType(concreteDecls);

lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ Type TypeBase::lookThroughAllOptionalTypes(SmallVectorImpl<Type> &optionals){
882882
}
883883

884884
unsigned int TypeBase::getOptionalityDepth() {
885-
SmallVector<Type, 4> types;
885+
SmallVector<Type> types;
886886
lookThroughAllOptionalTypes(types);
887887
return types.size();
888888
}

lib/ClangImporter/ClangDerivedConformances.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static ValueDecl *getEqualEqualOperator(NominalTypeDecl *decl) {
8888
// If no member `func ==` was found, look for out-of-class definitions in the
8989
// same module.
9090
auto module = decl->getModuleContext();
91-
llvm::SmallVector<ValueDecl *> nonMemberResults;
91+
SmallVector<ValueDecl *> nonMemberResults;
9292
module->lookupValue(id, NLKind::UnqualifiedLookup, nonMemberResults);
9393
for (const auto &nonMember : nonMemberResults) {
9494
if (isValid(nonMember))

lib/DriverTool/swift_symbolgraph_extract_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args,
241241
// don't need to print these errors.
242242
CI.removeDiagnosticConsumer(&DiagPrinter);
243243

244-
SmallVector<ModuleDecl *, 8> Overlays;
244+
SmallVector<ModuleDecl *> Overlays;
245245
M->findDeclaredCrossImportOverlaysTransitive(Overlays);
246246
for (const auto *OM : Overlays) {
247247
auto CIM = CI.getASTContext().getModuleByName(OM->getNameStr());

lib/IRGen/IRGenModule.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ class IRGenModule {
777777

778778
#ifdef CHECK_RUNTIME_EFFECT_ANALYSIS
779779
RuntimeEffect effectOfRuntimeFuncs = RuntimeEffect::NoEffect;
780-
llvm::SmallVector<const char *> emittedRuntimeFuncs;
780+
SmallVector<const char *> emittedRuntimeFuncs;
781781

782782
void registerRuntimeEffect(ArrayRef<RuntimeEffect> realtime,
783783
const char *funcName);
@@ -1263,7 +1263,7 @@ class IRGenModule {
12631263
void emitLazyObjCProtocolDefinitions();
12641264
void emitLazyObjCProtocolDefinition(ProtocolDecl *proto);
12651265

1266-
llvm::SmallVector<llvm::MDNode *> UsedConditionals;
1266+
SmallVector<llvm::MDNode *> UsedConditionals;
12671267
void emitUsedConditionals();
12681268

12691269
void emitGlobalLists();

lib/SIL/IR/SILArgument.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ bool SILPhiArgument::visitTransitiveIncomingPhiOperands(
236236
worklist.initialize(this);
237237

238238
while (auto *argument = worklist.pop()) {
239-
llvm::SmallVector<Operand *> operands;
239+
SmallVector<Operand *> operands;
240240
argument->getIncomingPhiOperands(operands);
241241

242242
for (auto *operand : operands) {

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ void StackAllocationPromoter::fixPhiPredBlock(BlockSetVector &phiBlocks,
919919

920920
LLVM_DEBUG(llvm::dbgs() << "*** Found the definition: " << def.stored);
921921

922-
llvm::SmallVector<SILValue> vals;
922+
SmallVector<SILValue> vals;
923923
vals.push_back(def.stored);
924924
if (shouldAddLexicalLifetime(asi)) {
925925
vals.push_back(def.borrow);
@@ -964,7 +964,7 @@ void StackAllocationPromoter::propagateLiveness(
964964
// If liveness has not been propagated, go over the incoming operands and mark
965965
// any operand values that are proactivePhis as live
966966
livePhis.insert(proactivePhi);
967-
SmallVector<SILValue, 4> incomingPhiVals;
967+
SmallVector<SILValue> incomingPhiVals;
968968
proactivePhi->getIncomingPhiValues(incomingPhiVals);
969969
for (auto &inVal : incomingPhiVals) {
970970
auto *inPhi = dyn_cast<SILPhiArgument>(inVal);

lib/SILOptimizer/Utils/LexicalDestroyFolding.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,11 @@ bool findIntroducerUsage(Context const &, IntroducerUsage &);
275275
/// How %borrowee is used.
276276
struct BorroweeUsage final {
277277
/// The operands that are uses of the borrowee.
278-
SmallVector<Operand *, 16> uses;
278+
SmallVector<Operand *> uses;
279279
/// The instructions that are users of the borrowee.
280280
///
281281
/// A set of the users of uses for fast membership checking.
282-
SmallPtrSet<SILInstruction *, 16> users;
282+
SmallPtrSet<SILInstruction *> users;
283283
};
284284

285285
/// Find all uses of %borrowee that are dominated by introducer.

lib/Sema/BuilderTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ class ResultBuilderTransform
13551355
}
13561356
} else {
13571357
auto *elseBraceStmt = cast<BraceStmt>(elseStmt);
1358-
SmallVector<ASTNode, 4> elseBody;
1358+
SmallVector<ASTNode> elseBody;
13591359

13601360
std::tie(elseVar, unsupported) = transform(elseBraceStmt, elseBody);
13611361
if (unsupported) {

lib/Sema/CSClosure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Expr *getVoidExpr(ASTContext &ctx, SourceLoc contextLoc = SourceLoc()) {
4040
/// Find any type variable references inside of an AST node.
4141
class TypeVariableRefFinder : public ASTWalker {
4242
/// A stack of all closures the walker encountered so far.
43-
SmallVector<DeclContext *, 2> ClosureDCs;
43+
SmallVector<DeclContext *> ClosureDCs;
4444

4545
ConstraintSystem &CS;
4646
ASTNode Parent;

tools/swift-refactor/swift-refactor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ int main(int argc, char *argv[]) {
449449
return 1;
450450
}
451451

452-
SmallVector<std::unique_ptr<SourceEditConsumer>, 32> Consumers;
452+
SmallVector<std::unique_ptr<SourceEditConsumer>> Consumers;
453453
if (!options::RewrittenOutputFile.empty() ||
454454
options::DumpIn == options::DumpType::REWRITTEN) {
455455
Consumers.emplace_back(new SourceEditOutputConsumer(

0 commit comments

Comments
 (0)