[PATCH] D133457: Add Clang driver flags equivalent to cl's /MD, /MT, /MDd, /MTd.

Amy Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 14 10:51:25 PDT 2022


akhuang marked 3 inline comments as done.
akhuang added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4442
+                                    bool IsClangCL) {
+  unsigned RTOptionID = 0; // MT=0, MTd=1, MD=2, MDd=3
+  bool HasLDdFlag = IsClangCL && Args.hasArg(options::OPT__SLASH_LDd);
----------------
hans wrote:
> Could this be an enum, or reuse existing values like the /Mx option ids?
Oh, right, resuing the options::OPT__SLASH_ flags makes more sense.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4461
+  } else {
+    if (Arg *A = Args.getLastArg(options::OPT_fms_runtime_lib_EQ)) {
+      StringRef Val = A->getValue();
----------------
hans wrote:
> Is there a getLastArg() variant that allows getting the last argument of either the /Mx options or -fms-runtime-lib, so we don't need to check IsClangCL?
Actually, I think I can just remove the IsClangCL option since this function now runs either in `AddClangCLArgs` or under `!IsCLMode()`. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133457/new/

https://reviews.llvm.org/D133457



More information about the cfe-commits mailing list