From bdce3885c4e1c1b96d30cf76d005d661401fbe03 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Sat, 4 Feb 2012 07:45:35 +0000 Subject: 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 --- llvm/lib/MC/MCDisassembler/EDDisassembler.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'llvm/lib/MC/MCDisassembler/EDDisassembler.h') diff --git a/llvm/lib/MC/MCDisassembler/EDDisassembler.h b/llvm/lib/MC/MCDisassembler/EDDisassembler.h index 97c2d1f..e97f11d 100644 --- a/llvm/lib/MC/MCDisassembler/EDDisassembler.h +++ b/llvm/lib/MC/MCDisassembler/EDDisassembler.h @@ -25,6 +25,7 @@ #include #include +#include #include 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 -- cgit v1.1