From ced4b139cd8f6145857b0b987e166ceb121e72d1 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 13 Jan 2016 07:20:05 +0000 Subject: [PATCH] [TableGen] Move calls to getValueAsInt out of a loop since they aren't simple functions. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257579 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/AsmWriterEmitter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index 1801c155fa3..40dea9db41d 100644 --- a/utils/TableGen/AsmWriterEmitter.cpp +++ b/utils/TableGen/AsmWriterEmitter.cpp @@ -1090,10 +1090,11 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) { AsmWriterEmitter::AsmWriterEmitter(RecordKeeper &R) : Records(R), Target(R) { Record *AsmWriter = Target.getAsmWriter(); + unsigned Variant = AsmWriter->getValueAsInt("Variant"); + unsigned PassSubtarget = AsmWriter->getValueAsInt("PassSubtarget"); for (const CodeGenInstruction *I : Target.instructions()) if (!I->AsmString.empty() && I->TheDef->getName() != "PHI") - Instructions.emplace_back(*I, AsmWriter->getValueAsInt("Variant"), - AsmWriter->getValueAsInt("PassSubtarget")); + Instructions.emplace_back(*I, Variant, PassSubtarget); // Get the instruction numbering. NumberedInstructions = &Target.getInstructionsByEnumValue(); -- 2.34.1