llvm.org GIT mirror llvm / 55bf375
Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header as much as it is for stamping out some global/static variables git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319086 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 3 years ago
8 changed file(s) with 88 addition(s) and 89 deletion(s). Raw diff Collapse all Expand all
1616 #include "llvm/IR/Instructions.h"
1717 #include "llvm/IR/Intrinsics.h"
1818 #include "llvm/IR/Module.h"
19 #include "llvm/MC/MCTargetOptionsCommandFlags.h"
19 #include "llvm/MC/MCTargetOptionsCommandFlags.def"
2020 #include "llvm/MC/SubtargetFeature.h"
2121 #include "llvm/Support/CodeGen.h"
2222 #include "llvm/Support/CommandLine.h"
0 //===-- MCTargetOptionsCommandFlags.h --------------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains machine code-specific flags that are shared between
10 // different command line tools.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
15 #define LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
16
17 #include "llvm/MC/MCTargetOptions.h"
18 #include "llvm/Support/CommandLine.h"
19 using namespace llvm;
20
21 static cl::opt AsmInstrumentation(
22 "asm-instrumentation", cl::desc("Instrumentation of inline assembly and "
23 "assembly source files"),
24 cl::init(MCTargetOptions::AsmInstrumentationNone),
25 cl::values(clEnumValN(MCTargetOptions::AsmInstrumentationNone, "none",
26 "no instrumentation at all"),
27 clEnumValN(MCTargetOptions::AsmInstrumentationAddress, "address",
28 "instrument instructions with memory arguments")));
29
30 static cl::opt RelaxAll("mc-relax-all",
31 cl::desc("When used with filetype=obj, "
32 "relax all fixups in the emitted object file"));
33
34 static cl::opt IncrementalLinkerCompatible(
35 "incremental-linker-compatible",
36 cl::desc(
37 "When used with filetype=obj, "
38 "emit an object file which can be used with an incremental linker"));
39
40 static cl::opt PIECopyRelocations("pie-copy-relocations", cl::desc("PIE Copy Relocations"));
41
42 static cl::opt DwarfVersion("dwarf-version", cl::desc("Dwarf version"),
43 cl::init(0));
44
45 static cl::opt ShowMCInst("asm-show-inst",
46 cl::desc("Emit internal instruction representation to "
47 "assembly file"));
48
49 static cl::opt FatalWarnings("fatal-warnings",
50 cl::desc("Treat warnings as errors"));
51
52 static cl::opt NoWarn("no-warn", cl::desc("Suppress all warnings"));
53 static cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn));
54
55 static cl::opt NoDeprecatedWarn("no-deprecated-warn",
56 cl::desc("Suppress all deprecated warnings"));
57
58 static cl::opt
59 ABIName("target-abi", cl::Hidden,
60 cl::desc("The name of the ABI to be targeted from the backend."),
61 cl::init(""));
62
63 static MCTargetOptions InitMCTargetOptionsFromFlags() {
64 MCTargetOptions Options;
65 Options.SanitizeAddress =
66 (AsmInstrumentation == MCTargetOptions::AsmInstrumentationAddress);
67 Options.MCRelaxAll = RelaxAll;
68 Options.MCIncrementalLinkerCompatible = IncrementalLinkerCompatible;
69 Options.MCPIECopyRelocations = PIECopyRelocations;
70 Options.DwarfVersion = DwarfVersion;
71 Options.ShowMCInst = ShowMCInst;
72 Options.ABIName = ABIName;
73 Options.MCFatalWarnings = FatalWarnings;
74 Options.MCNoWarn = NoWarn;
75 Options.MCNoDeprecatedWarn = NoDeprecatedWarn;
76 return Options;
77 }
78
79 #endif
+0
-80
include/llvm/MC/MCTargetOptionsCommandFlags.h less more
None //===-- MCTargetOptionsCommandFlags.h --------------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains machine code-specific flags that are shared between
10 // different command line tools.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
15 #define LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
16
17 #include "llvm/MC/MCTargetOptions.h"
18 #include "llvm/Support/CommandLine.h"
19 using namespace llvm;
20
21 cl::opt AsmInstrumentation(
22 "asm-instrumentation", cl::desc("Instrumentation of inline assembly and "
23 "assembly source files"),
24 cl::init(MCTargetOptions::AsmInstrumentationNone),
25 cl::values(clEnumValN(MCTargetOptions::AsmInstrumentationNone, "none",
26 "no instrumentation at all"),
27 clEnumValN(MCTargetOptions::AsmInstrumentationAddress, "address",
28 "instrument instructions with memory arguments")));
29
30 cl::opt RelaxAll("mc-relax-all",
31 cl::desc("When used with filetype=obj, "
32 "relax all fixups in the emitted object file"));
33
34 cl::opt IncrementalLinkerCompatible(
35 "incremental-linker-compatible",
36 cl::desc(
37 "When used with filetype=obj, "
38 "emit an object file which can be used with an incremental linker"));
39
40 cl::opt PIECopyRelocations("pie-copy-relocations", cl::desc("PIE Copy Relocations"));
41
42 cl::opt DwarfVersion("dwarf-version", cl::desc("Dwarf version"),
43 cl::init(0));
44
45 cl::opt ShowMCInst("asm-show-inst",
46 cl::desc("Emit internal instruction representation to "
47 "assembly file"));
48
49 cl::opt FatalWarnings("fatal-warnings",
50 cl::desc("Treat warnings as errors"));
51
52 cl::opt NoWarn("no-warn", cl::desc("Suppress all warnings"));
53 cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn));
54
55 cl::opt NoDeprecatedWarn("no-deprecated-warn",
56 cl::desc("Suppress all deprecated warnings"));
57
58 cl::opt
59 ABIName("target-abi", cl::Hidden,
60 cl::desc("The name of the ABI to be targeted from the backend."),
61 cl::init(""));
62
63 static inline MCTargetOptions InitMCTargetOptionsFromFlags() {
64 MCTargetOptions Options;
65 Options.SanitizeAddress =
66 (AsmInstrumentation == MCTargetOptions::AsmInstrumentationAddress);
67 Options.MCRelaxAll = RelaxAll;
68 Options.MCIncrementalLinkerCompatible = IncrementalLinkerCompatible;
69 Options.MCPIECopyRelocations = PIECopyRelocations;
70 Options.DwarfVersion = DwarfVersion;
71 Options.ShowMCInst = ShowMCInst;
72 Options.ABIName = ABIName;
73 Options.MCFatalWarnings = FatalWarnings;
74 Options.MCNoWarn = NoWarn;
75 Options.MCNoDeprecatedWarn = NoDeprecatedWarn;
76 return Options;
77 }
78
79 #endif
5454 #include "llvm/MC/MCStreamer.h"
5555 #include "llvm/MC/MCSubtargetInfo.h"
5656 #include "llvm/MC/MCTargetOptions.h"
57 #include "llvm/MC/MCTargetOptionsCommandFlags.h"
57 #include "llvm/MC/MCTargetOptionsCommandFlags.def"
5858 #include "llvm/Object/MachO.h"
5959 #include "llvm/Object/ObjectFile.h"
6060 #include "llvm/Object/SymbolicFile.h"
2828 #include "llvm/MC/MCRegisterInfo.h"
2929 #include "llvm/MC/MCSectionELF.h"
3030 #include "llvm/MC/MCStreamer.h"
31 #include "llvm/MC/MCTargetOptionsCommandFlags.h"
31 #include "llvm/MC/MCTargetOptionsCommandFlags.def"
3232 #include "llvm/Object/Decompressor.h"
3333 #include "llvm/Object/ObjectFile.h"
3434 #include "llvm/Support/Compression.h"
2525 #include "llvm/MC/MCSectionMachO.h"
2626 #include "llvm/MC/MCStreamer.h"
2727 #include "llvm/MC/MCSubtargetInfo.h"
28 #include "llvm/MC/MCTargetOptionsCommandFlags.h"
28 #include "llvm/MC/MCTargetOptionsCommandFlags.def"
2929 #include "llvm/Support/CommandLine.h"
3030 #include "llvm/Support/Compression.h"
3131 #include "llvm/Support/FileUtilities.h"
2323 #include "llvm/MC/MCSectionMachO.h"
2424 #include "llvm/MC/MCStreamer.h"
2525 #include "llvm/MC/MCSubtargetInfo.h"
26 #include "llvm/MC/MCTargetOptionsCommandFlags.h"
26 #include "llvm/MC/MCTargetOptionsCommandFlags.def"
2727 #include "llvm/Support/MemoryBuffer.h"
2828 #include "llvm/Support/CommandLine.h"
2929 #include "llvm/Support/FileUtilities.h"
2626 #include "llvm/MC/MCRegisterInfo.h"
2727 #include "llvm/MC/MCStreamer.h"
2828 #include "llvm/MC/MCSubtargetInfo.h"
29 #include "llvm/MC/MCTargetOptionsCommandFlags.h"
29 #include "llvm/MC/MCTargetOptionsCommandFlags.def"
3030 #include "llvm/PassAnalysisSupport.h"
3131 #include "llvm/Support/LEB128.h"
3232 #include "llvm/Support/TargetRegistry.h"
154154 MC.reset(new MCContext(MAI.get(), MRI.get(), MOFI.get()));
155155 MOFI->InitMCObjectFileInfo(TheTriple, /*PIC*/ false, *MC);
156156
157 MCTargetOptions Options;
158 MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, "", Options);
157 MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
158 MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, "", MCOptions);
159159 if (!MAB)
160160 return make_error("no asm backend for target " + TripleName,
161161 inconvertibleErrorCode());
178178
179179 Stream = make_unique(FileBytes);
180180
181 MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
182181 MS = TheTarget->createMCObjectStreamer(
183182 TheTriple, *MC, std::unique_ptr(MAB), *Stream,
184183 std::unique_ptr(MCE), *MSTI, MCOptions.MCRelaxAll,