Make it compile with GCC 3.0.4

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1786 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2002-02-24 23:01:21 +00:00
parent 04bb837cc0
commit 1ddf664f74
7 changed files with 12 additions and 10 deletions

View File

@@ -10,7 +10,7 @@ struct RAV { // Register Allocator Value
const Value *V; const Value *V;
RAV(const Value *v) : V(v) {} RAV(const Value *v) : V(v) {}
}; };
ostream &operator<<(ostream &out, RAV Val); std::ostream &operator<<(std::ostream &out, RAV Val);
typedef std::set<const Value*> ValueSet; typedef std::set<const Value*> ValueSet;

View File

@@ -10,7 +10,7 @@ struct RAV { // Register Allocator Value
const Value *V; const Value *V;
RAV(const Value *v) : V(v) {} RAV(const Value *v) : V(v) {}
}; };
ostream &operator<<(ostream &out, RAV Val); std::ostream &operator<<(std::ostream &out, RAV Val);
typedef std::set<const Value*> ValueSet; typedef std::set<const Value*> ValueSet;

View File

@@ -10,6 +10,7 @@
#include "llvm/BasicBlock.h" #include "llvm/BasicBlock.h"
#include "llvm/Support/CFG.h" #include "llvm/Support/CFG.h"
#include "Support/SetOperations.h" #include "Support/SetOperations.h"
#include <iostream>
/// BROKEN: Should not include sparc stuff directly into here /// BROKEN: Should not include sparc stuff directly into here
#include "../../Target/Sparc/SparcInternals.h" // Only for PHI defn #include "../../Target/Sparc/SparcInternals.h" // Only for PHI defn

View File

@@ -5,7 +5,7 @@
#include "llvm/ConstantVals.h" #include "llvm/ConstantVals.h"
#include <iostream> #include <iostream>
ostream &operator<<(ostream &O, RAV V) { // func to print a Value std::ostream &operator<<(std::ostream &O, RAV V) { // func to print a Value
const Value *v = V.V; const Value *v = V.V;
if (v->hasName()) if (v->hasName())
return O << v << "(" << v->getName() << ") "; return O << v << "(" << v->getName() << ") ";

View File

@@ -10,6 +10,7 @@
#include "llvm/BasicBlock.h" #include "llvm/BasicBlock.h"
#include "llvm/Support/CFG.h" #include "llvm/Support/CFG.h"
#include "Support/SetOperations.h" #include "Support/SetOperations.h"
#include <iostream>
/// BROKEN: Should not include sparc stuff directly into here /// BROKEN: Should not include sparc stuff directly into here
#include "../../Target/Sparc/SparcInternals.h" // Only for PHI defn #include "../../Target/Sparc/SparcInternals.h" // Only for PHI defn

View File

@@ -5,7 +5,7 @@
#include "llvm/ConstantVals.h" #include "llvm/ConstantVals.h"
#include <iostream> #include <iostream>
ostream &operator<<(ostream &O, RAV V) { // func to print a Value std::ostream &operator<<(std::ostream &O, RAV V) { // func to print a Value
const Value *v = V.V; const Value *v = V.V;
if (v->hasName()) if (v->hasName())
return O << v << "(" << v->getName() << ") "; return O << v << "(" << v->getName() << ") ";

View File

@@ -64,7 +64,7 @@ static long ValidTypes[Type::FirstDerivedTyID] = {
// failed. This provides a nice place to put a breakpoint if you want to see // failed. This provides a nice place to put a breakpoint if you want to see
// why something is not correct. // why something is not correct.
// //
static inline void CheckFailed(const char *Cond, const string &Message, static inline void CheckFailed(const char *Cond, const std::string &Message,
const Value *V1 = 0, const Value *V2 = 0) { const Value *V1 = 0, const Value *V2 = 0) {
std::cerr << Message << "\n"; std::cerr << Message << "\n";
if (V1) std::cerr << V1 << "\n"; if (V1) std::cerr << V1 << "\n";
@@ -100,14 +100,14 @@ static bool verifyInstruction(const Instruction *I) {
// Check that PHI nodes look ok // Check that PHI nodes look ok
if (const PHINode *PN = dyn_cast<PHINode>(I)) { if (const PHINode *PN = dyn_cast<PHINode>(I)) {
vector<const BasicBlock*> Preds(pred_begin(I->getParent()), std::vector<const BasicBlock*> Preds(pred_begin(I->getParent()),
pred_end(I->getParent())); pred_end(I->getParent()));
// Loop over all of the incoming values, make sure that there are // Loop over all of the incoming values, make sure that there are
// predecessors for each one... // predecessors for each one...
// //
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
const BasicBlock *BB = PN->getIncomingBlock(i); const BasicBlock *BB = PN->getIncomingBlock(i);
vector<const BasicBlock*>::iterator PI = std::vector<const BasicBlock*>::iterator PI =
find(Preds.begin(), Preds.end(), BB); find(Preds.begin(), Preds.end(), BB);
Assert2(PI != Preds.end(), "PHI node has entry for basic block that" Assert2(PI != Preds.end(), "PHI node has entry for basic block that"
" is not a predecessor!", PN, BB); " is not a predecessor!", PN, BB);
@@ -115,8 +115,8 @@ static bool verifyInstruction(const Instruction *I) {
} }
// There should be no entries left in the predecessor list... // There should be no entries left in the predecessor list...
for (vector<const BasicBlock*>::iterator I = Preds.begin(), E = Preds.end(); for (std::vector<const BasicBlock*>::iterator I = Preds.begin(),
I != E; ++I) E = Preds.end(); I != E; ++I)
Assert2(0, "PHI node does not have entry for a predecessor basic block!", Assert2(0, "PHI node does not have entry for a predecessor basic block!",
PN, *I); PN, *I);
} }