mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
createMCInstPrinter doesn't need TargetMachine anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134525 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -127,7 +127,7 @@ static bool ByteArrayFromString(ByteArrayTy &ByteArray,
|
||||
return false;
|
||||
}
|
||||
|
||||
int Disassembler::disassemble(const Target &T, TargetMachine &TM,
|
||||
int Disassembler::disassemble(const Target &T,
|
||||
const std::string &Triple,
|
||||
MemoryBuffer &Buffer,
|
||||
raw_ostream &Out) {
|
||||
@@ -146,7 +146,7 @@ int Disassembler::disassemble(const Target &T, TargetMachine &TM,
|
||||
}
|
||||
|
||||
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
OwningPtr<MCInstPrinter> IP(T.createMCInstPrinter(TM, AsmPrinterVariant,
|
||||
OwningPtr<MCInstPrinter> IP(T.createMCInstPrinter(AsmPrinterVariant,
|
||||
*AsmInfo));
|
||||
if (!IP) {
|
||||
errs() << "error: no instruction printer for target " << Triple << '\n';
|
||||
|
@@ -21,13 +21,11 @@ namespace llvm {
|
||||
|
||||
class MemoryBuffer;
|
||||
class Target;
|
||||
class TargetMachine;
|
||||
class raw_ostream;
|
||||
|
||||
class Disassembler {
|
||||
public:
|
||||
static int disassemble(const Target &target,
|
||||
TargetMachine &TM,
|
||||
const std::string &tripleString,
|
||||
MemoryBuffer &buffer,
|
||||
raw_ostream &Out);
|
||||
|
@@ -343,7 +343,7 @@ static int AssembleInput(const char *ProgName) {
|
||||
// FIXME: There is a bit of code duplication with addPassesToEmitFile.
|
||||
if (FileType == OFT_AssemblyFile) {
|
||||
MCInstPrinter *IP =
|
||||
TheTarget->createMCInstPrinter(*TM, OutputAsmVariant, *MAI);
|
||||
TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI);
|
||||
MCCodeEmitter *CE = 0;
|
||||
TargetAsmBackend *TAB = 0;
|
||||
if (ShowEncoding) {
|
||||
@@ -426,7 +426,7 @@ static int DisassembleInput(const char *ProgName, bool Enhanced) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
Res = Disassembler::disassemble(*TheTarget, *TM, TripleName,
|
||||
Res = Disassembler::disassemble(*TheTarget, TripleName,
|
||||
*Buffer.take(), Out->os());
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,6 @@
|
||||
#include "llvm/Support/SourceMgr.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/system_error.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
#include "llvm/Target/TargetSelect.h"
|
||||
#include <algorithm>
|
||||
@@ -196,22 +195,9 @@ static void DisassembleInput(const StringRef &Filename) {
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: We shouldn't need to do this (and link in codegen).
|
||||
// When we split this out, we should do it in a way that makes
|
||||
// it straightforward to switch subtargets on the fly (.e.g,
|
||||
// the .cpu and .code16 directives).
|
||||
std::string FeaturesStr;
|
||||
std::string CPU;
|
||||
OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, CPU,
|
||||
FeaturesStr));
|
||||
if (!TM) {
|
||||
errs() << "error: could not create target for triple " << TripleName << "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
OwningPtr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
|
||||
*TM, AsmPrinterVariant, *AsmInfo));
|
||||
AsmPrinterVariant, *AsmInfo));
|
||||
if (!IP) {
|
||||
errs() << "error: no instruction printer for target " << TripleName << '\n';
|
||||
return;
|
||||
|
Reference in New Issue
Block a user