summaryrefslogtreecommitdiff
path: root/include/llvm/Assembly
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-01-20 22:54:45 +0000
committerChris Lattner <sabre@nondot.org>2002-01-20 22:54:45 +0000
commit697954c15da58bd8b186dbafdedd8b06db770201 (patch)
treee119a71f09b5c2513c8c270161ae2a858c6f3b96 /include/llvm/Assembly
parent13c4659220bc78a0a3529f4d9e57546e898088e3 (diff)
downloadllvm-697954c15da58bd8b186dbafdedd8b06db770201.tar.gz
llvm-697954c15da58bd8b186dbafdedd8b06db770201.tar.bz2
llvm-697954c15da58bd8b186dbafdedd8b06db770201.tar.xz
Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Assembly')
-rw-r--r--include/llvm/Assembly/CachedWriter.h10
-rw-r--r--include/llvm/Assembly/Parser.h14
-rw-r--r--include/llvm/Assembly/PrintModulePass.h7
-rw-r--r--include/llvm/Assembly/Writer.h38
4 files changed, 36 insertions, 33 deletions
diff --git a/include/llvm/Assembly/CachedWriter.h b/include/llvm/Assembly/CachedWriter.h
index b5171b4097..cccf0377a4 100644
--- a/include/llvm/Assembly/CachedWriter.h
+++ b/include/llvm/Assembly/CachedWriter.h
@@ -11,6 +11,7 @@
#define LLVM_ASSEMBLY_CACHED_WRITER_H
#include "llvm/Assembly/Writer.h"
+#include <iostream>
class AssemblyWriter; // Internal private class
class SlotCalculator;
@@ -19,10 +20,11 @@ class CachedWriter {
AssemblyWriter *AW;
SlotCalculator *SC;
public:
- ostream &Out;
+ std::ostream &Out;
public:
- CachedWriter(ostream &O = cout) : AW(0), SC(0), Out(O) { }
- CachedWriter(const Module *M, ostream &O = cout) : AW(0), SC(0), Out(O) {
+ CachedWriter(std::ostream &O = std::cout) : AW(0), SC(0), Out(O) { }
+ CachedWriter(const Module *M, std::ostream &O = std::cout)
+ : AW(0), SC(0), Out(O) {
setModule(M);
}
~CachedWriter();
@@ -63,7 +65,7 @@ public:
return *this << (const Value*)X;
}
- inline CachedWriter &operator<<(ostream &(&Manip)(ostream &)) {
+ inline CachedWriter &operator<<(std::ostream &(&Manip)(std::ostream &)) {
Out << Manip; return *this;
}
diff --git a/include/llvm/Assembly/Parser.h b/include/llvm/Assembly/Parser.h
index 011594d132..02e5d4fbb6 100644
--- a/include/llvm/Assembly/Parser.h
+++ b/include/llvm/Assembly/Parser.h
@@ -16,7 +16,7 @@ class ParseException;
// The useful interface defined by this file... Parse an ascii file, and return
// the internal representation in a nice slice'n'dice'able representation.
//
-Module *ParseAssemblyFile(const string &Filename);// throw (ParseException);
+Module *ParseAssemblyFile(const std::string &Filename);// throw (ParseException)
//===------------------------------------------------------------------------===
// Helper Classes
@@ -27,7 +27,7 @@ Module *ParseAssemblyFile(const string &Filename);// throw (ParseException);
//
class ParseException {
public:
- ParseException(const string &filename, const string &message,
+ ParseException(const std::string &filename, const std::string &message,
int LineNo = -1, int ColNo = -1);
ParseException(const ParseException &E);
@@ -35,13 +35,13 @@ public:
// getMessage - Return the message passed in at construction time plus extra
// information extracted from the options used to parse with...
//
- const string getMessage() const;
+ const std::string getMessage() const;
- inline const string getRawMessage() const { // Just the raw message...
+ inline const std::string &getRawMessage() const { // Just the raw message...
return Message;
}
- inline const string &getFilename() const {
+ inline const std::string &getFilename() const {
return Filename;
}
@@ -55,8 +55,8 @@ public:
}
private :
- string Filename;
- string Message;
+ std::string Filename;
+ std::string Message;
int LineNo, ColumnNo; // -1 if not relevant
ParseException &operator=(const ParseException &E); // objects by reference
diff --git a/include/llvm/Assembly/PrintModulePass.h b/include/llvm/Assembly/PrintModulePass.h
index a03b3492e6..72d8fabde0 100644
--- a/include/llvm/Assembly/PrintModulePass.h
+++ b/include/llvm/Assembly/PrintModulePass.h
@@ -10,14 +10,15 @@
#include "llvm/Pass.h"
#include "llvm/Assembly/Writer.h"
+#include <iostream>
class PrintModulePass : public Pass {
- string Banner; // String to print before each method
- ostream *Out; // ostream to print on
+ std::string Banner; // String to print before each method
+ std::ostream *Out; // ostream to print on
bool DeleteStream; // Delete the ostream in our dtor?
bool PrintPerMethod; // Print one method at a time rather than the whole?
public:
- inline PrintModulePass(const string &B, ostream *o = &cout,
+ inline PrintModulePass(const std::string &B, std::ostream *o = &std::cout,
bool DS = false,
bool printPerMethod = true)
: Banner(B), Out(o), DeleteStream(DS), PrintPerMethod(printPerMethod) {
diff --git a/include/llvm/Assembly/Writer.h b/include/llvm/Assembly/Writer.h
index 02c9fd0cc1..6ef33ad1b6 100644
--- a/include/llvm/Assembly/Writer.h
+++ b/include/llvm/Assembly/Writer.h
@@ -30,26 +30,26 @@ class SlotCalculator;
// representation of an object into an ascii bytestream that the parser can
// understand later... (the parser only understands whole classes though)
//
-void WriteToAssembly(const Module *Module, ostream &o);
-void WriteToAssembly(const GlobalVariable *G, ostream &o);
-void WriteToAssembly(const Method *Method, ostream &o);
-void WriteToAssembly(const BasicBlock *BB, ostream &o);
-void WriteToAssembly(const Instruction *In, ostream &o);
-void WriteToAssembly(const Constant *V, ostream &o);
+void WriteToAssembly(const Module *Module, std::ostream &o);
+void WriteToAssembly(const GlobalVariable *G, std::ostream &o);
+void WriteToAssembly(const Method *Method, std::ostream &o);
+void WriteToAssembly(const BasicBlock *BB, std::ostream &o);
+void WriteToAssembly(const Instruction *In, std::ostream &o);
+void WriteToAssembly(const Constant *V, std::ostream &o);
// WriteTypeSymbolic - This attempts to write the specified type as a symbolic
// type, iff there is an entry in the modules symbol table for the specified
// type or one of it's component types. This is slower than a simple x << Type;
//
-ostream &WriteTypeSymbolic(ostream &o, const Type *Ty, const Module *Module);
+std::ostream &WriteTypeSymbolic(std::ostream &, const Type *, const Module *M);
// WriteAsOperand - Write the name of the specified value out to the specified
// ostream. This can be useful when you just want to print int %reg126, not the
// whole instruction that generated it.
//
-ostream &WriteAsOperand(ostream &o, const Value *V, bool PrintType = true,
- bool PrintName = true, SlotCalculator *Table = 0);
+std::ostream &WriteAsOperand(std::ostream &, const Value *, bool PrintTy = true,
+ bool PrintName = true, SlotCalculator *Table = 0);
// WriteToVCG - Dump the specified structure to a VCG file. If method is
@@ -57,8 +57,8 @@ ostream &WriteAsOperand(ostream &o, const Value *V, bool PrintType = true,
// family of files with a common base name is created, with a method name
// suffix.
//
-void WriteToVCG(const Module *Module, const string &Filename);
-void WriteToVCG(const Method *Method, const string &Filename);
+void WriteToVCG(const Module *Module, const std::string &Filename);
+void WriteToVCG(const Method *Method, const std::string &Filename);
@@ -66,37 +66,37 @@ void WriteToVCG(const Method *Method, const string &Filename);
// Define operator<< to work on the various classes that we can send to an
// ostream...
//
-inline ostream &operator<<(ostream &o, const Module *C) {
+inline std::ostream &operator<<(std::ostream &o, const Module *C) {
WriteToAssembly(C, o); return o;
}
-inline ostream &operator<<(ostream &o, const GlobalVariable *G) {
+inline std::ostream &operator<<(std::ostream &o, const GlobalVariable *G) {
WriteToAssembly(G, o); return o;
}
-inline ostream &operator<<(ostream &o, const Method *M) {
+inline std::ostream &operator<<(std::ostream &o, const Method *M) {
WriteToAssembly(M, o); return o;
}
-inline ostream &operator<<(ostream &o, const BasicBlock *B) {
+inline std::ostream &operator<<(std::ostream &o, const BasicBlock *B) {
WriteToAssembly(B, o); return o;
}
-inline ostream &operator<<(ostream &o, const Instruction *I) {
+inline std::ostream &operator<<(std::ostream &o, const Instruction *I) {
WriteToAssembly(I, o); return o;
}
-inline ostream &operator<<(ostream &o, const Constant *I) {
+inline std::ostream &operator<<(std::ostream &o, const Constant *I) {
WriteToAssembly(I, o); return o;
}
-inline ostream &operator<<(ostream &o, const Type *T) {
+inline std::ostream &operator<<(std::ostream &o, const Type *T) {
if (!T) return o << "<null Type>";
return o << T->getDescription();
}
-inline ostream &operator<<(ostream &o, const Value *I) {
+inline std::ostream &operator<<(std::ostream &o, const Value *I) {
switch (I->getValueType()) {
case Value::TypeVal: return o << cast<const Type>(I);
case Value::ConstantVal: WriteToAssembly(cast<Constant>(I) , o); break;