Skip to content

Revert "Putting white spaces in between if/while clauses and braces." #2023

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/AvailabilitySpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class VersionConstraintAvailabilitySpec : public AvailabilitySpec {

void *
operator new(size_t Bytes, ASTContext &C,
unsigned Alignment = alignof(VersionConstraintAvailabilitySpec)) {
unsigned Alignment = alignof(VersionConstraintAvailabilitySpec)){
return AvailabilitySpec::operator new(Bytes, C, Alignment);
}
};
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/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/Mandatory/DiagnoseUnreachable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ static bool simplifyBlocksWithCallsToNoReturn(SILBasicBlock &BB,

// Record the diagnostic info.
if (!DiagnosedUnreachableCode &&
NoReturnCall->getLoc().is<RegularLocation>() && State) {
NoReturnCall->getLoc().is<RegularLocation>() && State){
for (auto SI = BB.succ_begin(), SE = BB.succ_end(); SI != SE; ++SI) {
SILBasicBlock *UnreachableBlock = *SI;
if (!State->PossiblyUnreachableBlocks.count(UnreachableBlock)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ getConformanceAndConcreteType(FullApplySite AI,
Conformances = IER->getConformances();
ConcreteType = IER->getFormalConcreteType();
NewSelf = IER->getOperand();
} else if (auto IEM = dyn_cast<InitExistentialMetatypeInst>(InitExistential)) {
} else if (auto IEM = dyn_cast<InitExistentialMetatypeInst>(InitExistential)){
Conformances = IEM->getConformances();
NewSelf = IEM->getOperand();
ConcreteType = NewSelf->getType().getSwiftRValueType();
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Transforms/AllocBoxToStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ static SILInstruction* findUnexpectedBoxUse(SILValue Box,

/// canPromoteAllocBox - Can we promote this alloc_box to an alloc_stack?
static bool canPromoteAllocBox(AllocBoxInst *ABI,
llvm::SmallVectorImpl<Operand *> &PromotedOperands) {
llvm::SmallVectorImpl<Operand *> &PromotedOperands){
// Scan all of the uses of the address of the box to see if any
// disqualifies the box from being promoted to the stack.
if (auto *User = findUnexpectedBoxUse(ABI,
Expand Down
6 changes: 3 additions & 3 deletions lib/Sema/CSApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,7 @@ namespace {
case OverloadChoiceKind::DeclViaBridge: {
// Look through an implicitly unwrapped optional.
auto baseTy = base->getType()->getRValueType();
if (auto objTy = cs.lookThroughImplicitlyUnwrappedOptionalType(baseTy)) {
if (auto objTy = cs.lookThroughImplicitlyUnwrappedOptionalType(baseTy)){
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy,
cs.getConstraintLocator(base));

Expand Down Expand Up @@ -2370,7 +2370,7 @@ namespace {

case OverloadChoiceKind::TupleIndex: {
auto baseTy = base->getType()->getRValueType();
if (auto objTy = cs.lookThroughImplicitlyUnwrappedOptionalType(baseTy)) {
if (auto objTy = cs.lookThroughImplicitlyUnwrappedOptionalType(baseTy)){
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy,
cs.getConstraintLocator(base));
}
Expand Down Expand Up @@ -4658,7 +4658,7 @@ maybeDiagnoseUnsupportedFunctionConversion(TypeChecker &tc, Expr *expr,
// capture context. Look through ignored bases too.
// TODO: Look through static method applications to the type.
auto semanticExpr = expr->getSemanticsProvidingExpr();
while (auto ignoredBase = dyn_cast<DotSyntaxBaseIgnoredExpr>(semanticExpr)) {
while (auto ignoredBase = dyn_cast<DotSyntaxBaseIgnoredExpr>(semanticExpr)){
semanticExpr = ignoredBase->getRHS()->getSemanticsProvidingExpr();
}

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
4 changes: 2 additions & 2 deletions lib/Sema/MiscDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E,
return;

if (auto *parentExpr = Parent.getAsExpr()) {
if (auto *ignoredBase = dyn_cast<DotSyntaxBaseIgnoredExpr>(parentExpr)) {
if (auto *ignoredBase = dyn_cast<DotSyntaxBaseIgnoredExpr>(parentExpr)){
if (!ignoredBase->isImplicit())
return;
}
Expand Down Expand Up @@ -2091,7 +2091,7 @@ class ObjCSelectorWalker : public ASTWalker {
if (auto ctorRefCall =
dyn_cast<ConstructorRefCallExpr>(argCall->getFn())) {
if (auto argCtor =
dyn_cast_or_null<ConstructorDecl>(ctorRefCall->getCalledValue())) {
dyn_cast_or_null<ConstructorDecl>(ctorRefCall->getCalledValue())){
auto argArgumentNames = argCtor->getFullName().getArgumentNames();
if (argArgumentNames.size() == 3 &&
argArgumentNames[0] == TC.Context.Id_builtinStringLiteral)
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/PlaygroundTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ class Instrumenter {
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(*RE)) {
VarDecl *VD = cast<VarDecl>(DRE->getDecl());

if (isa<ConstructorDecl>(TypeCheckDC) && VD->getNameStr().equals("self")) {
if (isa<ConstructorDecl>(TypeCheckDC) && VD->getNameStr().equals("self")){
// Don't log "self" in a constructor
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeCheckConstraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2708,7 +2708,7 @@ CheckedCastKind TypeChecker::typeCheckCheckedCast(Type fromType,
}

// If we can bridge through an Objective-C class, do so.
if (Type objCClass = getDynamicBridgedThroughObjCClass(dc, fromType, toType)) {
if (Type objCClass = getDynamicBridgedThroughObjCClass(dc, fromType, toType)){
if (isSubtypeOf(objCClass, fromType, dc))
return CheckedCastKind::BridgeFromObjectiveC;
}
Expand Down