Fix a build problem with xlc. The error message was
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 2 Nov 2012 20:57:36 +0000 (20:57 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 2 Nov 2012 20:57:36 +0000 (20:57 +0000)
"../llvm-git/utils/TableGen/CodeGenSchedule.cpp", line 1594.12: 1540-0218 (S) The call does not match any parameter list for "operator+".
"../llvm-git/include/llvm/ADT/STLExtras.h", line 130.1: 1540-1283 (I) "template <class _Iterator, class Func> llvm::operator+(mapped_iterator<_Iterator,Func>::difference_type, const mapped_iterator<_Iterator,Func> &)" is not a viable candidate.

Patch by Kai.

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

utils/TableGen/CodeGenSchedule.cpp
utils/TableGen/SubtargetEmitter.cpp

index a8c9392be71cf348773390df3d81bd984cbd3e8b..63cc97a8c1da36e2dc20699e59e742c1770ab73b 100644 (file)
@@ -1591,7 +1591,7 @@ unsigned CodeGenProcModel::getProcResourceIdx(Record *PRDef) const {
     PrintFatalError(PRDef->getLoc(), "ProcResource def is not included in "
                     "the ProcResources list for " + ModelName);
   // Idx=0 is reserved for invalid.
-  return 1 + PRPos - ProcResourceDefs.begin();
+  return 1 + (PRPos - ProcResourceDefs.begin());
 }
 
 #ifndef NDEBUG
index 806bda1cbc361e4c8ba500c5fbd6429b8f65c850..f1a06bb5288772e107f725bc6d3160a934234d16 100644 (file)
@@ -1053,7 +1053,7 @@ void SubtargetEmitter::EmitSchedClassTables(SchedClassTables &SchedTables,
       continue;
 
     std::vector<MCSchedClassDesc> &SCTab =
-      SchedTables.ProcSchedClasses[1 + PI - SchedModels.procModelBegin()];
+      SchedTables.ProcSchedClasses[1 + (PI - SchedModels.procModelBegin())];
 
     OS << "\n// {Name, NumMicroOps, BeginGroup, EndGroup,"
        << " WriteProcResIdx,#, WriteLatencyIdx,#, ReadAdvanceIdx,#}\n";