aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/CodeGenTarget.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-19 00:34:35 +0000
committerChris Lattner <sabre@nondot.org>2010-03-19 00:34:35 +0000
commitf65027842e82027dd6e8020586a299aaa548e355 (patch)
treeb55e839013f78c735fb43f2466325ed348200309 /utils/TableGen/CodeGenTarget.cpp
parent0392080fbfa4db375155ff7510119f222801d913 (diff)
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
Diffstat (limited to 'utils/TableGen/CodeGenTarget.cpp')
-rw-r--r--utils/TableGen/CodeGenTarget.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index ea0746fa33..36a9d1ef92 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -300,11 +300,8 @@ GetInstByName(const char *Name,
/// getInstructionsByEnumValue - Return all of the instructions defined by the
/// target, ordered by their enum value.
-void CodeGenTarget::
-getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
- &NumberedInstructions) {
+void CodeGenTarget::ComputeInstrsByEnum() {
const std::map<std::string, CodeGenInstruction> &Insts = getInstructions();
-
const CodeGenInstruction *PHI = GetInstByName("PHI", Insts);
const CodeGenInstruction *INLINEASM = GetInstByName("INLINEASM", Insts);
const CodeGenInstruction *DBG_LABEL = GetInstByName("DBG_LABEL", Insts);
@@ -323,18 +320,18 @@ getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
const CodeGenInstruction *DBG_VALUE = GetInstByName("DBG_VALUE", Insts);
// Print out the rest of the instructions now.
- NumberedInstructions.push_back(PHI);
- NumberedInstructions.push_back(INLINEASM);
- NumberedInstructions.push_back(DBG_LABEL);
- NumberedInstructions.push_back(EH_LABEL);
- NumberedInstructions.push_back(GC_LABEL);
- NumberedInstructions.push_back(KILL);
- NumberedInstructions.push_back(EXTRACT_SUBREG);
- NumberedInstructions.push_back(INSERT_SUBREG);
- NumberedInstructions.push_back(IMPLICIT_DEF);
- NumberedInstructions.push_back(SUBREG_TO_REG);
- NumberedInstructions.push_back(COPY_TO_REGCLASS);
- NumberedInstructions.push_back(DBG_VALUE);
+ InstrsByEnum.push_back(PHI);
+ InstrsByEnum.push_back(INLINEASM);
+ InstrsByEnum.push_back(DBG_LABEL);
+ InstrsByEnum.push_back(EH_LABEL);
+ InstrsByEnum.push_back(GC_LABEL);
+ InstrsByEnum.push_back(KILL);
+ InstrsByEnum.push_back(EXTRACT_SUBREG);
+ InstrsByEnum.push_back(INSERT_SUBREG);
+ InstrsByEnum.push_back(IMPLICIT_DEF);
+ InstrsByEnum.push_back(SUBREG_TO_REG);
+ InstrsByEnum.push_back(COPY_TO_REGCLASS);
+ InstrsByEnum.push_back(DBG_VALUE);
for (inst_iterator II = inst_begin(), E = inst_end(); II != E; ++II)
if (&II->second != PHI &&
&II->second != INLINEASM &&
@@ -348,7 +345,7 @@ getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
&II->second != SUBREG_TO_REG &&
&II->second != COPY_TO_REGCLASS &&
&II->second != DBG_VALUE)
- NumberedInstructions.push_back(&II->second);
+ InstrsByEnum.push_back(&II->second);
}