Canonize swift header files headers and footers

- Added missing ifdef guard in PointerIntEnum header
- Consistent naming convention for ifdef guards
- Consistent 'end namespace swift'
- Consistent single EOL at end of header files
This commit is contained in:
Dan Raviv
2016-03-22 23:42:39 +02:00
parent f79a741a7d
commit 29d76f3b68
52 changed files with 108 additions and 107 deletions

View File

@@ -26,4 +26,4 @@ namespace swift {
}
} // end namespace swift
#endif /* SWIFT_BASIC_ALGORITHM_H */
#endif // SWIFT_BASIC_ALGORITHM_H

View File

@@ -100,6 +100,6 @@ public:
}
};
} // namespace swift
} // end namespace swift
#endif /* SWIFT_BASIC_ARRAYREFVIEW_H */
#endif // SWIFT_BASIC_ARRAYREFVIEW_H

View File

@@ -15,8 +15,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_ASSERT_IMPLEMENTS_H
#define SWIFT_BASIC_ASSERT_IMPLEMENTS_H
#ifndef SWIFT_BASIC_ASSERTIMPLEMENTS_H
#define SWIFT_BASIC_ASSERTIMPLEMENTS_H
#include <type_traits>
@@ -61,4 +61,4 @@ namespace swift {
} // end namespace swift
#endif // SWIFT_BASIC_ASSERT_IMPLEMENTS_H
#endif // SWIFT_BASIC_ASSERTIMPLEMENTS_H

View File

@@ -226,7 +226,7 @@ struct CacheValueInfo<llvm::IntrusiveRefCntPtr<T>>{
}
};
} // namespace sys
} // namespace swift
} // end namespace sys
} // end namespace swift
#endif
#endif // SWIFT_BASIC_CACHE_H

View File

@@ -674,4 +674,4 @@ private:
} // end namespace swift
#endif
#endif // SWIFT_BASIC_CLUSTEREDBITVECTOR_H

View File

@@ -15,8 +15,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef __SWIFT_DEFER_H
#define __SWIFT_DEFER_H
#ifndef SWIFT_BASIC_DEFER_H
#define SWIFT_BASIC_DEFER_H
#include <type_traits>
@@ -39,7 +39,7 @@ namespace swift {
return DoAtScopeExit<typename std::decay<F>::type>(fn);
}
}
}
} // end namespace swift
#define DEFER_CONCAT_IMPL(x, y) x##y
@@ -57,5 +57,5 @@ namespace swift {
/// };
///
#define defer defer_impl
#endif
#endif // SWIFT_BASIC_DEFER_H

View File

@@ -419,5 +419,4 @@ static inline bool isDigit(int c) {
} // end namespace Demangle
} // end namespace swift
#endif
#endif // SWIFT_BASIC_DEMANGLE_H

View File

@@ -16,8 +16,8 @@
///
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_DEMANGLE_WRAPPERS_H
#define SWIFT_BASIC_DEMANGLE_WRAPPERS_H
#ifndef SWIFT_BASIC_DEMANGLEWRAPPERS_H
#define SWIFT_BASIC_DEMANGLEWRAPPERS_H
#include "swift/Basic/Demangle.h"
#include "swift/Basic/LLVM.h"
@@ -57,5 +57,4 @@ demangleTypeAsString(StringRef MangledTypeName,
} // end namespace demangle_wrappers
} // end namespace swift
#endif // LLVM_SWIFT_BASIC_DEMANGLE_WRAPPERS_H
#endif // SWIFT_BASIC_DEMANGLEWRAPPERS_H

View File

@@ -16,8 +16,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_DIAGNOSTIC_CONSUMER_H
#define SWIFT_BASIC_DIAGNOSTIC_CONSUMER_H
#ifndef SWIFT_BASIC_DIAGNOSTICCONSUMER_H
#define SWIFT_BASIC_DIAGNOSTICCONSUMER_H
#include "swift/Basic/SourceLoc.h"
#include "llvm/Support/SourceMgr.h"
@@ -103,6 +103,6 @@ public:
const DiagnosticInfo &Info) override;
};
}
} // end namespace swift
#endif
#endif // SWIFT_BASIC_DIAGNOSTICCONSUMER_H

View File

@@ -43,6 +43,6 @@ public:
bool WarningsAsErrors = false;
};
}
} // end namespace swift
#endif
#endif // SWIFT_BASIC_DIAGNOSTICOPTIONS_H

View File

@@ -17,8 +17,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_IRGEN_DIVERSELIST_H
#define SWIFT_IRGEN_DIVERSELIST_H
#ifndef SWIFT_BASIC_DIVERSELIST_H
#define SWIFT_BASIC_DIVERSELIST_H
#include <cassert>
#include <cstring>
@@ -285,4 +285,4 @@ public:
} // end namespace swift
#endif
#endif // SWIFT_BASIC_DIVERSELIST_H

View File

@@ -17,8 +17,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_IRGEN_DIVERSESTACK_H
#define SWIFT_IRGEN_DIVERSESTACK_H
#ifndef SWIFT_BASIC_DIVERSESTACK_H
#define SWIFT_BASIC_DIVERSESTACK_H
#include "swift/Basic/Malloc.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
@@ -380,4 +380,4 @@ namespace llvm {
};
}
#endif
#endif // SWIFT_BASIC_DIVERSESTACK_H

View File

@@ -28,6 +28,6 @@ namespace swift {
static const char MachOASTSectionName[] = "__ast";
static const char ELFASTSectionName[] = ".swift_ast";
static const char COFFASTSectionName[] = "swiftast";
}
} // end namespace swift
#endif
#endif // SWIFT_BASIC_DWARF_H

View File

@@ -46,7 +46,6 @@ struct EditorPlaceholderData {
Optional<EditorPlaceholderData>
parseEditorPlaceholder(StringRef PlaceholderText);
} // namespace swift
#endif // LLVM_SWIFT_BASIC_EDITORPLACEHOLDER_H
} // end namespace swift
#endif // SWIFT_BASIC_EDITORPLACEHOLDER_H

View File

@@ -371,4 +371,4 @@ public:
} // end namespace swift
#endif
#endif // SWIFT_BASIC_ENCODEDSEQUENCE_H

View File

@@ -17,8 +17,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef __SWIFT_FALLTHROUGH_H__
#define __SWIFT_FALLTHROUGH_H__
#ifndef SWIFT_BASIC_FALLTHROUGH_H
#define SWIFT_BASIC_FALLTHROUGH_H
#ifndef __has_attribute
# define __has_attribute(x) 0
@@ -36,4 +36,4 @@
# define SWIFT_FALLTHROUGH
#endif
#endif
#endif // SWIFT_BASIC_FALLTHROUGH_H

View File

@@ -24,6 +24,6 @@ namespace swift {
/// the file at \p source will still be present at \p source.
std::error_code moveFileIfDifferent(const llvm::Twine &source,
const llvm::Twine &destination);
}
} // end namespace swift
#endif
#endif // SWIFT_BASIC_FILESYSTEM_H

View File

@@ -14,8 +14,8 @@
//
//===----------------------------------------------------------------------===//
//
#ifndef SWIFT_RUNTIME_FLAGGEDPOINTER_H
#define SWIFT_RUNTIME_FLAGGEDPOINTER_H
#ifndef SWIFT_BASIC_FLAGGEDPOINTER_H
#define SWIFT_BASIC_FLAGGEDPOINTER_H
#include <cassert>
@@ -148,7 +148,7 @@ public:
}
};
};
} // end namespace swift
// Teach SmallPtrSet that FlaggedPointer is "basically a pointer".
template <typename PointerTy, unsigned BitPosition, typename PtrTraits>
@@ -175,4 +175,4 @@ public:
};
};
#endif
#endif // SWIFT_BASIC_FLAGGEDPOINTER_H

View File

@@ -349,4 +349,4 @@ ImmutablePointerSet<T> ImmutablePointerSetFactory<T>::EmptyPtrSet =
} // end swift namespace
#endif
#endif // SWIFT_BASIC_IMMUTABLEPOINTERSET_H

View File

@@ -626,4 +626,4 @@ operator<<(Output &yout, T &seq) {
} // end namespace json
} // end namespace swift
#endif
#endif // SWIFT_BASIC_JSONSERIALIZATION_H

View File

@@ -15,8 +15,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_AST_LLVM_H
#define SWIFT_AST_LLVM_H
#ifndef SWIFT_BASIC_LLVM_H
#define SWIFT_BASIC_LLVM_H
// Do not proliferate #includes here, require clients to #include their
// dependencies.
@@ -79,4 +79,4 @@ namespace swift {
using llvm::NoneType;
} // end namespace swift
#endif
#endif // SWIFT_BASIC_LLVM_H

View File

@@ -40,4 +40,4 @@
llvm::InitializeAllDisassemblers(); \
llvm::InitializeAllTargetInfos();
#endif
#endif // SWIFT_BASIC_LLVMINITIALIZE_H

View File

@@ -15,8 +15,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_LANGOPTIONS_H
#define SWIFT_LANGOPTIONS_H
#ifndef SWIFT_BASIC_LANGOPTIONS_H
#define SWIFT_BASIC_LANGOPTIONS_H
#include "swift/Basic/LLVM.h"
#include "clang/Basic/VersionTuple.h"
@@ -245,7 +245,6 @@ namespace swift {
PlatformConditionValues;
llvm::SmallVector<std::string, 2> CustomConditionalCompilationFlags;
};
}
#endif // SWIFT_LANGOPTIONS_H
} // end namespace swift
#endif // SWIFT_BASIC_LANGOPTIONS_H

View File

@@ -79,7 +79,7 @@ template <typename T> inline T &Lazy<T>::get(void (*initCallback)(void*)) {
return unsafeGetAlreadyInitialized();
}
} // namespace swift
} // end namespace swift
#define SWIFT_LAZY_CONSTANT(INITIAL_VALUE) \
([]{ \

View File

@@ -64,4 +64,4 @@ public:
} // end namespace swift
#endif
#endif // SWIFT_BASIC_NULLABLEPTR_H

View File

@@ -131,6 +131,6 @@ private:
"operator| should produce an OptionSet");
};
}
} // end namespace swift
#endif
#endif // SWIFT_BASIC_OPTIONSET_H

View File

@@ -83,6 +83,6 @@ namespace swift {
return (intptr_t)Storage;
}
};
}
} // end namespace swift
#endif
#endif // SWIFT_BASIC_OPTIONALENUM_H

View File

@@ -57,7 +57,7 @@ namespace swift {
/// Returns the platform Kind for Darwin triples.
DarwinPlatformKind getDarwinPlatformKind(const llvm::Triple &triple);
}
} // end namespace swift
#endif // SWIFT_BASIC_PLATFORM_H

View File

@@ -10,6 +10,9 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_POINTERINTENUM_H
#define SWIFT_BASIC_POINTERINTENUM_H
#include "swift/Basic/LLVM.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
@@ -223,3 +226,5 @@ public:
};
} // end swift namespace
#endif // SWIFT_BASIC_POINTERINTENUM_H

View File

@@ -679,4 +679,4 @@ public:
} // end namespace swift
#endif
#endif // SWIFT_BASIC_PREFIXMAP_H

View File

@@ -31,6 +31,6 @@ public:
void print(llvm::raw_ostream &OS) const override;
};
}
} // end namespace swift
#endif
#endif // SWIFT_BASIC_PRETTYSTACKTRACE_H

View File

@@ -42,7 +42,7 @@ static inline void splitIntoLines(StringRef Text,
trimLeadingWhitespaceFromLines(Text, 0, Lines);
}
} // namespace swift
} // end namespace swift
#endif // LLVM_SWIFT_BASIC_PRIMITIVEPARSING_H
#endif // SWIFT_BASIC_PRIMITIVEPARSING_H

View File

@@ -35,4 +35,4 @@ int ExecuteInPlace(const char *Program, const char **args,
} // end namespace swift
#endif
#endif // SWIFT_BASIC_PROGRAM_H

View File

@@ -52,5 +52,5 @@ bool decodePunycodeUTF8(StringRef InputPunycode, std::string &OutUTF8);
} // end namespace Punycode
} // end namespace swift
#endif // LLVM_SWIFT_BASIC_PUNYCODE_H
#endif // SWIFT_BASIC_PUNYCODE_H

View File

@@ -41,6 +41,6 @@ namespace swift {
return out;
}
};
}
} // end namespace swift
#endif
#endif // SWIFT_BASIC_QUOTEDSTRING_H

View File

@@ -295,6 +295,6 @@ inline auto count_if(const Range &R, Predicate &&P)
return std::count_if(R.begin(), R.end(), std::forward<Predicate>(P));
}
} // namespace swift
} // end namespace swift
#endif
#endif // SWIFT_BASIC_RANGE_H

View File

@@ -327,6 +327,6 @@ using FarRelativeIndirectablePointer =
template<typename T, bool Nullable = false>
using FarRelativeDirectPointer = RelativeDirectPointer<T, Nullable, intptr_t>;
}
} // end namespace swift
#endif // SWIFT_BASIC_RELATIVEPOINTER_H

View File

@@ -693,4 +693,4 @@ inline bool is_sorted_and_uniqued(const Container &C) {
} // end namespace swift
#endif
#endif // SWIFT_BASIC_INTERLEAVE_H

View File

@@ -20,5 +20,6 @@ enum class SanitizerKind : unsigned {
Address,
};
}
} // end namespace swift
#endif // SWIFT_BASIC_SANITIZERS_H

View File

@@ -14,8 +14,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_SOURCELOC_H
#define SWIFT_SOURCELOC_H
#ifndef SWIFT_BASIC_SOURCELOC_H
#define SWIFT_BASIC_SOURCELOC_H
#include "swift/Basic/LLVM.h"
#include "llvm/ADT/StringRef.h"
@@ -202,4 +202,4 @@ public:
} // end namespace swift
#endif
#endif // SWIFT_BASIC_SOURCELOC_H

View File

@@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_SOURCEMANAGER_H
#define SWIFT_SOURCEMANAGER_H
#ifndef SWIFT_BASIC_SOURCEMANAGER_H
#define SWIFT_BASIC_SOURCEMANAGER_H
#include "swift/Basic/SourceLoc.h"
#include "llvm/ADT/Optional.h"
@@ -231,7 +231,7 @@ private:
}
};
} // namespace swift
} // end namespace swift
#endif // LLVM_SWIFT_SOURCEMANAGER_H
#endif // SWIFT_BASIC_SOURCEMANAGER_H

View File

@@ -458,6 +458,7 @@ bool omitNeedlessWords(StringRef &baseName,
bool isProperty,
const InheritedNameSet *allPropertyNames,
StringScratchSpace &scratch);
}
#endif // LLVM_SWIFT_BASIC_STRINGEXTRAS_HPP
} // end namespace swift
#endif // SWIFT_BASIC_STRINGEXTRAS_H

View File

@@ -457,4 +457,4 @@ private:
} // end namespace swift
#endif
#endif // SWIFT_BASIC_SUCCESSORMAP_H

View File

@@ -179,4 +179,4 @@ public:
} // end namespace sys
} // end namespace swift
#endif
#endif // SWIFT_BASIC_TASKQUEUE_H

View File

@@ -71,6 +71,6 @@ public:
}
};
} // end namespace swift.
} // end namespace swift
#endif
#endif // SWIFT_BASIC_THREADSAFEREFCOUNTED_H

View File

@@ -45,6 +45,6 @@ namespace swift {
CompilationTimersEnabled = State::Enabled;
}
};
}
} // end namespace swift
#endif // SWIFT_BASIC_TIMER_H

View File

@@ -400,4 +400,4 @@ TreeScopedHashTableScopeImpl<K, V, Allocator>::~TreeScopedHashTableScopeImpl() {
} // end namespace swift
#endif
#endif // SWIFT_BASIC_TREESCOPEDHASHTABLE_H

View File

@@ -115,6 +115,6 @@ namespace llvm {
return a == b;
}
};
}
} // end namespace swift
#endif
#endif // SWIFT_BASIC_UUID_H

View File

@@ -83,8 +83,7 @@ unsigned extractFirstUnicodeScalar(StringRef S);
/// Returns the number of code units in UTF16 representation
uint64_t getUTF16Length(StringRef Str);
} // namespace unicode
} // namespace swift
#endif
} // end namespace unicode
} // end namespace swift
#endif // SWIFT_BASIC_UNICODE_H

View File

@@ -55,4 +55,4 @@ public:
} // end namespace swift
#endif
#endif // SWIFT_BASIC_VALUEENUMERATOR_H

View File

@@ -126,4 +126,4 @@ std::string getSwiftFullVersion();
} // end namespace version
} // end namespace swift
#endif
#endif // SWIFT_BASIC_VERSION_H

View File

@@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_TYPE_TRAITS_H
#define SWIFT_BASIC_TYPE_TRAITS_H
#ifndef SWIFT_BASIC_TYPETRAITS_H
#define SWIFT_BASIC_TYPETRAITS_H
#include <type_traits>
@@ -63,11 +63,10 @@ struct IsTriviallyDestructible {
#endif
};
} // namespace swift
} // end namespace swift
#ifdef SWIFT_DEFINED_HAS_FEATURE
#undef __has_feature
#endif
#endif // SWIFT_BASIC_TYPE_TRAITS_H
#endif // SWIFT_BASIC_TYPETRAITS_H