Skip to content

Commit 821c2cb

Browse files
committed
Merge pull request #1796 from danra/swift_basic_sanitize
Canonicalize swift header files headers and footers
2 parents 023eaa6 + 29d76f3 commit 821c2cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+108
-107
lines changed

include/swift/Basic/Algorithm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ namespace swift {
3232
}
3333
} // end namespace swift
3434

35-
#endif /* SWIFT_BASIC_ALGORITHM_H */
35+
#endif // SWIFT_BASIC_ALGORITHM_H

include/swift/Basic/ArrayRefView.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ class ArrayRefView {
100100
}
101101
};
102102

103-
} // namespace swift
103+
} // end namespace swift
104104

105-
#endif /* SWIFT_BASIC_ARRAYREFVIEW_H */
105+
#endif // SWIFT_BASIC_ARRAYREFVIEW_H

include/swift/Basic/AssertImplements.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18-
#ifndef SWIFT_BASIC_ASSERT_IMPLEMENTS_H
19-
#define SWIFT_BASIC_ASSERT_IMPLEMENTS_H
18+
#ifndef SWIFT_BASIC_ASSERTIMPLEMENTS_H
19+
#define SWIFT_BASIC_ASSERTIMPLEMENTS_H
2020

2121
#include <type_traits>
2222

@@ -61,4 +61,4 @@ namespace swift {
6161

6262
} // end namespace swift
6363

64-
#endif // SWIFT_BASIC_ASSERT_IMPLEMENTS_H
64+
#endif // SWIFT_BASIC_ASSERTIMPLEMENTS_H

include/swift/Basic/Cache.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ struct CacheValueInfo<llvm::IntrusiveRefCntPtr<T>>{
226226
}
227227
};
228228

229-
} // namespace sys
230-
} // namespace swift
229+
} // end namespace sys
230+
} // end namespace swift
231231

232-
#endif
232+
#endif // SWIFT_BASIC_CACHE_H

include/swift/Basic/ClusteredBitVector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,4 +672,4 @@ class ClusteredBitVector {
672672

673673
} // end namespace swift
674674

675-
#endif
675+
#endif // SWIFT_BASIC_CLUSTEREDBITVECTOR_H

include/swift/Basic/Defer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18-
#ifndef __SWIFT_DEFER_H
19-
#define __SWIFT_DEFER_H
18+
#ifndef SWIFT_BASIC_DEFER_H
19+
#define SWIFT_BASIC_DEFER_H
2020

2121
#include <type_traits>
2222

@@ -39,7 +39,7 @@ namespace swift {
3939
return DoAtScopeExit<typename std::decay<F>::type>(fn);
4040
}
4141
}
42-
}
42+
} // end namespace swift
4343

4444

4545
#define DEFER_CONCAT_IMPL(x, y) x##y
@@ -57,5 +57,5 @@ namespace swift {
5757
/// };
5858
///
5959
#define defer defer_impl
60-
#endif
6160

61+
#endif // SWIFT_BASIC_DEFER_H

include/swift/Basic/Demangle.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,5 +418,4 @@ static inline bool isDigit(int c) {
418418
} // end namespace Demangle
419419
} // end namespace swift
420420

421-
#endif
422-
421+
#endif // SWIFT_BASIC_DEMANGLE_H

include/swift/Basic/DemangleWrappers.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
///
1717
//===----------------------------------------------------------------------===//
1818

19-
#ifndef SWIFT_BASIC_DEMANGLE_WRAPPERS_H
20-
#define SWIFT_BASIC_DEMANGLE_WRAPPERS_H
19+
#ifndef SWIFT_BASIC_DEMANGLEWRAPPERS_H
20+
#define SWIFT_BASIC_DEMANGLEWRAPPERS_H
2121

2222
#include "swift/Basic/Demangle.h"
2323
#include "swift/Basic/LLVM.h"
@@ -57,5 +57,4 @@ demangleTypeAsString(StringRef MangledTypeName,
5757
} // end namespace demangle_wrappers
5858
} // end namespace swift
5959

60-
#endif // LLVM_SWIFT_BASIC_DEMANGLE_WRAPPERS_H
61-
60+
#endif // SWIFT_BASIC_DEMANGLEWRAPPERS_H

include/swift/Basic/DiagnosticConsumer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
//
1717
//===----------------------------------------------------------------------===//
1818

19-
#ifndef SWIFT_BASIC_DIAGNOSTIC_CONSUMER_H
20-
#define SWIFT_BASIC_DIAGNOSTIC_CONSUMER_H
19+
#ifndef SWIFT_BASIC_DIAGNOSTICCONSUMER_H
20+
#define SWIFT_BASIC_DIAGNOSTICCONSUMER_H
2121

2222
#include "swift/Basic/SourceLoc.h"
2323
#include "llvm/Support/SourceMgr.h"
@@ -103,6 +103,6 @@ class NullDiagnosticConsumer : public DiagnosticConsumer {
103103
const DiagnosticInfo &Info) override;
104104
};
105105

106-
}
106+
} // end namespace swift
107107

108-
#endif
108+
#endif // SWIFT_BASIC_DIAGNOSTICCONSUMER_H

include/swift/Basic/DiagnosticOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ class DiagnosticOptions {
4343
bool WarningsAsErrors = false;
4444
};
4545

46-
}
46+
} // end namespace swift
4747

48-
#endif
48+
#endif // SWIFT_BASIC_DIAGNOSTICOPTIONS_H

include/swift/Basic/DiverseList.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
//
1818
//===----------------------------------------------------------------------===//
1919

20-
#ifndef SWIFT_IRGEN_DIVERSELIST_H
21-
#define SWIFT_IRGEN_DIVERSELIST_H
20+
#ifndef SWIFT_BASIC_DIVERSELIST_H
21+
#define SWIFT_BASIC_DIVERSELIST_H
2222

2323
#include "swift/Basic/Malloc.h"
2424
#include <cassert>
@@ -284,4 +284,4 @@ template <class T> class DiverseListImpl : private DiverseListBase {
284284

285285
} // end namespace swift
286286

287-
#endif
287+
#endif // SWIFT_BASIC_DIVERSELIST_H

include/swift/Basic/DiverseStack.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
//
1818
//===----------------------------------------------------------------------===//
1919

20-
#ifndef SWIFT_IRGEN_DIVERSESTACK_H
21-
#define SWIFT_IRGEN_DIVERSESTACK_H
20+
#ifndef SWIFT_BASIC_DIVERSESTACK_H
21+
#define SWIFT_BASIC_DIVERSESTACK_H
2222

2323
#include "swift/Basic/Malloc.h"
2424
#include "llvm/Support/PointerLikeTypeTraits.h"
@@ -380,4 +380,4 @@ namespace llvm {
380380
};
381381
}
382382

383-
#endif
383+
#endif // SWIFT_BASIC_DIVERSESTACK_H

include/swift/Basic/Dwarf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ namespace swift {
2828
static const char MachOASTSectionName[] = "__ast";
2929
static const char ELFASTSectionName[] = ".swift_ast";
3030
static const char COFFASTSectionName[] = "swiftast";
31-
}
31+
} // end namespace swift
3232

33-
#endif
33+
#endif // SWIFT_BASIC_DWARF_H

include/swift/Basic/EditorPlaceholder.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ struct EditorPlaceholderData {
4646
Optional<EditorPlaceholderData>
4747
parseEditorPlaceholder(StringRef PlaceholderText);
4848

49-
} // namespace swift
50-
51-
#endif // LLVM_SWIFT_BASIC_EDITORPLACEHOLDER_H
49+
} // end namespace swift
5250

51+
#endif // SWIFT_BASIC_EDITORPLACEHOLDER_H

include/swift/Basic/EncodedSequence.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,4 +371,4 @@ class EncodedSequence : public EncodedSequenceBase {
371371

372372
} // end namespace swift
373373

374-
#endif
374+
#endif // SWIFT_BASIC_ENCODEDSEQUENCE_H

include/swift/Basic/Fallthrough.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
//
1818
//===----------------------------------------------------------------------===//
1919

20-
#ifndef __SWIFT_FALLTHROUGH_H__
21-
#define __SWIFT_FALLTHROUGH_H__
20+
#ifndef SWIFT_BASIC_FALLTHROUGH_H
21+
#define SWIFT_BASIC_FALLTHROUGH_H
2222

2323
#ifndef __has_attribute
2424
# define __has_attribute(x) 0
@@ -36,4 +36,4 @@
3636
# define SWIFT_FALLTHROUGH
3737
#endif
3838

39-
#endif
39+
#endif // SWIFT_BASIC_FALLTHROUGH_H

include/swift/Basic/FileSystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ namespace swift {
2424
/// the file at \p source will still be present at \p source.
2525
std::error_code moveFileIfDifferent(const llvm::Twine &source,
2626
const llvm::Twine &destination);
27-
}
27+
} // end namespace swift
2828

29-
#endif
29+
#endif // SWIFT_BASIC_FILESYSTEM_H

include/swift/Basic/FlaggedPointer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616
//
17-
#ifndef SWIFT_RUNTIME_FLAGGEDPOINTER_H
18-
#define SWIFT_RUNTIME_FLAGGEDPOINTER_H
17+
#ifndef SWIFT_BASIC_FLAGGEDPOINTER_H
18+
#define SWIFT_BASIC_FLAGGEDPOINTER_H
1919

2020
#include <cassert>
2121

@@ -148,7 +148,7 @@ class FlaggedPointer {
148148
}
149149
};
150150

151-
};
151+
} // end namespace swift
152152

153153
// Teach SmallPtrSet that FlaggedPointer is "basically a pointer".
154154
template <typename PointerTy, unsigned BitPosition, typename PtrTraits>
@@ -175,4 +175,4 @@ class llvm::PointerLikeTypeTraits<
175175
};
176176
};
177177

178-
#endif
178+
#endif // SWIFT_BASIC_FLAGGEDPOINTER_H

include/swift/Basic/ImmutablePointerSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,4 @@ ImmutablePointerSet<T> ImmutablePointerSetFactory<T>::EmptyPtrSet =
349349

350350
} // end swift namespace
351351

352-
#endif
352+
#endif // SWIFT_BASIC_IMMUTABLEPOINTERSET_H

include/swift/Basic/JSONSerialization.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,4 +626,4 @@ operator<<(Output &yout, T &seq) {
626626
} // end namespace json
627627
} // end namespace swift
628628

629-
#endif
629+
#endif // SWIFT_BASIC_JSONSERIALIZATION_H

include/swift/Basic/LLVM.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18-
#ifndef SWIFT_AST_LLVM_H
19-
#define SWIFT_AST_LLVM_H
18+
#ifndef SWIFT_BASIC_LLVM_H
19+
#define SWIFT_BASIC_LLVM_H
2020

2121
// Do not proliferate #includes here, require clients to #include their
2222
// dependencies.
@@ -79,4 +79,4 @@ namespace swift {
7979
using llvm::NoneType;
8080
} // end namespace swift
8181

82-
#endif
82+
#endif // SWIFT_BASIC_LLVM_H

include/swift/Basic/LLVMInitialize.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
llvm::InitializeAllDisassemblers(); \
4141
llvm::InitializeAllTargetInfos();
4242

43-
#endif
43+
#endif // SWIFT_BASIC_LLVMINITIALIZE_H

include/swift/Basic/LangOptions.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18-
#ifndef SWIFT_LANGOPTIONS_H
19-
#define SWIFT_LANGOPTIONS_H
18+
#ifndef SWIFT_BASIC_LANGOPTIONS_H
19+
#define SWIFT_BASIC_LANGOPTIONS_H
2020

2121
#include "swift/Basic/LLVM.h"
2222
#include "clang/Basic/VersionTuple.h"
@@ -245,7 +245,6 @@ namespace swift {
245245
PlatformConditionValues;
246246
llvm::SmallVector<std::string, 2> CustomConditionalCompilationFlags;
247247
};
248-
}
249-
250-
#endif // SWIFT_LANGOPTIONS_H
248+
} // end namespace swift
251249

250+
#endif // SWIFT_BASIC_LANGOPTIONS_H

include/swift/Basic/Lazy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ template <typename T> inline T &Lazy<T>::get(void (*initCallback)(void*)) {
7979
return unsafeGetAlreadyInitialized();
8080
}
8181

82-
} // namespace swift
82+
} // end namespace swift
8383

8484
#define SWIFT_LAZY_CONSTANT(INITIAL_VALUE) \
8585
([]{ \

include/swift/Basic/NullablePtr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ class NullablePtr {
6464

6565
} // end namespace swift
6666

67-
#endif
67+
#endif // SWIFT_BASIC_NULLABLEPTR_H

include/swift/Basic/OptionSet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ class OptionSet {
131131
"operator| should produce an OptionSet");
132132
};
133133

134-
}
134+
} // end namespace swift
135135

136-
#endif
136+
#endif // SWIFT_BASIC_OPTIONSET_H

include/swift/Basic/OptionalEnum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ namespace swift {
8383
return (intptr_t)Storage;
8484
}
8585
};
86-
}
86+
} // end namespace swift
8787

88-
#endif
88+
#endif // SWIFT_BASIC_OPTIONALENUM_H

include/swift/Basic/Platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ namespace swift {
5757

5858
/// Returns the platform Kind for Darwin triples.
5959
DarwinPlatformKind getDarwinPlatformKind(const llvm::Triple &triple);
60-
}
60+
} // end namespace swift
6161

6262
#endif // SWIFT_BASIC_PLATFORM_H
6363

include/swift/Basic/PointerIntEnum.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#ifndef SWIFT_BASIC_POINTERINTENUM_H
14+
#define SWIFT_BASIC_POINTERINTENUM_H
15+
1316
#include "swift/Basic/LLVM.h"
1417
#include "llvm/ADT/Optional.h"
1518
#include "llvm/Support/PointerLikeTypeTraits.h"
@@ -223,3 +226,5 @@ class PointerIntEnum {
223226
};
224227

225228
} // end swift namespace
229+
230+
#endif // SWIFT_BASIC_POINTERINTENUM_H

include/swift/Basic/PrefixMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,4 +679,4 @@ class PrefixMapKeyPrinter<unsigned char> {
679679

680680
} // end namespace swift
681681

682-
#endif
682+
#endif // SWIFT_BASIC_PREFIXMAP_H

include/swift/Basic/PrettyStackTrace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ class PrettyStackTraceStringAction : public llvm::PrettyStackTraceEntry {
3131
void print(llvm::raw_ostream &OS) const override;
3232
};
3333

34-
}
34+
} // end namespace swift
3535

36-
#endif
36+
#endif // SWIFT_BASIC_PRETTYSTACKTRACE_H

include/swift/Basic/PrimitiveParsing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static inline void splitIntoLines(StringRef Text,
4242
trimLeadingWhitespaceFromLines(Text, 0, Lines);
4343
}
4444

45-
} // namespace swift
45+
} // end namespace swift
4646

47-
#endif // LLVM_SWIFT_BASIC_PRIMITIVEPARSING_H
47+
#endif // SWIFT_BASIC_PRIMITIVEPARSING_H
4848

include/swift/Basic/Program.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ int ExecuteInPlace(const char *Program, const char **args,
3535

3636
} // end namespace swift
3737

38-
#endif
38+
#endif // SWIFT_BASIC_PROGRAM_H

include/swift/Basic/Punycode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ bool decodePunycodeUTF8(StringRef InputPunycode, std::string &OutUTF8);
5252
} // end namespace Punycode
5353
} // end namespace swift
5454

55-
#endif // LLVM_SWIFT_BASIC_PUNYCODE_H
55+
#endif // SWIFT_BASIC_PUNYCODE_H
5656

0 commit comments

Comments
 (0)