MC: Provide the target triple to AsmBackend constructors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98220 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2010-03-11 01:34:16 +00:00
parent bd97376200
commit 6c27f5e574
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);
}