MC: Provide the target triple to AsmBackend constructors.

llvm-svn: 98220
This commit is contained in:
Daniel Dunbar 2010-03-11 01:34:16 +00:00
parent 43dc11c525
commit 245f5b2810
3 changed files with 11 additions and 11 deletions

View File

@ -66,7 +66,7 @@ namespace llvm {
MCStreamer &Streamer,
const MCAsmInfo *MAI);
typedef TargetAsmBackend *(*AsmBackendCtorTy)(const Target &T,
MCAssembler &A);
const std::string &TT);
typedef TargetAsmLexer *(*AsmLexerCtorTy)(const Target &T,
const MCAsmInfo &MAI);
typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,MCAsmParser &P);
@ -208,11 +208,12 @@ namespace llvm {
/// createAsmBackend - Create a target specific assembly parser.
///
/// \arg Triple - The target triple string.
/// \arg Backend - The target independent assembler object.
TargetAsmBackend *createAsmBackend(MCAssembler &Backend) const {
TargetAsmBackend *createAsmBackend(const std::string &Triple) const {
if (!AsmBackendCtorFn)
return 0;
return AsmBackendCtorFn(*this, Backend);
return AsmBackendCtorFn(*this, Triple);
}
/// createAsmLexer - Create a target specific assembly lexer.

View File

@ -21,7 +21,6 @@ namespace llvm {
class FunctionPass;
class JITCodeEmitter;
class MCAssembler;
class MCCodeEmitter;
class MCContext;
class MachineCodeEmitter;
@ -57,8 +56,8 @@ MCCodeEmitter *createX86_32MCCodeEmitter(const Target &, TargetMachine &TM,
MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM,
MCContext &Ctx);
TargetAsmBackend *createX86_32AsmBackend(const Target &, MCAssembler &);
TargetAsmBackend *createX86_64AsmBackend(const Target &, MCAssembler &);
TargetAsmBackend *createX86_32AsmBackend(const Target &, const std::string &);
TargetAsmBackend *createX86_64AsmBackend(const Target &, const std::string &);
/// createX86EmitCodeToMemory - Returns a pass that converts a register
/// allocated function into raw machine code in a dynamically

View File

@ -17,18 +17,18 @@ namespace {
class X86AsmBackend : public TargetAsmBackend {
public:
X86AsmBackend(const Target &T, MCAssembler &A)
X86AsmBackend(const Target &T)
: TargetAsmBackend(T) {}
};
}
TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T,
MCAssembler &A) {
return new X86AsmBackend(T, A);
const std::string &TT) {
return new X86AsmBackend(T);
}
TargetAsmBackend *llvm::createX86_64AsmBackend(const Target &T,
MCAssembler &A) {
return new X86AsmBackend(T, A);
const std::string &TT) {
return new X86AsmBackend(T);
}