change Target.getInstructionsByEnumValue to return a reference

to a vector that CGT stores instead of synthesizing it on every 
call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98910 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-03-19 00:34:35 +00:00
parent 0392080fbf
commit f65027842e
10 changed files with 41 additions and 37 deletions
+9 -2
View File
@@ -70,6 +70,8 @@ class CodeGenTarget {
void ReadRegisterClasses() const;
void ReadInstructions() const;
void ReadLegalValueTypes() const;
std::vector<const CodeGenInstruction*> InstrsByEnum;
public:
CodeGenTarget();
@@ -210,13 +212,18 @@ public:
/// getInstructionsByEnumValue - Return all of the instructions defined by the
/// target, ordered by their enum value.
void getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
&NumberedInstructions);
const std::vector<const CodeGenInstruction*> &getInstructionsByEnumValue() {
if (InstrsByEnum.empty()) ComputeInstrsByEnum();
return InstrsByEnum;
}
/// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]?
///
bool isLittleEndianEncoding() const;
private:
void ComputeInstrsByEnum();
};
/// ComplexPattern - ComplexPattern info, corresponding to the ComplexPattern