[PATCH] D37891: Driver: hoist the `wchar_t` handling to the driver

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 6 16:10:36 PDT 2017


compnerd added inline comments.


================
Comment at: lib/Basic/Targets/AArch64.cpp:47-51
+  bool IsNetBSD = getTriple().getOS() == llvm::Triple::NetBSD;
+  bool IsOpenBSD = getTriple().getOS() == llvm::Triple::OpenBSD;
+  if (!getTriple().isOSDarwin() && !IsNetBSD && !IsOpenBSD)
+    WCharType = UnsignedInt;
+
----------------
rnk wrote:
> I felt like this was clearer the way it was before, and we're already checking for the BSDs above.
Okay, I'll swap it back.


================
Comment at: lib/Basic/Targets/AArch64.cpp:160-161
 
-  Builder.defineMacro("__ARM_SIZEOF_WCHAR_T", Opts.ShortWChar ? "2" : "4");
+  Builder.defineMacro("__ARM_SIZEOF_WCHAR_T",
+                      llvm::utostr(Opts.WCharSize ? Opts.WCharSize : 4));
 
----------------
rnk wrote:
> This is correct because we compute macros after we apply the flag override, right?
Correct :-)


Repository:
  rL LLVM

https://reviews.llvm.org/D37891





More information about the cfe-commits mailing list