SubtargetEmitter fix
authorArnold Schwaighofer <aschwaighofer@apple.com>
Wed, 5 Jun 2013 14:06:50 +0000 (14:06 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Wed, 5 Jun 2013 14:06:50 +0000 (14:06 +0000)
Don't output data if we are supposed to ignore the record.

Reapply of 183255, I don't think this was causing the tablegen segfault on linux
testers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183311 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/SubtargetEmitter.cpp

index 4918b1b143ec5b8269837caa985e5b6578b10a7d..993eead9e131f8d09f9d5ecfe4d0065887140c79 100644 (file)
@@ -1340,11 +1340,11 @@ void SubtargetEmitter::EmitSchedModelHelpers(std::string ClassName,
         for (std::vector<CodeGenSchedTransition>::const_iterator
                TI = SC.Transitions.begin(), TE = SC.Transitions.end();
              TI != TE; ++TI) {
-          OS << "      if (";
           if (*PI != 0 && !std::count(TI->ProcIndices.begin(),
                                       TI->ProcIndices.end(), *PI)) {
               continue;
           }
+          OS << "      if (";
           for (RecIter RI = TI->PredTerm.begin(), RE = TI->PredTerm.end();
                RI != RE; ++RI) {
             if (RI != TI->PredTerm.begin())