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

2022-10-07 Thread Amy Huang via Phabricator via cfe-commits
akhuang added a comment. In D133457#3832590 , @mstorsjo wrote: > @akhuang I noticed that > https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/MSVC.cpp#L199-L200 > has got an explicit check for `Args.hasArg(options::OPT__SLASH_MD,

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

2022-10-03 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. @akhuang I noticed that https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/MSVC.cpp#L199-L200 has got an explicit check for `Args.hasArg(options::OPT__SLASH_MD, options::OPT__SLASH_MDd)` - I think that this would need to be amended to handle th

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

2022-09-15 Thread Amy Huang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGfda44bedd64d: Add Clang driver flags equivalent to cl's /MD, /MT, /MDd, /MTd. (authored by akhuang). Repository: rG LLVM Github Monorepo CHANGES

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

2022-09-15 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 460456. akhuang added a comment. ran clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133457/new/ https://reviews.llvm.org/D133457 Files: clang/include/clang/Driver/Options.td clang/lib/Driver/To

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

2022-09-15 Thread Amy Huang via Phabricator via cfe-commits
akhuang added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4493 + + if (Args.hasArg(options::OPT__SLASH_Zl)) { +CmdArgs.push_back("-D_VC_NODEFAULTLIB"); mstorsjo wrote: > If I understand correctly, we still don't have any corresponding

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

2022-09-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. LGTM from my perspective now too. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4493 + + if (Args.hasArg(options::OPT__SLASH_Zl)) { +CmdArgs.push_back("-D_VC_NODEFAULTLIB"); If I understand correctly, we still don't have any c

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

2022-09-14 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 460271. akhuang marked 3 inline comments as done. akhuang added a comment. more comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133457/new/ https://reviews.llvm.org/D133457 Files: clang/include/clang/

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

2022-09-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6546 + if (Triple.isOSWindows() && !D.IsCLMode()) +ProcessVSRuntimeLibrary(Args, CmdArgs); Should this be `Triple.isWindowsMSVCEnvironment()`? We don't want to do this at le

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

2022-09-14 Thread Hans Wennborg via Phabricator via cfe-commits
hans accepted this revision. hans added a comment. This revision is now accepted and ready to land. lgtm, nice! Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4452 + + if (Arg *A = Args.getLastArg(options::OPT_fms_runtime_lib_EQ)) { +StringRef Val = A->getValue(); -

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

2022-09-14 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 460154. akhuang marked an inline comment as done. akhuang added a comment. Address comments, more cleanup Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133457/new/ https://reviews.llvm.org/D133457 Files: cla

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

2022-09-14 Thread Amy Huang via Phabricator via cfe-commits
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.ha

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

2022-09-13 Thread Hans Wennborg via Phabricator via cfe-commits
hans 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); --

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

2022-09-12 Thread Amy Huang via Phabricator via cfe-commits
akhuang added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6480 + // Process Windows runtime flags (equivalent to cl flags /MD, /MDd, /MT, /MTd) + if (Triple.isOSWindows()) { hans wrote: > Could we somehow re-use the logic in Clang::Add

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

2022-09-12 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 459577. akhuang marked 2 inline comments as done. akhuang added a comment. Clean up test, add doc brief to new flag, try to put the flag logic in a separate function Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

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

2022-09-09 Thread Hans Wennborg via Phabricator via cfe-commits
hans added inline comments. Comment at: clang/include/clang/Driver/Options.td:2209 +def fms_runtime_lib_EQ : Joined<["-"], "fms-runtime-lib=">, Group, + Flags<[NoXarchOption, CoreOption]>, HelpText<"Select Windows run-time library">; defm delayed_template_parsing : BoolFOption

[PATCH] D133457: Add Clang driver flags equivalent to cl's /MD, /MT, /MDd, /MTd. This will allow selecting the MS C runtime library without having to use cc1 flags.

2022-09-07 Thread Amy Huang via Phabricator via cfe-commits
akhuang created this revision. Herald added a project: All. akhuang requested review of this revision. Herald added subscribers: cfe-commits, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D133457 Files: clang/include/clang/Driver/Options