Skip to content

[gardening] Put white spaces in between if/while clauses and braces where it is missing. #2025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


// Listen to the load event for the document.
if (window.addEventListener){
if (window.addEventListener) {
window.addEventListener('load', onload_handler, false);
} else if (window.attachEvent) {
window.attachEvent('onload', onload_handler);
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/TypeMatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class TypeMatcher {

template<typename FirstMetatypeType>
bool handleAnyMetatypeType(CanTypeWrapper<FirstMetatypeType> firstMeta,
Type secondType){
Type secondType) {
if (auto secondMeta = secondType->getAs<FirstMetatypeType>()) {
if (firstMeta->getKind() != secondMeta->getKind())
return mismatch(firstMeta.getPointer(), secondMeta);
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Reflection/ReflectionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class ReflectionContext {
return 0;
}

TypeRefVector getGenericSubst(StoredPointer MetadataAddress){
TypeRefVector getGenericSubst(StoredPointer MetadataAddress) {
StoredPointer DescriptorAddress;
SharedTargetNominalTypeDescriptorRef<Runtime> Descriptor;
std::tie(Descriptor, DescriptorAddress)
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Reflection/TypeRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ class TypeRefSubstitution
}

TypeRefPointer
visitGenericTypeParameterTypeRef(const GenericTypeParameterTypeRef *GTP){
visitGenericTypeParameterTypeRef(const GenericTypeParameterTypeRef *GTP) {
return Substitutions[{GTP->getDepth(), GTP->getIndex()}];
}

Expand Down
4 changes: 2 additions & 2 deletions lib/AST/ASTPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ struct SynthesizedExtensionAnalyzer::Implementation {
return {Result, MergeInfo};
}
assert(Ext->getGenericParams() && "No generic params.");
for (auto Req : Ext->getGenericParams()->getRequirements()){
for (auto Req : Ext->getGenericParams()->getRequirements()) {
auto TupleOp = Req.getAsAnalyzedWrittenString();
if (!TupleOp)
continue;
Expand Down Expand Up @@ -536,7 +536,7 @@ struct SynthesizedExtensionAnalyzer::Implementation {
std::unique_ptr<ExtensionInfoMap> InfoMap(new ExtensionInfoMap());
ExtensionMergeInfoMap MergeInfoMap;
std::vector<NominalTypeDecl*> Unhandled;
auto addTypeLocNominal = [&](TypeLoc TL){
auto addTypeLocNominal = [&](TypeLoc TL) {
if (TL.getType()) {
if (auto D = TL.getType()->getAnyNominal()) {
Unhandled.push_back(D);
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void Decl::setDeclContext(DeclContext *DC) {
}

bool Decl::isUserAccessible() const {
if (auto VD = dyn_cast<VarDecl>(this)){
if (auto VD = dyn_cast<VarDecl>(this)) {
return VD->isUserAccessible();
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion lib/Frontend/SerializedDiagnosticConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static void emitBlockID(unsigned ID, const char *Name,
/// \brief Emits a record ID in the BLOCKINFO block.
static void emitRecordID(unsigned ID, const char *Name,
llvm::BitstreamWriter &Stream,
RecordDataImpl &Record){
RecordDataImpl &Record) {
Record.clear();
Record.push_back(ID);

Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/SILPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ class SILPrinter : public SILVisitor<SILPrinter> {
*this << "switch_enum ";
printSwitchEnumInst(SOI);
}
void visitSwitchEnumAddrInst(SwitchEnumAddrInst *SOI){
void visitSwitchEnumAddrInst(SwitchEnumAddrInst *SOI) {
*this << "switch_enum_addr ";
printSwitchEnumInst(SOI);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/SILVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2641,7 +2641,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
"switch_enum default destination must take no arguments");
}

void checkSwitchEnumAddrInst(SwitchEnumAddrInst *SOI){
void checkSwitchEnumAddrInst(SwitchEnumAddrInst *SOI) {
require(SOI->getOperand()->getType().isAddress(),
"switch_enum_addr operand must be an address");

Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Analysis/ARCAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ findMatchingRetains(SILBasicBlock *BB) {
if (SA && SA->getParent() != R.first)
SA = nullptr;

for (auto X : R.first->getPreds()){
for (auto X : R.first->getPreds()) {
if (HandledBBs.find(X) != HandledBBs.end())
continue;
// Try to use the predecessor edge-value.
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/LoopTransforms/ArrayBoundsCheckOpts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ static bool hoistBoundsChecks(SILLoop *Loop, DominanceInfo *DT, SILLoopInfo *LI,
// Find canonical induction variables.
InductionAnalysis IndVars(DT, IVs, Preheader, Header, ExitingBlk, ExitBlk);
bool IVarsFound = IndVars.analyse();
if (!IVarsFound){
if (!IVarsFound) {
DEBUG(llvm::dbgs() << "No induction variables found\n");
}

Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/LoopTransforms/LICM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static bool hoistInstructions(SILLoop *Loop, DominanceInfo *DT,
DEBUG(llvm::dbgs() << " hoisting to preheader.\n");
Changed = true;
Inst->moveBefore(Preheader->getTerminator());
} else if (RunsOnHighLevelSil){
} else if (RunsOnHighLevelSil) {
ArraySemanticsCall semCall(Inst);
switch (semCall.getKind()) {
case ArrayCallKind::kGetCount:
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Mandatory/DIMemoryUseCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ bool DIMemoryUse::
onlyTouchesTrivialElements(const DIMemoryObjectInfo &MI) const {
auto &Module = Inst->getModule();

for (unsigned i = FirstElement, e = i+NumElements; i != e; ++i){
for (unsigned i = FirstElement, e = i+NumElements; i != e; ++i) {
// Skip 'super.init' bit
if (i == MI.getNumMemoryElements())
return false;
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Mandatory/DataflowDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void diagnoseMissingReturn(const UnreachableInst *UI,

static void diagnoseUnreachable(const SILInstruction *I,
ASTContext &Context) {
if (auto *UI = dyn_cast<UnreachableInst>(I)){
if (auto *UI = dyn_cast<UnreachableInst>(I)) {
SILLocation L = UI->getLoc();

// Invalid location means that the instruction has been generated by SIL
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Transforms/RemovePin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class RemovePinInsts : public SILFunctionTransform {
SILValue RCId = RCIA->getRCIdentityRoot(Unpin->getOperand());
DEBUG(llvm::dbgs() << " RCID Source: " << *RCId);
auto *PinDef = dyn_cast<StrongPinInst>(RCId);
if (PinDef && AvailablePins.count(PinDef)){
if (PinDef && AvailablePins.count(PinDef)) {
DEBUG(llvm::dbgs() << " Found matching pin: " << *PinDef);
SmallVector<MarkDependenceInst *, 8> MarkDependentInsts;
if (areSafePinUsers(PinDef, Unpin, MarkDependentInsts)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/CSGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@ namespace {
Type visitUnresolvedDotExpr(UnresolvedDotExpr *expr) {
// Open a member constraint for constructor delegations on the
// subexpr type.
if (CS.TC.getSelfForInitDelegationInConstructor(CS.DC, expr)){
if (CS.TC.getSelfForInitDelegationInConstructor(CS.DC, expr)) {
auto baseTy = expr->getBase()->getType()
->getLValueOrInOutObjectType();

Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeCheckPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ bool TypeChecker::typeCheckPattern(Pattern *P, DeclContext *dc,
for (unsigned i = 0, e = tuplePat->getNumElements(); i != e; ++i) {
TuplePatternElt &elt = tuplePat->getElement(i);
Pattern *pattern = elt.getPattern();
if (typeCheckPattern(pattern, dc, elementOptions, resolver)){
if (typeCheckPattern(pattern, dc, elementOptions, resolver)) {
hadError = true;
continue;
}
Expand Down