Replace the old algorithm that emitted the "print the alias for an instruction"

with the newer, cleaner model. It uses the IAPrinter class to hold the
information that is needed to match an instruction with its alias. This also
takes into account the available features of the platform.

There is one bit of ugliness. The way the logic determines if a pattern is
unique is O(N**2), which is gross. But in reality, the number of items it's
checking against isn't large. So while it's N**2, it shouldn't be a massive time
sink.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129110 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2011-04-07 21:20:06 +00:00
parent e578252c27
commit 44dcfd3625
6 changed files with 94 additions and 158 deletions

View File

@@ -25,9 +25,12 @@ protected:
/// assembly emission is disable.
raw_ostream *CommentStream;
const MCAsmInfo &MAI;
/// The current set of available features.
unsigned AvailableFeatures;
public:
MCInstPrinter(const MCAsmInfo &mai)
: CommentStream(0), MAI(mai) {}
: CommentStream(0), MAI(mai), AvailableFeatures(0) {}
virtual ~MCInstPrinter();
@@ -44,6 +47,9 @@ public:
/// getRegName - Return the assembler register name.
virtual StringRef getRegName(unsigned RegNo) const;
unsigned getAvailableFeatures() const { return AvailableFeatures; }
void setAvailableFeatures(unsigned Value) { AvailableFeatures = Value; }
};
} // namespace llvm