mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user