mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
Migrate ABIName to MCTargetOptions so that it can be shared between
the TargetMachine level and the MC level. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -10,8 +10,12 @@
|
||||
#ifndef LLVM_MC_MCTARGETOPTIONS_H
|
||||
#define LLVM_MC_MCTARGETOPTIONS_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class StringRef;
|
||||
|
||||
class MCTargetOptions {
|
||||
public:
|
||||
enum AsmInstrumentation {
|
||||
@@ -31,6 +35,11 @@ public:
|
||||
bool ShowMCInst : 1;
|
||||
bool AsmVerbose : 1;
|
||||
int DwarfVersion;
|
||||
/// getABIName - If this returns a non-empty string this represents the
|
||||
/// textual name of the ABI that we want the backend to use, e.g. o32, or
|
||||
/// aapcs-linux.
|
||||
StringRef getABIName() const;
|
||||
std::string ABIName;
|
||||
MCTargetOptions();
|
||||
};
|
||||
|
||||
@@ -45,7 +54,8 @@ inline bool operator==(const MCTargetOptions &LHS, const MCTargetOptions &RHS) {
|
||||
ARE_EQUAL(ShowMCEncoding) &&
|
||||
ARE_EQUAL(ShowMCInst) &&
|
||||
ARE_EQUAL(AsmVerbose) &&
|
||||
ARE_EQUAL(DwarfVersion));
|
||||
ARE_EQUAL(DwarfVersion) &&
|
||||
ARE_EQUAL(ABIName));
|
||||
#undef ARE_EQUAL
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,11 @@ cl::opt<bool> ShowMCInst("asm-show-inst",
|
||||
cl::desc("Emit internal instruction representation to "
|
||||
"assembly file"));
|
||||
|
||||
cl::opt<std::string>
|
||||
ABIName("target-abi", cl::Hidden,
|
||||
cl::desc("The name of the ABI to be targeted from the backend."),
|
||||
cl::init(""));
|
||||
|
||||
static inline MCTargetOptions InitMCTargetOptionsFromFlags() {
|
||||
MCTargetOptions Options;
|
||||
Options.SanitizeAddress =
|
||||
@@ -47,6 +52,7 @@ static inline MCTargetOptions InitMCTargetOptionsFromFlags() {
|
||||
Options.MCRelaxAll = RelaxAll;
|
||||
Options.DwarfVersion = DwarfVersion;
|
||||
Options.ShowMCInst = ShowMCInst;
|
||||
Options.ABIName = ABIName;
|
||||
return Options;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user