xref: /aosp_15_r20/external/toolchain-utils/compiler_wrapper/print_cmdline_flag.go (revision 760c253c1ed00ce9abd48f8546f08516e57485fe)
1// Copyright 2019 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package main
6
7func processPrintCmdlineFlag(builder *commandBuilder) {
8	printCmd := false
9	builder.transformArgs(func(arg builderArg) string {
10		if arg.value == "-print-cmdline" {
11			printCmd = true
12			return ""
13		}
14		return arg.value
15	})
16	if printCmd {
17		builder.env = &printingEnv{builder.env}
18	}
19}
20