llvm.org GIT mirror llvm / 6c27f5e
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 Daniel Dunbar 10 years ago
3 changed file(s) with 11 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
6565 MCStreamer &Streamer,
6666 const MCAsmInfo *MAI);
6767 typedef TargetAsmBackend *(*AsmBackendCtorTy)(const Target &T,
68 MCAssembler &A);
68 const std::string &TT);
6969 typedef TargetAsmLexer *(*AsmLexerCtorTy)(const Target &T,
7070 const MCAsmInfo &MAI);
7171 typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,MCAsmParser &P);
207207
208208 /// createAsmBackend - Create a target specific assembly parser.
209209 ///
210 /// \arg Triple - The target triple string.
210211 /// \arg Backend - The target independent assembler object.
211 TargetAsmBackend *createAsmBackend(MCAssembler &Backend) const {
212 TargetAsmBackend *createAsmBackend(const std::string &Triple) const {
212213 if (!AsmBackendCtorFn)
213214 return 0;
214 return AsmBackendCtorFn(*this, Backend);
215 return AsmBackendCtorFn(*this, Triple);
215216 }
216217
217218 /// createAsmLexer - Create a target specific assembly lexer.
2020
2121 class FunctionPass;
2222 class JITCodeEmitter;
23 class MCAssembler;
2423 class MCCodeEmitter;
2524 class MCContext;
2625 class MachineCodeEmitter;
5655 MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM,
5756 MCContext &Ctx);
5857
59 TargetAsmBackend *createX86_32AsmBackend(const Target &, MCAssembler &);
60 TargetAsmBackend *createX86_64AsmBackend(const Target &, MCAssembler &);
58 TargetAsmBackend *createX86_32AsmBackend(const Target &, const std::string &);
59 TargetAsmBackend *createX86_64AsmBackend(const Target &, const std::string &);
6160
6261 /// createX86EmitCodeToMemory - Returns a pass that converts a register
6362 /// allocated function into raw machine code in a dynamically
1616
1717 class X86AsmBackend : public TargetAsmBackend {
1818 public:
19 X86AsmBackend(const Target &T, MCAssembler &A)
19 X86AsmBackend(const Target &T)
2020 : TargetAsmBackend(T) {}
2121 };
2222
2323 }
2424
2525 TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T,
26 MCAssembler &A) {
27 return new X86AsmBackend(T, A);
26 const std::string &TT) {
27 return new X86AsmBackend(T);
2828 }
2929
3030 TargetAsmBackend *llvm::createX86_64AsmBackend(const Target &T,
31 MCAssembler &A) {
32 return new X86AsmBackend(T, A);
31 const std::string &TT) {
32 return new X86AsmBackend(T);
3333 }