summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-11-29 01:09:49 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-11-29 01:09:49 +0000
commit62212f0e62e42bd3f9be4ff310380780602273fc (patch)
tree84aab9ef363004da634b07eeb59dd98b3ad9b189 /lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
parente756031a62a944a06c9fce904294bc55c529d755 (diff)
downloadbcm5719-llvm-62212f0e62e42bd3f9be4ff310380780602273fc.tar.gz
bcm5719-llvm-62212f0e62e42bd3f9be4ff310380780602273fc.zip
Patch from Daniel Dunbar for future-proof against http://llvm.org/viewvc/llvm-project?view=rev&revision=145331.
llvm-svn: 145345
Diffstat (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp')
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
index 4871c79f23d..40e5c89ecb0 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
@@ -10,6 +10,7 @@
#include "DisassemblerLLVM.h"
#include "llvm-c/EnhancedDisassembly.h"
+#include "llvm/Support/TargetSelect.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/DataExtractor.h"
@@ -669,6 +670,16 @@ DisassemblerLLVM::DisassemblerLLVM(const ArchSpec &arch) :
m_disassembler (NULL),
m_disassembler_thumb (NULL) // For ARM only
{
+ // Initialize the LLVM objects needed to use the disassembler.
+ static struct InitializeLLVM {
+ InitializeLLVM() {
+ llvm::InitializeAllTargetInfos();
+ llvm::InitializeAllTargetMCs();
+ llvm::InitializeAllAsmParsers();
+ llvm::InitializeAllDisassemblers();
+ }
+ } InitializeLLVM;
+
const std::string &arch_triple = arch.GetTriple().str();
if (!arch_triple.empty())
{
OpenPOWER on IntegriCloud