Tablegen scheduling models don't reference empty itineraries as of r216919, so don...
authorPete Cooper <peter_cooper@apple.com>
Tue, 2 Sep 2014 23:23:34 +0000 (23:23 +0000)
committerPete Cooper <peter_cooper@apple.com>
Tue, 2 Sep 2014 23:23:34 +0000 (23:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216993 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/SubtargetEmitter.cpp

index d05c7c78035d08321c39b5c924f28cfd9b9c66f6..a644d371dfcc3901ff0011da461e1540accabcb5 100644 (file)
@@ -575,12 +575,13 @@ EmitItineraries(raw_ostream &OS,
     assert(ProcItinListsIter != ProcItinLists.end() && "bad iterator");
     std::vector<InstrItinerary> &ItinList = *ProcItinListsIter;
 
+    // Empty itineraries aren't referenced anywhere in the tablegen output
+    // so don't emit them.
+    if (ItinList.empty())
+      continue;
+
     OS << "\n";
     OS << "static const llvm::InstrItinerary ";
-    if (ItinList.empty()) {
-      OS << '*' << Name << " = nullptr;\n";
-      continue;
-    }
 
     // Begin processor itinerary table
     OS << Name << "[] = {\n";