[PATCH] D25669: [Driver] Simplify ToolChain::GetCXXStdlibType (NFC)

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 23:32:57 PDT 2016


Hahnfeld added inline comments.


================
Comment at: lib/Driver/ToolChain.cpp:553-559
+  // "platform" is only used in tests to override CLANG_DEFAULT_CXX_STDLIB
+  if (LibName == "libc++")
+    return ToolChain::CST_Libcxx;
+  else if (LibName == "libstdc++")
+    return ToolChain::CST_Libstdcxx;
+  else if (LibName == "platform")
+    return GetDefaultCXXStdlibType();
----------------
mgorny wrote:
> ABataev wrote:
> > I believe you can use StringSwitch here
> I think you are changing the meaning of this comment. The original sounded like a request not to use this type anywhere else. Your version only explains where it's used (right now).
I'm uncertain how to apply it while also preserving the `Diag` for an invalid argument: I would probably need an additional `CST_Unknown` which I don't like more...


https://reviews.llvm.org/D25669





More information about the cfe-commits mailing list