Skip to content

Commit

Permalink
[Driver] Simplify -fno-builtin- handling. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jun 15, 2022
1 parent 509223d commit c418d0f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions clang/lib/Driver/ToolChains/Clang.cpp
Expand Up @@ -3577,20 +3577,13 @@ static void RenderBuiltinOptions(const ToolChain &TC, const llvm::Triple &T,
UseBuiltins = false;

// Process the -fno-builtin-* options.
for (const auto &Arg : Args) {
const Option &O = Arg->getOption();
if (!O.matches(options::OPT_fno_builtin_))
continue;

Arg->claim();
for (const Arg *A : Args.filtered(options::OPT_fno_builtin_)) {
A->claim();

// If -fno-builtin is specified, then there's no need to pass the option to
// the frontend.
if (!UseBuiltins)
continue;

StringRef FuncName = Arg->getValue();
CmdArgs.push_back(Args.MakeArgString("-fno-builtin-" + FuncName));
if (UseBuiltins)
A->render(Args, CmdArgs);
}

// le32-specific flags:
Expand Down

0 comments on commit c418d0f

Please sign in to comment.