mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-04 06:26:28 +00:00
Clients are responsible for initializing the targets, remove it from the disassembler API.
This will break users of the LLVMCreateDisasm API (not that I know of any). They have to call the LLVMInitializeAll* functions from llvm-c/Target.h themselves now. edis' C API in all its horribleness should be unaffected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144385 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -17,14 +17,23 @@
|
||||
#include "../../lib/MC/MCDisassembler/EDInst.h"
|
||||
#include "../../lib/MC/MCDisassembler/EDOperand.h"
|
||||
#include "../../lib/MC/MCDisassembler/EDToken.h"
|
||||
#include "llvm/Support/TargetSelect.h"
|
||||
#include "llvm-c/EnhancedDisassembly.h"
|
||||
using namespace llvm;
|
||||
|
||||
int EDGetDisassembler(EDDisassemblerRef *disassembler,
|
||||
const char *triple,
|
||||
EDAssemblySyntax_t syntax) {
|
||||
EDDisassembler::initialize();
|
||||
|
||||
static bool initialized;
|
||||
if (!initialized) {
|
||||
// Initialize targets and assembly printers/parsers.
|
||||
llvm::InitializeAllTargetInfos();
|
||||
llvm::InitializeAllTargetMCs();
|
||||
llvm::InitializeAllAsmParsers();
|
||||
llvm::InitializeAllDisassemblers();
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
EDDisassembler::AssemblySyntax Syntax;
|
||||
switch (syntax) {
|
||||
default: assert(0 && "Unknown assembly syntax!");
|
||||
|
@@ -249,7 +249,6 @@ int Disassembler::disassembleEnhanced(const std::string &TS,
|
||||
break;
|
||||
}
|
||||
|
||||
EDDisassembler::initialize();
|
||||
OwningPtr<EDDisassembler>
|
||||
disassembler(EDDisassembler::getDisassembler(TS.c_str(), AS));
|
||||
|
||||
|
Reference in New Issue
Block a user