summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp16
-rw-r--r--llvm/lib/VMCore/BasicBlock.cpp4
-rw-r--r--llvm/lib/VMCore/Constants.cpp53
-rw-r--r--llvm/lib/VMCore/Dominators.cpp2
-rw-r--r--llvm/lib/VMCore/Function.cpp8
-rw-r--r--llvm/lib/VMCore/InstrTypes.cpp6
-rw-r--r--llvm/lib/VMCore/Instruction.cpp6
-rw-r--r--llvm/lib/VMCore/Module.cpp6
-rw-r--r--llvm/lib/VMCore/SlotCalculator.cpp5
-rw-r--r--llvm/lib/VMCore/SymbolTable.cpp15
-rw-r--r--llvm/lib/VMCore/Type.cpp8
-rw-r--r--llvm/lib/VMCore/Value.cpp8
-rw-r--r--llvm/lib/VMCore/Verifier.cpp3
-rw-r--r--llvm/lib/VMCore/iBranch.cpp3
-rw-r--r--llvm/lib/VMCore/iCall.cpp9
-rw-r--r--llvm/lib/VMCore/iMemory.cpp18
-rw-r--r--llvm/lib/VMCore/iOperators.cpp16
17 files changed, 113 insertions, 73 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 2b3a1c4c220..c218c0fcd00 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -26,6 +26,10 @@
#include "Support/STLExtras.h"
#include <algorithm>
#include <map>
+using std::string;
+using std::map;
+using std::vector;
+using std::ostream;
static const Module *getModuleFromVal(const Value *V) {
if (const MethodArgument *MA =dyn_cast<const MethodArgument>(V))
@@ -112,7 +116,7 @@ static void fillTypeNameTable(const Module *M,
const Type *Ty = cast<const Type>(I->second);
if (!isa<PointerType>(Ty) ||
!cast<PointerType>(Ty)->getElementType()->isPrimitiveType())
- TypeNames.insert(make_pair(Ty, "%"+I->first));
+ TypeNames.insert(std::make_pair(Ty, "%"+I->first));
}
}
}
@@ -215,7 +219,7 @@ static ostream &printTypeInt(ostream &Out, const Type *Ty,
//
vector<const Type *> TypeStack;
string TypeName = calcTypeName(Ty, TypeStack, TypeNames);
- TypeNames.insert(make_pair(Ty, TypeName)); // Cache type name for later use
+ TypeNames.insert(std::make_pair(Ty, TypeName));//Cache type name for later use
return Out << TypeName;
}
@@ -331,7 +335,7 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
writeOperand(GV->getInitializer(), false, false);
printInfoComment(GV);
- Out << endl;
+ Out << "\n";
}
@@ -348,7 +352,7 @@ void AssemblyWriter::printSymbolTable(const SymbolTable &ST) {
if (const Constant *CPV = dyn_cast<const Constant>(V)) {
printConstant(CPV);
} else if (const Type *Ty = dyn_cast<const Type>(V)) {
- Out << "\t%" << I->first << " = type " << Ty->getDescription() << endl;
+ Out << "\t%" << I->first << " = type " << Ty->getDescription() << "\n";
}
}
}
@@ -378,7 +382,7 @@ void AssemblyWriter::printConstant(const Constant *CPV) {
else Out << "<badref>";
}
- Out << endl;
+ Out << "\n";
}
// printMethod - Print all aspects of a method.
@@ -614,7 +618,7 @@ void AssemblyWriter::printInstruction(const Instruction *I) {
}
printInfoComment(I);
- Out << endl;
+ Out << "\n";
}
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp
index 861aea43c25..df999b84bff 100644
--- a/llvm/lib/VMCore/BasicBlock.cpp
+++ b/llvm/lib/VMCore/BasicBlock.cpp
@@ -18,7 +18,7 @@
//
template class ValueHolder<Instruction, BasicBlock, Method>;
-BasicBlock::BasicBlock(const string &name, Method *Parent)
+BasicBlock::BasicBlock(const std::string &name, Method *Parent)
: Value(Type::LabelTy, Value::BasicBlockVal, name), InstList(this, 0),
machineInstrVec(new MachineCodeForBasicBlock) {
if (Parent)
@@ -32,7 +32,7 @@ BasicBlock::~BasicBlock() {
}
// Specialize setName to take care of symbol table majik
-void BasicBlock::setName(const string &name, SymbolTable *ST) {
+void BasicBlock::setName(const std::string &name, SymbolTable *ST) {
Method *P;
assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) &&
"Invalid symtab argument!");
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp
index 257bd7622c9..d9a2fa74314 100644
--- a/llvm/lib/VMCore/Constants.cpp
+++ b/llvm/lib/VMCore/Constants.cpp
@@ -15,6 +15,10 @@
#include <algorithm>
#include <assert.h>
+using std::map;
+using std::pair;
+using std::make_pair;
+
ConstantBool *ConstantBool::True = new ConstantBool(true);
ConstantBool *ConstantBool::False = new ConstantBool(false);
@@ -24,7 +28,7 @@ ConstantBool *ConstantBool::False = new ConstantBool(false);
//===----------------------------------------------------------------------===//
// Specialize setName to take care of symbol table majik
-void Constant::setName(const string &Name, SymbolTable *ST) {
+void Constant::setName(const std::string &Name, SymbolTable *ST) {
assert(ST && "Type::setName - Must provide symbol table argument!");
if (Name.size()) ST->insert(Name, this);
@@ -56,6 +60,7 @@ Constant *Constant::getNullConstant(const Type *Ty) {
#ifndef NDEBUG
#include "llvm/Assembly/Writer.h"
+using std::cerr;
#endif
void Constant::destroyConstantImpl() {
@@ -70,8 +75,8 @@ void Constant::destroyConstantImpl() {
Value *V = use_back();
#ifndef NDEBUG // Only in -g mode...
if (!isa<Constant>(V)) {
- cerr << "While deleting: " << this << endl;
- cerr << "Use still stuck around after Def is destroyed: " << V << endl;
+ cerr << "While deleting: " << this << "\n";
+ cerr << "Use still stuck around after Def is destroyed: " << V << "\n";
}
#endif
assert(isa<Constant>(V) && "References remain to ConstantPointerRef!");
@@ -115,7 +120,7 @@ ConstantFP::ConstantFP(const Type *Ty, double V) : Constant(Ty) {
}
ConstantArray::ConstantArray(const ArrayType *T,
- const vector<Constant*> &V) : Constant(T) {
+ const std::vector<Constant*> &V) : Constant(T) {
for (unsigned i = 0; i < V.size(); i++) {
assert(V[i]->getType() == T->getElementType());
Operands.push_back(Use(V[i], this));
@@ -123,7 +128,7 @@ ConstantArray::ConstantArray(const ArrayType *T,
}
ConstantStruct::ConstantStruct(const StructType *T,
- const vector<Constant*> &V) : Constant(T) {
+ const std::vector<Constant*> &V) : Constant(T) {
const StructType::ElementTypes &ETypes = T->getElementTypes();
for (unsigned i = 0; i < V.size(); i++) {
@@ -142,24 +147,24 @@ ConstantPointerRef::ConstantPointerRef(GlobalValue *GV)
//===----------------------------------------------------------------------===//
// getStrValue implementations
-string ConstantBool::getStrValue() const {
+std::string ConstantBool::getStrValue() const {
return Val ? "true" : "false";
}
-string ConstantSInt::getStrValue() const {
+std::string ConstantSInt::getStrValue() const {
return itostr(Val.Signed);
}
-string ConstantUInt::getStrValue() const {
+std::string ConstantUInt::getStrValue() const {
return utostr(Val.Unsigned);
}
-string ConstantFP::getStrValue() const {
+std::string ConstantFP::getStrValue() const {
return ftostr(Val);
}
-string ConstantArray::getStrValue() const {
- string Result;
+std::string ConstantArray::getStrValue() const {
+ std::string Result;
// As a special case, print the array as a string if it is an array of
// ubytes or an array of sbytes with positive values.
@@ -208,8 +213,8 @@ string ConstantArray::getStrValue() const {
return Result;
}
-string ConstantStruct::getStrValue() const {
- string Result = "{";
+std::string ConstantStruct::getStrValue() const {
+ std::string Result = "{";
if (Operands.size()) {
Result += " " + Operands[0]->getType()->getDescription() +
" " + cast<Constant>(Operands[0])->getStrValue();
@@ -221,11 +226,11 @@ string ConstantStruct::getStrValue() const {
return Result + " }";
}
-string ConstantPointerNull::getStrValue() const {
+std::string ConstantPointerNull::getStrValue() const {
return "null";
}
-string ConstantPointerRef::getStrValue() const {
+std::string ConstantPointerRef::getStrValue() const {
const GlobalValue *V = getValue();
if (V->hasName()) return "%" + V->getName();
@@ -233,7 +238,7 @@ string ConstantPointerRef::getStrValue() const {
int Slot = Table->getValSlot(V);
delete Table;
- if (Slot >= 0) return string(" %") + itostr(Slot);
+ if (Slot >= 0) return std::string(" %") + itostr(Slot);
else return "<pointer reference badref>";
}
@@ -337,7 +342,7 @@ unsigned ConstantFP::hash(const Type *Ty, double V) {
}
unsigned ConstantArray::hash(const ArrayType *Ty,
- const vector<Constant*> &V) {
+ const std::vector<Constant*> &V) {
unsigned Result = (Ty->getUniqueID() << 5) ^ (Ty->getUniqueID() * 7);
for (unsigned i = 0; i < V.size(); ++i)
Result ^= V[i]->getHash() << (i & 7);
@@ -345,7 +350,7 @@ unsigned ConstantArray::hash(const ArrayType *Ty,
}
unsigned ConstantStruct::hash(const StructType *Ty,
- const vector<Constant*> &V) {
+ const std::vector<Constant*> &V) {
unsigned Result = (Ty->getUniqueID() << 5) ^ (Ty->getUniqueID() * 7);
for (unsigned i = 0; i < V.size(); ++i)
Result ^= V[i]->getHash() << (i & 7);
@@ -418,10 +423,10 @@ ConstantFP *ConstantFP::get(const Type *Ty, double V) {
//---- ConstantArray::get() implementation...
//
-static ValueMap<vector<Constant*>, ConstantArray> ArrayConstants;
+static ValueMap<std::vector<Constant*>, ConstantArray> ArrayConstants;
ConstantArray *ConstantArray::get(const ArrayType *Ty,
- const vector<Constant*> &V) {
+ const std::vector<Constant*> &V) {
ConstantArray *Result = ArrayConstants.get(Ty, V);
if (!Result) // If no preexisting value, create one now...
ArrayConstants.add(Ty, V, Result = new ConstantArray(Ty, V));
@@ -432,8 +437,8 @@ ConstantArray *ConstantArray::get(const ArrayType *Ty,
// contain the specified string. A null terminator is added to the specified
// string so that it may be used in a natural way...
//
-ConstantArray *ConstantArray::get(const string &Str) {
- vector<Constant*> ElementVals;
+ConstantArray *ConstantArray::get(const std::string &Str) {
+ std::vector<Constant*> ElementVals;
for (unsigned i = 0; i < Str.length(); ++i)
ElementVals.push_back(ConstantSInt::get(Type::SByteTy, Str[i]));
@@ -455,10 +460,10 @@ void ConstantArray::destroyConstant() {
//---- ConstantStruct::get() implementation...
//
-static ValueMap<vector<Constant*>, ConstantStruct> StructConstants;
+static ValueMap<std::vector<Constant*>, ConstantStruct> StructConstants;
ConstantStruct *ConstantStruct::get(const StructType *Ty,
- const vector<Constant*> &V) {
+ const std::vector<Constant*> &V) {
ConstantStruct *Result = StructConstants.get(Ty, V);
if (!Result) // If no preexisting value, create one now...
StructConstants.add(Ty, V, Result = new ConstantStruct(Ty, V));
diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp
index 2ed02dbed26..2e4f6e4df1f 100644
--- a/llvm/lib/VMCore/Dominators.cpp
+++ b/llvm/lib/VMCore/Dominators.cpp
@@ -10,6 +10,8 @@
#include "Support/DepthFirstIterator.h"
#include "Support/STLExtras.h"
#include <algorithm>
+using std::set;
+
//===----------------------------------------------------------------------===//
// Helper Template
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 4b38ce11965..e7d10c1496f 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/lib/VMCore/Function.cpp
@@ -25,7 +25,7 @@
template class ValueHolder<MethodArgument, Method, Method>;
template class ValueHolder<BasicBlock , Method, Method>;
-Method::Method(const MethodType *Ty, bool isInternal, const string &name)
+Method::Method(const MethodType *Ty, bool isInternal, const std::string &name)
: GlobalValue(PointerType::get(Ty), Value::MethodVal, isInternal, name),
SymTabValue(this), BasicBlocks(this), ArgumentList(this, this) {
assert(::isa<MethodType>(Ty) && "Method signature must be of method type!");
@@ -45,7 +45,7 @@ Method::~Method() {
}
// Specialize setName to take care of symbol table majik
-void Method::setName(const string &name, SymbolTable *ST) {
+void Method::setName(const std::string &name, SymbolTable *ST) {
Module *P;
assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) &&
"Invalid symtab argument!");
@@ -87,14 +87,14 @@ void Method::dropAllReferences() {
GlobalVariable::GlobalVariable(const Type *Ty, bool constant, bool isIntern,
Constant *Initializer = 0,
- const string &Name = "")
+ const std::string &Name = "")
: GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal, isIntern, Name),
isConstantGlobal(constant) {
if (Initializer) Operands.push_back(Use((Value*)Initializer, this));
}
// Specialize setName to take care of symbol table majik
-void GlobalVariable::setName(const string &name, SymbolTable *ST) {
+void GlobalVariable::setName(const std::string &name, SymbolTable *ST) {
Module *P;
assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) &&
"Invalid symtab argument!");
diff --git a/llvm/lib/VMCore/InstrTypes.cpp b/llvm/lib/VMCore/InstrTypes.cpp
index 69a703c0c74..a4c82126323 100644
--- a/llvm/lib/VMCore/InstrTypes.cpp
+++ b/llvm/lib/VMCore/InstrTypes.cpp
@@ -21,7 +21,7 @@ TerminatorInst::TerminatorInst(Instruction::TermOps iType)
}
TerminatorInst::TerminatorInst(const Type *Ty, Instruction::TermOps iType,
- const string &Name = "")
+ const std::string &Name = "")
: Instruction(Ty, iType, Name) {
}
@@ -31,7 +31,7 @@ TerminatorInst::TerminatorInst(const Type *Ty, Instruction::TermOps iType,
//===----------------------------------------------------------------------===//
// Specialize setName to take care of symbol table majik
-void MethodArgument::setName(const string &name, SymbolTable *ST) {
+void MethodArgument::setName(const std::string &name, SymbolTable *ST) {
Method *P;
assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) &&
"Invalid symtab argument!");
@@ -45,7 +45,7 @@ void MethodArgument::setName(const string &name, SymbolTable *ST) {
// PHINode Class
//===----------------------------------------------------------------------===//
-PHINode::PHINode(const Type *Ty, const string &name)
+PHINode::PHINode(const Type *Ty, const std::string &name)
: Instruction(Ty, Instruction::PHINode, name) {
}
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp
index 8b37510d354..186c85007ed 100644
--- a/llvm/lib/VMCore/Instruction.cpp
+++ b/llvm/lib/VMCore/Instruction.cpp
@@ -10,7 +10,7 @@
#include "llvm/SymbolTable.h"
#include "llvm/CodeGen/MachineInstr.h"
-Instruction::Instruction(const Type *ty, unsigned it, const string &Name)
+Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name)
: User(ty, Value::InstructionVal, Name),
machineInstrVec(new MachineCodeForVMInstr) {
Parent = 0;
@@ -23,7 +23,7 @@ Instruction::~Instruction() {
}
// Specialize setName to take care of symbol table majik
-void Instruction::setName(const string &name, SymbolTable *ST) {
+void Instruction::setName(const std::string &name, SymbolTable *ST) {
BasicBlock *P = 0; Method *PP = 0;
assert((ST == 0 || !getParent() || !getParent()->getParent() ||
ST == getParent()->getParent()->getSymbolTable()) &&
@@ -44,7 +44,7 @@ void Instruction::addMachineInstruction(MachineInstr* minstr) {
// sequence of forward declarations. Trying to fix that will
// cause a serious circularity in link order.
//
-const vector<Value*> &Instruction::getTempValuesForMachineCode() const {
+const std::vector<Value*> &Instruction::getTempValuesForMachineCode() const {
return machineInstrVec->getTempValues();
}
#endif
diff --git a/llvm/lib/VMCore/Module.cpp b/llvm/lib/VMCore/Module.cpp
index a42535580bf..606d3aef142 100644
--- a/llvm/lib/VMCore/Module.cpp
+++ b/llvm/lib/VMCore/Module.cpp
@@ -24,7 +24,7 @@ template class ValueHolder<Method, Module, Module>;
// Define the GlobalValueRefMap as a struct that wraps a map so that we don't
// have Module.h depend on <map>
//
-struct GlobalValueRefMap : public map<GlobalValue*, ConstantPointerRef*>{
+struct GlobalValueRefMap : public std::map<GlobalValue*, ConstantPointerRef*>{
};
@@ -97,7 +97,7 @@ ConstantPointerRef *Module::getConstantPointerRef(GlobalValue *V){
if (I != GVRefMap->end()) return I->second;
ConstantPointerRef *Ref = new ConstantPointerRef(V);
- GVRefMap->insert(make_pair(V, Ref));
+ GVRefMap->insert(std::make_pair(V, Ref));
return Ref;
}
@@ -112,5 +112,5 @@ void Module::mutateConstantPointerRef(GlobalValue *OldGV, GlobalValue *NewGV) {
GVRefMap->erase(I);
// Insert the new entry...
- GVRefMap->insert(make_pair(NewGV, Ref));
+ GVRefMap->insert(std::make_pair(NewGV, Ref));
}
diff --git a/llvm/lib/VMCore/SlotCalculator.cpp b/llvm/lib/VMCore/SlotCalculator.cpp
index ede822846d3..4738f712a16 100644
--- a/llvm/lib/VMCore/SlotCalculator.cpp
+++ b/llvm/lib/VMCore/SlotCalculator.cpp
@@ -196,7 +196,8 @@ void SlotCalculator::purgeMethod() {
while (CurPlane.size() != ModuleSize) {
//SC_DEBUG(" Removing [" << i << "] Value=" << CurPlane.back() << "\n");
- map<const Value *, unsigned>::iterator NI = NodeMap.find(CurPlane.back());
+ std::map<const Value *, unsigned>::iterator NI =
+ NodeMap.find(CurPlane.back());
assert(NI != NodeMap.end() && "Node not in nodemap?");
NodeMap.erase(NI); // Erase from nodemap
CurPlane.pop_back(); // Shrink plane
@@ -223,7 +224,7 @@ void SlotCalculator::purgeMethod() {
}
int SlotCalculator::getValSlot(const Value *D) const {
- map<const Value*, unsigned>::const_iterator I = NodeMap.find(D);
+ std::map<const Value*, unsigned>::const_iterator I = NodeMap.find(D);
if (I == NodeMap.end()) return -1;
return (int)I->second;
diff --git a/llvm/lib/VMCore/SymbolTable.cpp b/llvm/lib/VMCore/SymbolTable.cpp
index dd6329fc97f..ab98a731841 100644
--- a/llvm/lib/VMCore/SymbolTable.cpp
+++ b/llvm/lib/VMCore/SymbolTable.cpp
@@ -10,6 +10,14 @@
#include "llvm/Module.h"
#include "llvm/Method.h"
#include "Support/StringExtras.h"
+#include <iostream>
+
+using std::string;
+using std::pair;
+using std::make_pair;
+using std::map;
+using std::cerr;
+using std::cout;
#define DEBUG_SYMBOL_TABLE 0
#define DEBUG_ABSTYPE 0
@@ -35,7 +43,8 @@ SymbolTable::~SymbolTable() {
for (type_iterator I = i->second.begin(); I != i->second.end(); ++I)
if (!isa<Constant>(I->second) && !isa<Type>(I->second)) {
cerr << "Value still in symbol table! Type = '"
- << i->first->getDescription() << "' Name = '" << I->first << "'\n";
+ << i->first->getDescription() << "' Name = '"
+ << I->first << "'\n";
LeftoverValues = false;
}
}
@@ -305,11 +314,11 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
#include <algorithm>
static void DumpVal(const pair<const string, Value *> &V) {
- cout << " '" << V.first << "' = " << V.second << endl;
+ cout << " '" << V.first << "' = " << V.second << "\n";
}
static void DumpPlane(const pair<const Type *, map<const string, Value *> >&P) {
- cout << " Plane: " << P.first << endl;
+ cout << " Plane: " << P.first << "\n";
for_each(P.second.begin(), P.second.end(), DumpVal);
}
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index cbcdf3f37d0..316f97d4392 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/lib/VMCore/Type.cpp
@@ -8,6 +8,14 @@
#include "llvm/SymbolTable.h"
#include "Support/StringExtras.h"
#include "Support/STLExtras.h"
+#include <iostream>
+
+using std::vector;
+using std::string;
+using std::map;
+using std::swap;
+using std::make_pair;
+using std::cerr;
// DEBUG_MERGE_TYPES - Enable this #define to see how and when derived types are
// created and later destroyed, all in an effort to make sure that there is only
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp
index 0ac72051043..af9d2e4f628 100644
--- a/llvm/lib/VMCore/Value.cpp
+++ b/llvm/lib/VMCore/Value.cpp
@@ -11,6 +11,8 @@
#include "llvm/Type.h"
#ifndef NDEBUG // Only in -g mode...
#include "llvm/Assembly/Writer.h"
+#include <iostream>
+using std::cerr;
#endif
#include <algorithm>
@@ -23,7 +25,7 @@ static inline const Type *checkType(const Type *Ty) {
return Ty;
}
-Value::Value(const Type *ty, ValueTy vty, const string &name = "")
+Value::Value(const Type *ty, ValueTy vty, const std::string &name = "")
: Name(name), Ty(checkType(ty), this) {
VTy = vty;
}
@@ -39,7 +41,7 @@ Value::~Value() {
if (Uses.begin() != Uses.end()) {
cerr << "While deleting: " << this;
for (use_const_iterator I = Uses.begin(); I != Uses.end(); ++I)
- cerr << "Use still stuck around after Def is destroyed:" << *I << endl;
+ cerr << "Use still stuck around after Def is destroyed:" << *I << "\n";
}
#endif
assert(Uses.begin() == Uses.end());
@@ -98,7 +100,7 @@ void Value::dump() const {
// User Class
//===----------------------------------------------------------------------===//
-User::User(const Type *Ty, ValueTy vty, const string &name)
+User::User(const Type *Ty, ValueTy vty, const std::string &name)
: Value(Ty, vty, name) {
}
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index 55424fc4784..0702e85f0e0 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/lib/VMCore/Verifier.cpp
@@ -34,6 +34,9 @@
#include "llvm/Module.h"
#include "llvm/BasicBlock.h"
#include "llvm/Type.h"
+using std::string;
+using std::vector;
+
// Error - Define a macro to do the common task of pushing a message onto the
// end of the error list and setting Bad to true.
diff --git a/llvm/lib/VMCore/iBranch.cpp b/llvm/lib/VMCore/iBranch.cpp
index d0f437e293b..f020ab62137 100644
--- a/llvm/lib/VMCore/iBranch.cpp
+++ b/llvm/lib/VMCore/iBranch.cpp
@@ -10,6 +10,7 @@
#ifndef NDEBUG
#include "llvm/Type.h" // Only used for assertions...
#include "llvm/Assembly/Writer.h"
+#include <iostream>
#endif
BranchInst::BranchInst(BasicBlock *True, BasicBlock *False, Value *Cond)
@@ -27,7 +28,7 @@ BranchInst::BranchInst(BasicBlock *True, BasicBlock *False, Value *Cond)
#ifndef NDEBUG
if (Cond != 0 && Cond->getType() != Type::BoolTy)
- cerr << "Bad Condition: " << Cond << endl;
+ std::cerr << "Bad Condition: " << Cond << "\n";
#endif
assert((Cond == 0 || Cond->getType() == Type::BoolTy) &&
"May only branch on boolean predicates!!!!");
diff --git a/llvm/lib/VMCore/iCall.cpp b/llvm/lib/VMCore/iCall.cpp
index 7f4efaf7b2c..37eb24e86cb 100644
--- a/llvm/lib/VMCore/iCall.cpp
+++ b/llvm/lib/VMCore/iCall.cpp
@@ -13,8 +13,8 @@
// CallInst Implementation
//===----------------------------------------------------------------------===//
-CallInst::CallInst(Value *Meth, const vector<Value*> &params,
- const string &Name)
+CallInst::CallInst(Value *Meth, const std::vector<Value*> &params,
+ const std::string &Name)
: Instruction(cast<MethodType>(cast<PointerType>(Meth->getType())
->getElementType())->getReturnType(),
Instruction::Call, Name) {
@@ -44,8 +44,9 @@ CallInst::CallInst(const CallInst &CI)
//===----------------------------------------------------------------------===//
InvokeInst::InvokeInst(Value *Meth, BasicBlock *IfNormal, \
- BasicBlock *IfException, const vector<Value*>&params,
- const string &Name)
+ BasicBlock *IfException,
+ const std::vector<Value*> &params,
+ const std::string &Name)
: TerminatorInst(cast<MethodType>(cast<PointerType>(Meth->getType())
->getElementType())->getReturnType(),
Instruction::Invoke, Name) {
diff --git a/llvm/lib/VMCore/iMemory.cpp b/llvm/lib/VMCore/iMemory.cpp
index c845fd99362..4226a696157 100644
--- a/llvm/lib/VMCore/iMemory.cpp
+++ b/llvm/lib/VMCore/iMemory.cpp
@@ -22,7 +22,7 @@ static inline const Type *checkType(const Type *Ty) {
// pointer type.
//
const Type* MemAccessInst::getIndexedType(const Type *Ptr,
- const vector<Value*> &Idx,
+ const std::vector<Value*> &Idx,
bool AllowCompositeLeaf = false) {
if (!Ptr->isPointerType()) return 0; // Type isn't a pointer type!
@@ -48,8 +48,8 @@ const Type* MemAccessInst::getIndexedType(const Type *Ptr,
// LoadInst Implementation
//===----------------------------------------------------------------------===//
-LoadInst::LoadInst(Value *Ptr, const vector<Value*> &Idx,
- const string &Name = "")
+LoadInst::LoadInst(Value *Ptr, const std::vector<Value*> &Idx,
+ const std::string &Name = "")
: MemAccessInst(checkType(getIndexedType(Ptr->getType(), Idx)), Load, Name) {
assert(getIndexedType(Ptr->getType(), Idx) && "Load operands invalid!");
Operands.reserve(1+Idx.size());
@@ -60,7 +60,7 @@ LoadInst::LoadInst(Value *Ptr, const vector<Value*> &Idx,
}
-LoadInst::LoadInst(Value *Ptr, const string &Name = "")
+LoadInst::LoadInst(Value *Ptr, const std::string &Name = "")
: MemAccessInst(cast<PointerType>(Ptr->getType())->getElementType(),
Load, Name) {
Operands.reserve(1);
@@ -72,8 +72,8 @@ LoadInst::LoadInst(Value *Ptr, const string &Name = "")
// StoreInst Implementation
//===----------------------------------------------------------------------===//
-StoreInst::StoreInst(Value *Val, Value *Ptr, const vector<Value*> &Idx,
- const string &Name = "")
+StoreInst::StoreInst(Value *Val, Value *Ptr, const std::vector<Value*> &Idx,
+ const std::string &Name = "")
: MemAccessInst(Type::VoidTy, Store, Name) {
assert(getIndexedType(Ptr->getType(), Idx) && "Store operands invalid!");
@@ -85,7 +85,7 @@ StoreInst::StoreInst(Value *Val, Value *Ptr, const vector<Value*> &Idx,
Operands.push_back(Use(Idx[i], this));
}
-StoreInst::StoreInst(Value *Val, Value *Ptr, const string &Name = "")
+StoreInst::StoreInst(Value *Val, Value *Ptr, const std::string &Name = "")
: MemAccessInst(Type::VoidTy, Store, Name) {
Operands.reserve(2);
@@ -98,8 +98,8 @@ StoreInst::StoreInst(Value *Val, Value *Ptr, const string &Name = "")
// GetElementPtrInst Implementation
//===----------------------------------------------------------------------===//
-GetElementPtrInst::GetElementPtrInst(Value *Ptr, const vector<Value*> &Idx,
- const string &Name = "")
+GetElementPtrInst::GetElementPtrInst(Value *Ptr, const std::vector<Value*> &Idx,
+ const std::string &Name = "")
: MemAccessInst(PointerType::get(checkType(getIndexedType(Ptr->getType(),
Idx, true))),
GetElementPtr, Name) {
diff --git a/llvm/lib/VMCore/iOperators.cpp b/llvm/lib/VMCore/iOperators.cpp
index cb53d5e0344..c2fe1bc04a1 100644
--- a/llvm/lib/VMCore/iOperators.cpp
+++ b/llvm/lib/VMCore/iOperators.cpp
@@ -6,6 +6,8 @@
#include "llvm/iOperators.h"
#include "llvm/Type.h"
+#include <iostream>
+using std::cerr;
//===----------------------------------------------------------------------===//
// UnaryOperator Class
@@ -15,7 +17,7 @@ UnaryOperator *UnaryOperator::create(UnaryOps Op, Value *Source) {
switch (Op) {
case Not: return new GenericUnaryInst(Op, Source);
default:
- cerr << "Don't know how to Create UnaryOperator " << Op << endl;
+ cerr << "Don't know how to Create UnaryOperator " << Op << "\n";
return 0;
}
}
@@ -30,9 +32,10 @@ const char *GenericUnaryInst::getOpcodeName() const {
case Not: return "not";
case Cast: return "cast";
default:
- cerr << "Invalid unary operator type!" << getOpcode() << endl;
+ cerr << "Invalid unary operator type!" << getOpcode() << "\n";
abort();
}
+ return 0;
}
@@ -41,7 +44,7 @@ const char *GenericUnaryInst::getOpcodeName() const {
//===----------------------------------------------------------------------===//
BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
- const string &Name) {
+ const std::string &Name) {
switch (Op) {
// Binary comparison operators...
case SetLT: case SetGT: case SetLE:
@@ -75,7 +78,7 @@ bool BinaryOperator::swapOperands() {
default:
return true;
}
- swap(Operands[0], Operands[1]);
+ std::swap(Operands[0], Operands[1]);
return false;
}
@@ -98,9 +101,10 @@ const char *GenericBinaryInst::getOpcodeName() const {
case Or : return "or";
case Xor: return "xor";
default:
- cerr << "Invalid binary operator type!" << getOpcode() << endl;
+ cerr << "Invalid binary operator type!" << getOpcode() << "\n";
abort();
}
+ return 0;
}
@@ -109,7 +113,7 @@ const char *GenericBinaryInst::getOpcodeName() const {
//===----------------------------------------------------------------------===//
SetCondInst::SetCondInst(BinaryOps opType, Value *S1, Value *S2,
- const string &Name)
+ const std::string &Name)
: BinaryOperator(opType, S1, S2, Name) {
OpType = opType;
OpenPOWER on IntegriCloud