forked from OSchip/llvm-project
MC: Provide the target triple to AsmBackend constructors.
llvm-svn: 98220
This commit is contained in:
parent
43dc11c525
commit
245f5b2810
|
@ -66,7 +66,7 @@ namespace llvm {
|
||||||
MCStreamer &Streamer,
|
MCStreamer &Streamer,
|
||||||
const MCAsmInfo *MAI);
|
const MCAsmInfo *MAI);
|
||||||
typedef TargetAsmBackend *(*AsmBackendCtorTy)(const Target &T,
|
typedef TargetAsmBackend *(*AsmBackendCtorTy)(const Target &T,
|
||||||
MCAssembler &A);
|
const std::string &TT);
|
||||||
typedef TargetAsmLexer *(*AsmLexerCtorTy)(const Target &T,
|
typedef TargetAsmLexer *(*AsmLexerCtorTy)(const Target &T,
|
||||||
const MCAsmInfo &MAI);
|
const MCAsmInfo &MAI);
|
||||||
typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,MCAsmParser &P);
|
typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,MCAsmParser &P);
|
||||||
|
@ -208,11 +208,12 @@ namespace llvm {
|
||||||
|
|
||||||
/// createAsmBackend - Create a target specific assembly parser.
|
/// createAsmBackend - Create a target specific assembly parser.
|
||||||
///
|
///
|
||||||
|
/// \arg Triple - The target triple string.
|
||||||
/// \arg Backend - The target independent assembler object.
|
/// \arg Backend - The target independent assembler object.
|
||||||
TargetAsmBackend *createAsmBackend(MCAssembler &Backend) const {
|
TargetAsmBackend *createAsmBackend(const std::string &Triple) const {
|
||||||
if (!AsmBackendCtorFn)
|
if (!AsmBackendCtorFn)
|
||||||
return 0;
|
return 0;
|
||||||
return AsmBackendCtorFn(*this, Backend);
|
return AsmBackendCtorFn(*this, Triple);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// createAsmLexer - Create a target specific assembly lexer.
|
/// createAsmLexer - Create a target specific assembly lexer.
|
||||||
|
|
|
@ -21,7 +21,6 @@ namespace llvm {
|
||||||
|
|
||||||
class FunctionPass;
|
class FunctionPass;
|
||||||
class JITCodeEmitter;
|
class JITCodeEmitter;
|
||||||
class MCAssembler;
|
|
||||||
class MCCodeEmitter;
|
class MCCodeEmitter;
|
||||||
class MCContext;
|
class MCContext;
|
||||||
class MachineCodeEmitter;
|
class MachineCodeEmitter;
|
||||||
|
@ -57,8 +56,8 @@ MCCodeEmitter *createX86_32MCCodeEmitter(const Target &, TargetMachine &TM,
|
||||||
MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM,
|
MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM,
|
||||||
MCContext &Ctx);
|
MCContext &Ctx);
|
||||||
|
|
||||||
TargetAsmBackend *createX86_32AsmBackend(const Target &, MCAssembler &);
|
TargetAsmBackend *createX86_32AsmBackend(const Target &, const std::string &);
|
||||||
TargetAsmBackend *createX86_64AsmBackend(const Target &, MCAssembler &);
|
TargetAsmBackend *createX86_64AsmBackend(const Target &, const std::string &);
|
||||||
|
|
||||||
/// createX86EmitCodeToMemory - Returns a pass that converts a register
|
/// createX86EmitCodeToMemory - Returns a pass that converts a register
|
||||||
/// allocated function into raw machine code in a dynamically
|
/// allocated function into raw machine code in a dynamically
|
||||||
|
|
|
@ -17,18 +17,18 @@ namespace {
|
||||||
|
|
||||||
class X86AsmBackend : public TargetAsmBackend {
|
class X86AsmBackend : public TargetAsmBackend {
|
||||||
public:
|
public:
|
||||||
X86AsmBackend(const Target &T, MCAssembler &A)
|
X86AsmBackend(const Target &T)
|
||||||
: TargetAsmBackend(T) {}
|
: TargetAsmBackend(T) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T,
|
TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T,
|
||||||
MCAssembler &A) {
|
const std::string &TT) {
|
||||||
return new X86AsmBackend(T, A);
|
return new X86AsmBackend(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetAsmBackend *llvm::createX86_64AsmBackend(const Target &T,
|
TargetAsmBackend *llvm::createX86_64AsmBackend(const Target &T,
|
||||||
MCAssembler &A) {
|
const std::string &TT) {
|
||||||
return new X86AsmBackend(T, A);
|
return new X86AsmBackend(T);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue