diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-19 00:34:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-19 00:34:35 +0000 |
commit | 918be520dc4da4ffbcf02c858adc243293dbdc29 (patch) | |
tree | 303f83eac68eb6742ac1448a90972dc8315b830d /llvm/utils/TableGen/CodeEmitterGen.cpp | |
parent | 1734e47d200fc75e5d044771441470ac0174609e (diff) | |
download | bcm5719-llvm-918be520dc4da4ffbcf02c858adc243293dbdc29.tar.gz bcm5719-llvm-918be520dc4da4ffbcf02c858adc243293dbdc29.zip |
change Target.getInstructionsByEnumValue to return a reference
to a vector that CGT stores instead of synthesizing it on every
call.
llvm-svn: 98910
Diffstat (limited to 'llvm/utils/TableGen/CodeEmitterGen.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeEmitterGen.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/CodeEmitterGen.cpp b/llvm/utils/TableGen/CodeEmitterGen.cpp index a057dec7ce3..641c22433a1 100644 --- a/llvm/utils/TableGen/CodeEmitterGen.cpp +++ b/llvm/utils/TableGen/CodeEmitterGen.cpp @@ -86,8 +86,8 @@ void CodeEmitterGen::run(raw_ostream &o) { EmitSourceFileHeader("Machine Code Emitter", o); std::string Namespace = Insts[0]->getValueAsString("Namespace") + "::"; - std::vector<const CodeGenInstruction*> NumberedInstructions; - Target.getInstructionsByEnumValue(NumberedInstructions); + const std::vector<const CodeGenInstruction*> &NumberedInstructions = + Target.getInstructionsByEnumValue(); // Emit function declaration o << "unsigned " << Target.getName() << "CodeEmitter::" @@ -95,7 +95,7 @@ void CodeEmitterGen::run(raw_ostream &o) { // Emit instruction base values o << " static const unsigned InstBits[] = {\n"; - for (std::vector<const CodeGenInstruction*>::iterator + for (std::vector<const CodeGenInstruction*>::const_iterator IN = NumberedInstructions.begin(), EN = NumberedInstructions.end(); IN != EN; ++IN) { |