mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
TargetRegistry: Fix create{AsmInfo,MCDisassembler} to return non-const objects.
llvm-svn: 99097
This commit is contained in:
parent
e5614d6b2d
commit
2c99d47702
@ -55,7 +55,7 @@ namespace llvm {
|
||||
|
||||
typedef unsigned (*TripleMatchQualityFnTy)(const std::string &TT);
|
||||
|
||||
typedef const MCAsmInfo *(*AsmInfoCtorFnTy)(const Target &T,
|
||||
typedef MCAsmInfo *(*AsmInfoCtorFnTy)(const Target &T,
|
||||
StringRef TT);
|
||||
typedef TargetMachine *(*TargetMachineCtorTy)(const Target &T,
|
||||
const std::string &TT,
|
||||
@ -68,7 +68,7 @@ namespace llvm {
|
||||
typedef TargetAsmLexer *(*AsmLexerCtorTy)(const Target &T,
|
||||
const MCAsmInfo &MAI);
|
||||
typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,MCAsmParser &P);
|
||||
typedef const MCDisassembler *(*MCDisassemblerCtorTy)(const Target &T);
|
||||
typedef MCDisassembler *(*MCDisassemblerCtorTy)(const Target &T);
|
||||
typedef MCInstPrinter *(*MCInstPrinterCtorTy)(const Target &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
@ -184,7 +184,7 @@ namespace llvm {
|
||||
/// feature set; it should always be provided. Generally this should be
|
||||
/// either the target triple from the module, or the target triple of the
|
||||
/// host if that does not exist.
|
||||
const MCAsmInfo *createAsmInfo(StringRef Triple) const {
|
||||
MCAsmInfo *createAsmInfo(StringRef Triple) const {
|
||||
if (!AsmInfoCtorFn)
|
||||
return 0;
|
||||
return AsmInfoCtorFn(*this, Triple);
|
||||
@ -241,7 +241,7 @@ namespace llvm {
|
||||
return AsmPrinterCtorFn(OS, TM, Streamer);
|
||||
}
|
||||
|
||||
const MCDisassembler *createMCDisassembler() const {
|
||||
MCDisassembler *createMCDisassembler() const {
|
||||
if (!MCDisassemblerCtorFn)
|
||||
return 0;
|
||||
return MCDisassemblerCtorFn(*this);
|
||||
@ -529,7 +529,7 @@ namespace llvm {
|
||||
TargetRegistry::RegisterAsmInfo(T, &Allocator);
|
||||
}
|
||||
private:
|
||||
static const MCAsmInfo *Allocator(const Target &T, StringRef TT) {
|
||||
static MCAsmInfo *Allocator(const Target &T, StringRef TT) {
|
||||
return new MCAsmInfoImpl(T, TT);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
using namespace llvm;
|
||||
|
||||
static const MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) {
|
||||
static MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) {
|
||||
Triple TheTriple(TT);
|
||||
switch (TheTriple.getOS()) {
|
||||
case Triple::Darwin:
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "llvm/Support/FormattedStream.h"
|
||||
using namespace llvm;
|
||||
|
||||
static const MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) {
|
||||
static MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) {
|
||||
Triple TheTriple(TT);
|
||||
bool isPPC64 = TheTriple.getArch() == Triple::ppc64;
|
||||
if (TheTriple.getOS() == Triple::Darwin)
|
||||
|
@ -459,11 +459,11 @@ static void translateInstruction(MCInst &mcInst,
|
||||
}
|
||||
}
|
||||
|
||||
static const MCDisassembler *createX86_32Disassembler(const Target &T) {
|
||||
static MCDisassembler *createX86_32Disassembler(const Target &T) {
|
||||
return new X86Disassembler::X86_32Disassembler;
|
||||
}
|
||||
|
||||
static const MCDisassembler *createX86_64Disassembler(const Target &T) {
|
||||
static MCDisassembler *createX86_64Disassembler(const Target &T) {
|
||||
return new X86Disassembler::X86_64Disassembler;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
using namespace llvm;
|
||||
|
||||
static const MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) {
|
||||
static MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) {
|
||||
Triple TheTriple(TT);
|
||||
switch (TheTriple.getOS()) {
|
||||
case Triple::Darwin:
|
||||
|
Loading…
Reference in New Issue
Block a user