unstick r375316

Revision 375316

Date:
2019/10/19 00:48:11
Author:
rnk
Revision Log:
Move endian constant from Host.h to SwapByteOrder.h, prune include

Works on this dependency chain:
ArrayRef.h ->
Hashing.h -> --CUT--
Host.h ->
StringMap.h / StringRef.h

ArrayRef is very popular, but Host.h is rarely needed. Move the
IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are
more likely to need it.
Files:

Legend:

 
Added
 
Removed
 
Modified
  • cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp

     
    12 12 #include "clang/Driver/Options.h"
    13 13 #include "llvm/Option/ArgList.h"
    14 14 #include "llvm/Support/TargetParser.h"
    15 #include "llvm/Support/Host.h"
    15 16
    16 17 using namespace clang::driver;
    17 18 using namespace clang::driver::tools;
  • cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp

     
    13 13 #include "llvm/ADT/StringSwitch.h"
    14 14 #include "llvm/Option/ArgList.h"
    15 15 #include "llvm/Support/TargetParser.h"
    16 #include "llvm/Support/Host.h"
    16 17
    17 18 using namespace clang::driver;
    18 19 using namespace clang::driver::tools;
  • cfe/trunk/lib/Driver/ToolChains/Arch/PPC.cpp

     
    13 13 #include "clang/Driver/Options.h"
    14 14 #include "llvm/ADT/StringSwitch.h"
    15 15 #include "llvm/Option/ArgList.h"
    16 #include "llvm/Support/Host.h"
    16 17
    17 18 using namespace clang::driver;
    18 19 using namespace clang::driver::tools;
  • cfe/trunk/lib/Driver/ToolChains/Arch/X86.cpp

     
    13 13 #include "clang/Driver/Options.h"
    14 14 #include "llvm/ADT/StringSwitch.h"
    15 15 #include "llvm/Option/ArgList.h"
    16 #include "llvm/Support/Host.h"
    16 17
    17 18 using namespace clang::driver;
    18 19 using namespace clang::driver::tools;
  • clang-tools-extra/trunk/clangd/FileDistance.h

     
    43 43 #include "llvm/ADT/DenseMap.h"
    44 44 #include "llvm/ADT/DenseMapInfo.h"
    45 45 #include "llvm/ADT/SmallString.h"
    46 #include "llvm/ADT/StringMap.h"
    46 47 #include "llvm/ADT/StringRef.h"
    47 48 #include "llvm/Support/Allocator.h"
    48 49 #include "llvm/Support/Path.h"
  • lld/trunk/include/lld/Common/LLVM.h

     
    17 17 // This should be the only #include, force #includes of all the others on
    18 18 // clients.
    19 19 #include "llvm/ADT/Hashing.h"
    20 #include "llvm/ADT/StringRef.h"
    20 21 #include "llvm/Support/Casting.h"
    21 22 #include <utility>
    22 23
  • lld/trunk/include/lld/Core/File.h

     
    16 16 #include "llvm/ADT/Optional.h"
    17 17 #include "llvm/ADT/STLExtras.h"
    18 18 #include "llvm/ADT/Twine.h"
    19 #include "llvm/Support/Allocator.h"
    19 20 #include "llvm/Support/ErrorHandling.h"
    20 21 #include <functional>
    21 22 #include <memory>
  • lld/trunk/lib/ReaderWriter/MachO/DebugInfo.h

     
    12 12 #include "lld/Core/Atom.h"
    13 13 #include <vector>
    14 14
    15 #include "llvm/Support/Allocator.h"
    15 16 #include "llvm/Support/Format.h"
    16 17 #include "llvm/Support/raw_ostream.h"
    17 18
  • lld/trunk/tools/lld/lld.cpp

     
    33 33 #include "llvm/ADT/Triple.h"
    34 34 #include "llvm/ADT/Twine.h"
    35 35 #include "llvm/Support/CommandLine.h"
    36 #include "llvm/Support/Host.h"
    36 37 #include "llvm/Support/InitLLVM.h"
    37 38 #include "llvm/Support/Path.h"
    38 39 #include <cstdlib>
  • lldb/trunk/include/lldb/Utility/UUID.h

     
    9 9 #ifndef LLDB_UTILITY_UUID_H
    10 10 #define LLDB_UTILITY_UUID_H
    11 11
    12 #include "llvm/ADT/ArrayRef.h"
    13 #include "llvm/ADT/StringRef.h"
    12 14 #include <stddef.h>
    13 15 #include <stdint.h>
    14 16 #include <string>
    15 #include "llvm/ADT/ArrayRef.h"
    16 17
    17 namespace llvm {
    18 class StringRef;
    19 }
    20
    21 18 namespace lldb_private {
    22 19
    23 20 class Stream;
  • llvm/trunk/include/llvm/ADT/Hashing.h

     
    45 45 #define LLVM_ADT_HASHING_H
    46 46
    47 47 #include "llvm/Support/DataTypes.h"
    48 #include "llvm/Support/Host.h"
    49 48 #include "llvm/Support/SwapByteOrder.h"
    50 49 #include "llvm/Support/type_traits.h"
    51 50 #include <algorithm>
  • llvm/trunk/include/llvm/BinaryFormat/Wasm.h

     
    16 16
    17 17 #include "llvm/ADT/ArrayRef.h"
    18 18 #include "llvm/ADT/SmallVector.h"
    19 #include "llvm/ADT/StringRef.h"
    19 20
    20 21 namespace llvm {
    21 22 namespace wasm {
  • llvm/trunk/include/llvm/Support/Host.h

     
    15 15
    16 16 #include "llvm/ADT/StringMap.h"
    17 17
    18 #if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
    19 #include <endian.h>
    20 #elif defined(_AIX)
    21 #include <sys/machine.h>
    22 #elif defined(__sun)
    23 /* Solaris provides _BIG_ENDIAN/_LITTLE_ENDIAN selector in sys/types.h */
    24 #include <sys/types.h>
    25 #define BIG_ENDIAN 4321
    26 #define LITTLE_ENDIAN 1234
    27 #if defined(_BIG_ENDIAN)
    28 #define BYTE_ORDER BIG_ENDIAN
    29 #else
    30 #define BYTE_ORDER LITTLE_ENDIAN
    31 #endif
    32 #else
    33 #if !defined(BYTE_ORDER) && !defined(_WIN32)
    34 #include <machine/endian.h>
    35 #endif
    36 #endif
    37
    38 18 #include <string>
    39 19
    40 20 namespace llvm {
    41 21 namespace sys {
    42 22
    43 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
    44 constexpr bool IsBigEndianHost = true;
    45 #else
    46 constexpr bool IsBigEndianHost = false;
    47 #endif
    48
    49 static const bool IsLittleEndianHost = !IsBigEndianHost;
    50
    51 23 /// getDefaultTargetTriple() - Return the default target triple the compiler
    52 24 /// has been configured to produce code for.
    53 25 ///
  • llvm/trunk/include/llvm/Support/SHA1.h

     
    16 16 #define LLVM_SUPPORT_SHA1_H
    17 17
    18 18 #include "llvm/ADT/ArrayRef.h"
    19 #include "llvm/ADT/StringRef.h"
    19 20
    20 21 #include <array>
    21 22 #include <cstdint>
    22 23
    23 24 namespace llvm {
    24 25 template <typename T> class ArrayRef;
    25 class StringRef;
    26 26
    27 27 /// A class that wrap the SHA1 algorithm.
    28 28 class SHA1 {
  • llvm/trunk/include/llvm/Support/SwapByteOrder.h

     
    22 22 #include <stdlib.h>
    23 23 #endif
    24 24
    25 #if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
    26 #include <endian.h>
    27 #elif defined(_AIX)
    28 #include <sys/machine.h>
    29 #elif defined(__sun)
    30 /* Solaris provides _BIG_ENDIAN/_LITTLE_ENDIAN selector in sys/types.h */
    31 #include <sys/types.h>
    32 #define BIG_ENDIAN 4321
    33 #define LITTLE_ENDIAN 1234
    34 #if defined(_BIG_ENDIAN)
    35 #define BYTE_ORDER BIG_ENDIAN
    36 #else
    37 #define BYTE_ORDER LITTLE_ENDIAN
    38 #endif
    39 #else
    40 #if !defined(BYTE_ORDER) && !defined(_WIN32)
    41 #include <machine/endian.h>
    42 #endif
    43 #endif
    44
    25 45 namespace llvm {
    26 46 namespace sys {
    27 47
    48 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
    49 constexpr bool IsBigEndianHost = true;
    50 #else
    51 constexpr bool IsBigEndianHost = false;
    52 #endif
    53
    54 static const bool IsLittleEndianHost = !IsBigEndianHost;
    55
    28 56 /// SwapByteOrder_16 - This function returns a byte-swapped representation of
    29 57 /// the 16-bit argument.
    30 58 inline uint16_t SwapByteOrder_16(uint16_t value) {
  • llvm/trunk/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp

     
    8 8
    9 9 #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
    10 10
    11 #include "llvm/Support/Host.h"
    11 12 #include "llvm/Support/TargetRegistry.h"
    12 13
    13 14 namespace llvm {
  • llvm/trunk/lib/Support/Windows/WindowsSupport.h

     
    38 38 #include "llvm/ADT/StringRef.h"
    39 39 #include "llvm/ADT/Twine.h"
    40 40 #include "llvm/Config/config.h" // Get build system configuration settings
    41 #include "llvm/Support/Allocator.h"
    41 42 #include "llvm/Support/Chrono.h"
    42 43 #include "llvm/Support/Compiler.h"
    43 44 #include "llvm/Support/VersionTuple.h"
  • llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp

     
    12 12 //
    13 13 //===----------------------------------------------------------------------===//
    14 14
    15 #include "X86DisassemblerDecoder.h"
    16 #include "llvm/ADT/StringRef.h"
    17
    15 18 #include <cstdarg> /* for va_*() */
    16 19 #include <cstdio> /* for vsnprintf() */
    17 20 #include <cstdlib> /* for exit() */
    18 21 #include <cstring> /* for memset() */
    19 22
    20 #include "X86DisassemblerDecoder.h"
    21
    22 23 using namespace llvm::X86Disassembler;
    23 24
    24 25 /// Specifies whether a ModR/M byte is needed and (if so) which
  • llvm/trunk/tools/llvm-exegesis/lib/RegisterValue.cpp

     
    8 8
    9 9 #include "RegisterValue.h"
    10 10 #include "llvm/ADT/APFloat.h"
    11 #include "llvm/ADT/StringRef.h"
    11 12
    12 13 namespace llvm {
    13 14 namespace exegesis {