1336809Sdim//===-- MCTargetOptionsCommandFlags.h --------------------------*- C++ -*-===//
2336809Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6336809Sdim//
7336809Sdim//===----------------------------------------------------------------------===//
8336809Sdim//
9336809Sdim// This file contains machine code-specific flags that are shared between
10336809Sdim// different command line tools.
11336809Sdim//
12336809Sdim//===----------------------------------------------------------------------===//
13336809Sdim
14336809Sdim#ifndef LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
15336809Sdim#define LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
16336809Sdim
17336809Sdim#include "llvm/MC/MCTargetOptions.h"
18336809Sdim#include "llvm/Support/CommandLine.h"
19336809Sdimusing namespace llvm;
20336809Sdim
21336809Sdimstatic cl::opt<bool> RelaxAll("mc-relax-all",
22336809Sdim                       cl::desc("When used with filetype=obj, "
23336809Sdim                                "relax all fixups in the emitted object file"));
24336809Sdim
25336809Sdimstatic cl::opt<bool> IncrementalLinkerCompatible(
26336809Sdim    "incremental-linker-compatible",
27336809Sdim    cl::desc(
28336809Sdim        "When used with filetype=obj, "
29336809Sdim        "emit an object file which can be used with an incremental linker"));
30336809Sdim
31336809Sdimstatic cl::opt<int> DwarfVersion("dwarf-version", cl::desc("Dwarf version"),
32336809Sdim                          cl::init(0));
33336809Sdim
34336809Sdimstatic cl::opt<bool> ShowMCInst("asm-show-inst",
35336809Sdim                         cl::desc("Emit internal instruction representation to "
36336809Sdim                                  "assembly file"));
37336809Sdim
38336809Sdimstatic cl::opt<bool> FatalWarnings("fatal-warnings",
39336809Sdim                            cl::desc("Treat warnings as errors"));
40336809Sdim
41336809Sdimstatic cl::opt<bool> NoWarn("no-warn", cl::desc("Suppress all warnings"));
42336809Sdimstatic cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn));
43336809Sdim
44336809Sdimstatic cl::opt<bool> NoDeprecatedWarn("no-deprecated-warn",
45336809Sdim                               cl::desc("Suppress all deprecated warnings"));
46336809Sdim
47336809Sdimstatic cl::opt<std::string>
48336809SdimABIName("target-abi", cl::Hidden,
49336809Sdim        cl::desc("The name of the ABI to be targeted from the backend."),
50336809Sdim        cl::init(""));
51336809Sdim
52336809Sdimstatic MCTargetOptions InitMCTargetOptionsFromFlags() {
53336809Sdim  MCTargetOptions Options;
54336809Sdim  Options.MCRelaxAll = RelaxAll;
55336809Sdim  Options.MCIncrementalLinkerCompatible = IncrementalLinkerCompatible;
56336809Sdim  Options.DwarfVersion = DwarfVersion;
57336809Sdim  Options.ShowMCInst = ShowMCInst;
58336809Sdim  Options.ABIName = ABIName;
59336809Sdim  Options.MCFatalWarnings = FatalWarnings;
60336809Sdim  Options.MCNoWarn = NoWarn;
61336809Sdim  Options.MCNoDeprecatedWarn = NoDeprecatedWarn;
62336809Sdim  return Options;
63336809Sdim}
64336809Sdim
65336809Sdim#endif
66