diff options
author | Ahmed Charles <ace2001ac@gmail.com> | 2012-02-19 11:37:01 +0000 |
---|---|---|
committer | Ahmed Charles <ace2001ac@gmail.com> | 2012-02-19 11:37:01 +0000 |
commit | b0934ab7d811e23bf530371976b8b35f3242169c (patch) | |
tree | 11a0f1c5a9a90a6084360819fbc67b6933a11bc0 /lib/MC/MCDisassembler | |
parent | d7ace3f8d1b7216d7381c408b26259e1201f7c29 (diff) | |
download | external_llvm-b0934ab7d811e23bf530371976b8b35f3242169c.zip external_llvm-b0934ab7d811e23bf530371976b8b35f3242169c.tar.gz external_llvm-b0934ab7d811e23bf530371976b8b35f3242169c.tar.bz2 |
Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150918 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCDisassembler')
-rw-r--r-- | lib/MC/MCDisassembler/EDDisassembler.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/MC/MCDisassembler/EDDisassembler.cpp b/lib/MC/MCDisassembler/EDDisassembler.cpp index 9edf505..ea77902 100644 --- a/lib/MC/MCDisassembler/EDDisassembler.cpp +++ b/lib/MC/MCDisassembler/EDDisassembler.cpp @@ -104,27 +104,22 @@ EDDisassembler *EDDisassembler::getDisassembler(StringRef str, CPUKey key; key.Triple = str.str(); key.Syntax = syntax; - + EDDisassembler::DisassemblerMap_t::iterator i = sDisassemblers.find(key); - + if (i != sDisassemblers.end()) { return i->second; } - else { - EDDisassembler *sdd = new EDDisassembler(key); - if (!sdd->valid()) { - delete sdd; - return NULL; - } - - sDisassemblers[key] = sdd; - - return sdd; + + EDDisassembler *sdd = new EDDisassembler(key); + if (!sdd->valid()) { + delete sdd; + return NULL; } - - return NULL; - - return getDisassembler(Triple(str).getArch(), syntax); + + sDisassemblers[key] = sdd; + + return sdd; } EDDisassembler::EDDisassembler(CPUKey &key) : |