Add #include <cstdlib> and abort() to silence a warning
authorMisha Brukman <brukman+llvm@gmail.com>
Mon, 2 Aug 2004 14:02:21 +0000 (14:02 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Mon, 2 Aug 2004 14:02:21 +0000 (14:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15413 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ModuloScheduling/MSchedGraph.cpp
lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp

index 9dd955d74464622a8fbb8d2035cc3a4f34c1d098..6bee44d934ab3d4e89f2c74f72e4e28f8434677b 100644 (file)
@@ -1,4 +1,4 @@
-//===-- MSchedGraph.cpp - Scheduling Graph ------------------------*- C++ -*-===//
+//===-- MSchedGraph.cpp - Scheduling Graph ----------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -17,6 +17,7 @@
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "Support/Debug.h"
+#include <cstdlib>
 using namespace llvm;
 
 MSchedGraphNode::MSchedGraphNode(const MachineInstr* inst, 
@@ -35,13 +36,13 @@ void MSchedGraphNode::print(std::ostream &os) const {
 MSchedGraphEdge MSchedGraphNode::getInEdge(MSchedGraphNode *pred) {
   //Loop over all the successors of our predecessor
   //return the edge the corresponds to this in edge
-  for(MSchedGraphNode::succ_iterator I = pred->succ_begin(), E = pred->succ_end();
-      I != E; ++I) {
-    if(*I == this)
+  for (MSchedGraphNode::succ_iterator I = pred->succ_begin(), 
+         E = pred->succ_end(); I != E; ++I) {
+    if (*I == this)
       return I.getEdge();
   }
   assert(0 && "Should have found edge between this node and its predecessor!");
+  abort();
 }
 
 unsigned MSchedGraphNode::getInEdgeNum(MSchedGraphNode *pred) {
index 9dd955d74464622a8fbb8d2035cc3a4f34c1d098..6bee44d934ab3d4e89f2c74f72e4e28f8434677b 100644 (file)
@@ -1,4 +1,4 @@
-//===-- MSchedGraph.cpp - Scheduling Graph ------------------------*- C++ -*-===//
+//===-- MSchedGraph.cpp - Scheduling Graph ----------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -17,6 +17,7 @@
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "Support/Debug.h"
+#include <cstdlib>
 using namespace llvm;
 
 MSchedGraphNode::MSchedGraphNode(const MachineInstr* inst, 
@@ -35,13 +36,13 @@ void MSchedGraphNode::print(std::ostream &os) const {
 MSchedGraphEdge MSchedGraphNode::getInEdge(MSchedGraphNode *pred) {
   //Loop over all the successors of our predecessor
   //return the edge the corresponds to this in edge
-  for(MSchedGraphNode::succ_iterator I = pred->succ_begin(), E = pred->succ_end();
-      I != E; ++I) {
-    if(*I == this)
+  for (MSchedGraphNode::succ_iterator I = pred->succ_begin(), 
+         E = pred->succ_end(); I != E; ++I) {
+    if (*I == this)
       return I.getEdge();
   }
   assert(0 && "Should have found edge between this node and its predecessor!");
+  abort();
 }
 
 unsigned MSchedGraphNode::getInEdgeNum(MSchedGraphNode *pred) {