[PATCH] D136707: [clang][Toolchains][Gnu] pass -gdwarf-* through to assembler
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 26 10:41:06 PDT 2022
MaskRay added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:979
+ unsigned DwarfVersion = GetDwarfVersion(getToolChain(), Args);
+ std::string DV = "-gdwarf-" + std::to_string(DwarfVersion);
+ CmdArgs.push_back(Args.MakeArgString(DV));
----------------
MaskRay wrote:
> MakeArgString accepts a Twine. Just use `"-gdwarf-" + Twine(DwarfVersion);` as the argument.
Twine as a local variable is not safe.
Use `CmdArgs.push_back(Args.MakeArgString("-gdwarf-" + Twine(DwarfVersion)));
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136707/new/
https://reviews.llvm.org/D136707
More information about the cfe-commits
mailing list