summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDisassembler/EDDisassembler.h
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2012-02-04 07:45:35 +0000
committerSean Callanan <scallanan@apple.com>2012-02-04 07:45:35 +0000
commitbdce3885c4e1c1b96d30cf76d005d661401fbe03 (patch)
tree7c31fedf12d676ca7e342aa563cc3e90c781a7b4 /llvm/lib/MC/MCDisassembler/EDDisassembler.h
parent8dd3425077ba7d49b922f37158217a6905ca4692 (diff)
downloadbcm5719-llvm-bdce3885c4e1c1b96d30cf76d005d661401fbe03.tar.gz
bcm5719-llvm-bdce3885c4e1c1b96d30cf76d005d661401fbe03.zip
Modified the Enhanced Disassembler to create and
cache disassemblers according to the string value of the target triple, not according to the enum of the triple CPU. The reason for this is that certain attributes of the instruction set are not reflected in the enum, but only in the string. llvm-svn: 149773
Diffstat (limited to 'llvm/lib/MC/MCDisassembler/EDDisassembler.h')
-rw-r--r--llvm/lib/MC/MCDisassembler/EDDisassembler.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCDisassembler/EDDisassembler.h b/llvm/lib/MC/MCDisassembler/EDDisassembler.h
index 97c2d1fd99b..e97f11d44c1 100644
--- a/llvm/lib/MC/MCDisassembler/EDDisassembler.h
+++ b/llvm/lib/MC/MCDisassembler/EDDisassembler.h
@@ -25,6 +25,7 @@
#include <map>
#include <set>
+#include <string>
#include <vector>
namespace llvm {
@@ -74,21 +75,21 @@ struct EDDisassembler {
/// pair
struct CPUKey {
/// The architecture type
- llvm::Triple::ArchType Arch;
+ std::string Triple;
/// The assembly syntax
AssemblySyntax Syntax;
/// operator== - Equality operator
bool operator==(const CPUKey &key) const {
- return (Arch == key.Arch &&
+ return (Triple == key.Triple &&
Syntax == key.Syntax);
}
/// operator< - Less-than operator
bool operator<(const CPUKey &key) const {
- return ((Arch < key.Arch) ||
- ((Arch == key.Arch) && Syntax < (key.Syntax)));
+ return ((Triple < key.Triple) ||
+ ((Triple == key.Triple) && Syntax < (key.Syntax)));
}
};
@@ -126,8 +127,10 @@ struct EDDisassembler {
/// The stream to write errors to
llvm::raw_ostream &ErrorStream;
- /// The architecture/syntax pair for the current architecture
+ /// The triple/syntax pair for the current architecture
CPUKey Key;
+ /// The Triple fur the current architecture
+ Triple TgtTriple;
/// The LLVM target corresponding to the disassembler
const llvm::Target *Tgt;
/// The assembly information for the target architecture
OpenPOWER on IntegriCloud