Correct line endings that got mixed up in r320089; NFC.

llvm-svn: 320113
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 9bdb0d5..d398904 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -193,7 +193,7 @@
 /// the width, suffix, and signedness of the given type
 static void DefineTypeSize(const Twine &MacroName, TargetInfo::IntType Ty,
                            const TargetInfo &TI, MacroBuilder &Builder) {
-  DefineTypeSize(MacroName, TI.getTypeWidth(Ty), TI.getTypeConstantSuffix(Ty), 
+  DefineTypeSize(MacroName, TI.getTypeWidth(Ty), TI.getTypeConstantSuffix(Ty),
                  TI.isTypeSigned(Ty), Builder);
 }
 
@@ -270,209 +270,209 @@
   DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
   DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder);
 }
-

-static void DefineFastIntType(unsigned TypeWidth, bool IsSigned,

-                              const TargetInfo &TI, MacroBuilder &Builder) {

-  // stdint.h currently defines the fast int types as equivalent to the least

-  // types.

-  TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned);

-  if (Ty == TargetInfo::NoInt)

-    return;

-

-  const char *Prefix = IsSigned ? "__INT_FAST" : "__UINT_FAST";

-  DefineType(Prefix + Twine(TypeWidth) + "_TYPE__", Ty, Builder);

-  DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);

-

-  DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder);

-}

-

-

-/// Get the value the ATOMIC_*_LOCK_FREE macro should have for a type with

-/// the specified properties.

-static const char *getLockFreeValue(unsigned TypeWidth, unsigned TypeAlign,

-                                    unsigned InlineWidth) {

-  // Fully-aligned, power-of-2 sizes no larger than the inline

-  // width will be inlined as lock-free operations.

-  if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 &&

-      TypeWidth <= InlineWidth)

-    return "2"; // "always lock free"

-  // We cannot be certain what operations the lib calls might be

-  // able to implement as lock-free on future processors.

-  return "1"; // "sometimes lock free"

-}

-

-/// \brief Add definitions required for a smooth interaction between

-/// Objective-C++ automated reference counting and libstdc++ (4.2).

-static void AddObjCXXARCLibstdcxxDefines(const LangOptions &LangOpts, 

-                                         MacroBuilder &Builder) {

-  Builder.defineMacro("_GLIBCXX_PREDEFINED_OBJC_ARC_IS_SCALAR");

-  

-  std::string Result;

-  {

-    // Provide specializations for the __is_scalar type trait so that 

-    // lifetime-qualified objects are not considered "scalar" types, which

-    // libstdc++ uses as an indicator of the presence of trivial copy, assign,

-    // default-construct, and destruct semantics (none of which hold for

-    // lifetime-qualified objects in ARC).

-    llvm::raw_string_ostream Out(Result);

-    

-    Out << "namespace std {\n"

-        << "\n"

-        << "struct __true_type;\n"

-        << "struct __false_type;\n"

-        << "\n";

-    

-    Out << "template<typename _Tp> struct __is_scalar;\n"

-        << "\n";

-

-    if (LangOpts.ObjCAutoRefCount) {

-      Out << "template<typename _Tp>\n"

-          << "struct __is_scalar<__attribute__((objc_ownership(strong))) _Tp> {\n"

-          << "  enum { __value = 0 };\n"

-          << "  typedef __false_type __type;\n"

-          << "};\n"

-          << "\n";

-    }

-      

-    if (LangOpts.ObjCWeak) {

-      Out << "template<typename _Tp>\n"

-          << "struct __is_scalar<__attribute__((objc_ownership(weak))) _Tp> {\n"

-          << "  enum { __value = 0 };\n"

-          << "  typedef __false_type __type;\n"

-          << "};\n"

-          << "\n";

-    }

-    

-    if (LangOpts.ObjCAutoRefCount) {

-      Out << "template<typename _Tp>\n"

-          << "struct __is_scalar<__attribute__((objc_ownership(autoreleasing)))"

-          << " _Tp> {\n"

-          << "  enum { __value = 0 };\n"

-          << "  typedef __false_type __type;\n"

-          << "};\n"

-          << "\n";

-    }

-      

-    Out << "}\n";

-  }

-  Builder.append(Result);

-}

-

-static void InitializeStandardPredefinedMacros(const TargetInfo &TI,

-                                               const LangOptions &LangOpts,

-                                               const FrontendOptions &FEOpts,

-                                               MacroBuilder &Builder) {

-  if (!LangOpts.MSVCCompat && !LangOpts.TraditionalCPP)

-    Builder.defineMacro("__STDC__");

-  if (LangOpts.Freestanding)

-    Builder.defineMacro("__STDC_HOSTED__", "0");

-  else

-    Builder.defineMacro("__STDC_HOSTED__");

-

-  if (!LangOpts.CPlusPlus) {

-    if (LangOpts.C17)

-      Builder.defineMacro("__STDC_VERSION__", "201710L");

-    else if (LangOpts.C11)

-      Builder.defineMacro("__STDC_VERSION__", "201112L");

-    else if (LangOpts.C99)

-      Builder.defineMacro("__STDC_VERSION__", "199901L");

-    else if (!LangOpts.GNUMode && LangOpts.Digraphs)

-      Builder.defineMacro("__STDC_VERSION__", "199409L");

-  } else {

-    // FIXME: Use correct value for C++20.

-    if (LangOpts.CPlusPlus2a)

-      Builder.defineMacro("__cplusplus", "201707L");

-    // C++17 [cpp.predefined]p1:

-    //   The name __cplusplus is defined to the value 201703L when compiling a

-    //   C++ translation unit.

-    else if (LangOpts.CPlusPlus17)

-      Builder.defineMacro("__cplusplus", "201703L");

-    // C++1y [cpp.predefined]p1:

-    //   The name __cplusplus is defined to the value 201402L when compiling a

-    //   C++ translation unit.

-    else if (LangOpts.CPlusPlus14)

-      Builder.defineMacro("__cplusplus", "201402L");

-    // C++11 [cpp.predefined]p1:

-    //   The name __cplusplus is defined to the value 201103L when compiling a

-    //   C++ translation unit.

-    else if (LangOpts.CPlusPlus11)

-      Builder.defineMacro("__cplusplus", "201103L");

-    // C++03 [cpp.predefined]p1:

-    //   The name __cplusplus is defined to the value 199711L when compiling a

-    //   C++ translation unit.

-    else

-      Builder.defineMacro("__cplusplus", "199711L");

-

-    // C++1z [cpp.predefined]p1:

-    //   An integer literal of type std::size_t whose value is the alignment

-    //   guaranteed by a call to operator new(std::size_t)

-    //

-    // We provide this in all language modes, since it seems generally useful.

-    Builder.defineMacro("__STDCPP_DEFAULT_NEW_ALIGNMENT__",

-                        Twine(TI.getNewAlign() / TI.getCharWidth()) +

-                            TI.getTypeConstantSuffix(TI.getSizeType()));

-  }

-

-  // In C11 these are environment macros. In C++11 they are only defined

-  // as part of <cuchar>. To prevent breakage when mixing C and C++

-  // code, define these macros unconditionally. We can define them

-  // unconditionally, as Clang always uses UTF-16 and UTF-32 for 16-bit

-  // and 32-bit character literals.

-  Builder.defineMacro("__STDC_UTF_16__", "1");

-  Builder.defineMacro("__STDC_UTF_32__", "1");

-

-  if (LangOpts.ObjC1)

-    Builder.defineMacro("__OBJC__");

-

-  // OpenCL v1.0/1.1 s6.9, v1.2/2.0 s6.10: Preprocessor Directives and Macros.

-  if (LangOpts.OpenCL) {

-    // OpenCL v1.0 and v1.1 do not have a predefined macro to indicate the

-    // language standard with which the program is compiled. __OPENCL_VERSION__

-    // is for the OpenCL version supported by the OpenCL device, which is not

-    // necessarily the language standard with which the program is compiled.

-    // A shared OpenCL header file requires a macro to indicate the language

-    // standard. As a workaround, __OPENCL_C_VERSION__ is defined for

-    // OpenCL v1.0 and v1.1.

-    switch (LangOpts.OpenCLVersion) {

-    case 100:

-      Builder.defineMacro("__OPENCL_C_VERSION__", "100");

-      break;

-    case 110:

-      Builder.defineMacro("__OPENCL_C_VERSION__", "110");

-      break;

-    case 120:

-      Builder.defineMacro("__OPENCL_C_VERSION__", "120");

-      break;

-    case 200:

-      Builder.defineMacro("__OPENCL_C_VERSION__", "200");

-      break;

-    default:

-      llvm_unreachable("Unsupported OpenCL version");

-    }

-    Builder.defineMacro("CL_VERSION_1_0", "100");

-    Builder.defineMacro("CL_VERSION_1_1", "110");

-    Builder.defineMacro("CL_VERSION_1_2", "120");

-    Builder.defineMacro("CL_VERSION_2_0", "200");

-

-    if (TI.isLittleEndian())

-      Builder.defineMacro("__ENDIAN_LITTLE__");

-

-    if (LangOpts.FastRelaxedMath)

-      Builder.defineMacro("__FAST_RELAXED_MATH__");

-  }

-  // Not "standard" per se, but available even with the -undef flag.

-  if (LangOpts.AsmPreprocessor)

-    Builder.defineMacro("__ASSEMBLER__");

-  if (LangOpts.CUDA)

-    Builder.defineMacro("__CUDA__");

-}

-

-/// Initialize the predefined C++ language feature test macros defined in

-/// ISO/IEC JTC1/SC22/WG21 (C++) SD-6: "SG10 Feature Test Recommendations".

-static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,

-                                                 MacroBuilder &Builder) {

-  // C++98 features.

-  if (LangOpts.RTTI)

+
+static void DefineFastIntType(unsigned TypeWidth, bool IsSigned,
+                              const TargetInfo &TI, MacroBuilder &Builder) {
+  // stdint.h currently defines the fast int types as equivalent to the least
+  // types.
+  TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned);
+  if (Ty == TargetInfo::NoInt)
+    return;
+
+  const char *Prefix = IsSigned ? "__INT_FAST" : "__UINT_FAST";
+  DefineType(Prefix + Twine(TypeWidth) + "_TYPE__", Ty, Builder);
+  DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
+
+  DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder);
+}
+
+
+/// Get the value the ATOMIC_*_LOCK_FREE macro should have for a type with
+/// the specified properties.
+static const char *getLockFreeValue(unsigned TypeWidth, unsigned TypeAlign,
+                                    unsigned InlineWidth) {
+  // Fully-aligned, power-of-2 sizes no larger than the inline
+  // width will be inlined as lock-free operations.
+  if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 &&
+      TypeWidth <= InlineWidth)
+    return "2"; // "always lock free"
+  // We cannot be certain what operations the lib calls might be
+  // able to implement as lock-free on future processors.
+  return "1"; // "sometimes lock free"
+}
+
+/// \brief Add definitions required for a smooth interaction between
+/// Objective-C++ automated reference counting and libstdc++ (4.2).
+static void AddObjCXXARCLibstdcxxDefines(const LangOptions &LangOpts,
+                                         MacroBuilder &Builder) {
+  Builder.defineMacro("_GLIBCXX_PREDEFINED_OBJC_ARC_IS_SCALAR");
+
+  std::string Result;
+  {
+    // Provide specializations for the __is_scalar type trait so that
+    // lifetime-qualified objects are not considered "scalar" types, which
+    // libstdc++ uses as an indicator of the presence of trivial copy, assign,
+    // default-construct, and destruct semantics (none of which hold for
+    // lifetime-qualified objects in ARC).
+    llvm::raw_string_ostream Out(Result);
+
+    Out << "namespace std {\n"
+        << "\n"
+        << "struct __true_type;\n"
+        << "struct __false_type;\n"
+        << "\n";
+
+    Out << "template<typename _Tp> struct __is_scalar;\n"
+        << "\n";
+
+    if (LangOpts.ObjCAutoRefCount) {
+      Out << "template<typename _Tp>\n"
+          << "struct __is_scalar<__attribute__((objc_ownership(strong))) _Tp> {\n"
+          << "  enum { __value = 0 };\n"
+          << "  typedef __false_type __type;\n"
+          << "};\n"
+          << "\n";
+    }
+
+    if (LangOpts.ObjCWeak) {
+      Out << "template<typename _Tp>\n"
+          << "struct __is_scalar<__attribute__((objc_ownership(weak))) _Tp> {\n"
+          << "  enum { __value = 0 };\n"
+          << "  typedef __false_type __type;\n"
+          << "};\n"
+          << "\n";
+    }
+
+    if (LangOpts.ObjCAutoRefCount) {
+      Out << "template<typename _Tp>\n"
+          << "struct __is_scalar<__attribute__((objc_ownership(autoreleasing)))"
+          << " _Tp> {\n"
+          << "  enum { __value = 0 };\n"
+          << "  typedef __false_type __type;\n"
+          << "};\n"
+          << "\n";
+    }
+
+    Out << "}\n";
+  }
+  Builder.append(Result);
+}
+
+static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
+                                               const LangOptions &LangOpts,
+                                               const FrontendOptions &FEOpts,
+                                               MacroBuilder &Builder) {
+  if (!LangOpts.MSVCCompat && !LangOpts.TraditionalCPP)
+    Builder.defineMacro("__STDC__");
+  if (LangOpts.Freestanding)
+    Builder.defineMacro("__STDC_HOSTED__", "0");
+  else
+    Builder.defineMacro("__STDC_HOSTED__");
+
+  if (!LangOpts.CPlusPlus) {
+    if (LangOpts.C17)
+      Builder.defineMacro("__STDC_VERSION__", "201710L");
+    else if (LangOpts.C11)
+      Builder.defineMacro("__STDC_VERSION__", "201112L");
+    else if (LangOpts.C99)
+      Builder.defineMacro("__STDC_VERSION__", "199901L");
+    else if (!LangOpts.GNUMode && LangOpts.Digraphs)
+      Builder.defineMacro("__STDC_VERSION__", "199409L");
+  } else {
+    // FIXME: Use correct value for C++20.
+    if (LangOpts.CPlusPlus2a)
+      Builder.defineMacro("__cplusplus", "201707L");
+    // C++17 [cpp.predefined]p1:
+    //   The name __cplusplus is defined to the value 201703L when compiling a
+    //   C++ translation unit.
+    else if (LangOpts.CPlusPlus17)
+      Builder.defineMacro("__cplusplus", "201703L");
+    // C++1y [cpp.predefined]p1:
+    //   The name __cplusplus is defined to the value 201402L when compiling a
+    //   C++ translation unit.
+    else if (LangOpts.CPlusPlus14)
+      Builder.defineMacro("__cplusplus", "201402L");
+    // C++11 [cpp.predefined]p1:
+    //   The name __cplusplus is defined to the value 201103L when compiling a
+    //   C++ translation unit.
+    else if (LangOpts.CPlusPlus11)
+      Builder.defineMacro("__cplusplus", "201103L");
+    // C++03 [cpp.predefined]p1:
+    //   The name __cplusplus is defined to the value 199711L when compiling a
+    //   C++ translation unit.
+    else
+      Builder.defineMacro("__cplusplus", "199711L");
+
+    // C++1z [cpp.predefined]p1:
+    //   An integer literal of type std::size_t whose value is the alignment
+    //   guaranteed by a call to operator new(std::size_t)
+    //
+    // We provide this in all language modes, since it seems generally useful.
+    Builder.defineMacro("__STDCPP_DEFAULT_NEW_ALIGNMENT__",
+                        Twine(TI.getNewAlign() / TI.getCharWidth()) +
+                            TI.getTypeConstantSuffix(TI.getSizeType()));
+  }
+
+  // In C11 these are environment macros. In C++11 they are only defined
+  // as part of <cuchar>. To prevent breakage when mixing C and C++
+  // code, define these macros unconditionally. We can define them
+  // unconditionally, as Clang always uses UTF-16 and UTF-32 for 16-bit
+  // and 32-bit character literals.
+  Builder.defineMacro("__STDC_UTF_16__", "1");
+  Builder.defineMacro("__STDC_UTF_32__", "1");
+
+  if (LangOpts.ObjC1)
+    Builder.defineMacro("__OBJC__");
+
+  // OpenCL v1.0/1.1 s6.9, v1.2/2.0 s6.10: Preprocessor Directives and Macros.
+  if (LangOpts.OpenCL) {
+    // OpenCL v1.0 and v1.1 do not have a predefined macro to indicate the
+    // language standard with which the program is compiled. __OPENCL_VERSION__
+    // is for the OpenCL version supported by the OpenCL device, which is not
+    // necessarily the language standard with which the program is compiled.
+    // A shared OpenCL header file requires a macro to indicate the language
+    // standard. As a workaround, __OPENCL_C_VERSION__ is defined for
+    // OpenCL v1.0 and v1.1.
+    switch (LangOpts.OpenCLVersion) {
+    case 100:
+      Builder.defineMacro("__OPENCL_C_VERSION__", "100");
+      break;
+    case 110:
+      Builder.defineMacro("__OPENCL_C_VERSION__", "110");
+      break;
+    case 120:
+      Builder.defineMacro("__OPENCL_C_VERSION__", "120");
+      break;
+    case 200:
+      Builder.defineMacro("__OPENCL_C_VERSION__", "200");
+      break;
+    default:
+      llvm_unreachable("Unsupported OpenCL version");
+    }
+    Builder.defineMacro("CL_VERSION_1_0", "100");
+    Builder.defineMacro("CL_VERSION_1_1", "110");
+    Builder.defineMacro("CL_VERSION_1_2", "120");
+    Builder.defineMacro("CL_VERSION_2_0", "200");
+
+    if (TI.isLittleEndian())
+      Builder.defineMacro("__ENDIAN_LITTLE__");
+
+    if (LangOpts.FastRelaxedMath)
+      Builder.defineMacro("__FAST_RELAXED_MATH__");
+  }
+  // Not "standard" per se, but available even with the -undef flag.
+  if (LangOpts.AsmPreprocessor)
+    Builder.defineMacro("__ASSEMBLER__");
+  if (LangOpts.CUDA)
+    Builder.defineMacro("__CUDA__");
+}
+
+/// Initialize the predefined C++ language feature test macros defined in
+/// ISO/IEC JTC1/SC22/WG21 (C++) SD-6: "SG10 Feature Test Recommendations".
+static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
+                                                 MacroBuilder &Builder) {
+  // C++98 features.
+  if (LangOpts.RTTI)
     Builder.defineMacro("__cpp_rtti", "199711");
   if (LangOpts.CXXExceptions)
     Builder.defineMacro("__cpp_exceptions", "199711");
@@ -485,7 +485,7 @@
     Builder.defineMacro("__cpp_user_defined_literals", "200809");
     Builder.defineMacro("__cpp_lambdas", "200907");
     Builder.defineMacro("__cpp_constexpr",
-                        LangOpts.CPlusPlus17 ? "201603" : 
+                        LangOpts.CPlusPlus17 ? "201603" :
                         LangOpts.CPlusPlus14 ? "201304" : "200704");
     Builder.defineMacro("__cpp_range_based_for",
                         LangOpts.CPlusPlus17 ? "201603" : "200907");
@@ -561,7 +561,7 @@
   Builder.defineMacro("__clang_patchlevel__", TOSTR(CLANG_VERSION_PATCHLEVEL));
 #undef TOSTR
 #undef TOSTR2
-  Builder.defineMacro("__clang_version__", 
+  Builder.defineMacro("__clang_version__",
                       "\"" CLANG_VERSION_STRING " "
                       + getClangFullRepositoryVersion() + "\"");
   if (!LangOpts.MSVCCompat) {
@@ -601,7 +601,7 @@
   // As sad as it is, enough software depends on the __VERSION__ for version
   // checks that it is necessary to report 4.2.1 (the base GCC version we claim
   // compatibility with) first.
-  Builder.defineMacro("__VERSION__", "\"4.2.1 Compatible " + 
+  Builder.defineMacro("__VERSION__", "\"4.2.1 Compatible " +
                       Twine(getClangFullCPPVersion()) + "\"");
 
   // Initialize language-specific preprocessor defines.
@@ -616,7 +616,7 @@
   if (LangOpts.ObjC1) {
     if (LangOpts.ObjCRuntime.isNonFragile()) {
       Builder.defineMacro("__OBJC2__");
-      
+
       if (LangOpts.ObjCExceptions)
         Builder.defineMacro("OBJC_ZEROCOST_EXCEPTIONS");
     }
@@ -1108,7 +1108,7 @@
       }
     }
   }
-  
+
   // Even with predefines off, some macros are still predefined.
   // These should all be defined in the preprocessor according to the
   // current language configuration.
@@ -1154,7 +1154,7 @@
   // Instruct the preprocessor to skip the preamble.
   PP.setSkipMainFilePreamble(InitOpts.PrecompiledPreambleBytes.first,
                              InitOpts.PrecompiledPreambleBytes.second);
-                          
+
   // Copy PredefinedBuffer into the Preprocessor.
   PP.setPredefines(Predefines.str());
 }