aboutsummaryrefslogtreecommitdiffstats
path: root/support/lib/Support
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 /support/lib/Support
parent13c4659220bc78a0a3529f4d9e57546e898088e3 (diff)
downloadexternal_llvm-697954c15da58bd8b186dbafdedd8b06db770201.zip
external_llvm-697954c15da58bd8b186dbafdedd8b06db770201.tar.gz
external_llvm-697954c15da58bd8b186dbafdedd8b06db770201.tar.bz2
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 'support/lib/Support')
-rw-r--r--support/lib/Support/Annotation.cpp4
-rw-r--r--support/lib/Support/CommandLine.cpp40
-rw-r--r--support/lib/Support/NameMangling.cpp1
3 files changed, 28 insertions, 17 deletions
diff --git a/support/lib/Support/Annotation.cpp b/support/lib/Support/Annotation.cpp
index 65a049d..d0d13cd 100644
--- a/support/lib/Support/Annotation.cpp
+++ b/support/lib/Support/Annotation.cpp
@@ -6,6 +6,10 @@
#include <map>
#include "llvm/Annotation.h"
+using std::string;
+using std::map;
+using std::pair;
+using std::make_pair;
typedef map<const string, unsigned> IDMapType;
static unsigned IDCounter = 0; // Unique ID counter
diff --git a/support/lib/Support/CommandLine.cpp b/support/lib/Support/CommandLine.cpp
index f693816..549f42c 100644
--- a/support/lib/Support/CommandLine.cpp
+++ b/support/lib/Support/CommandLine.cpp
@@ -15,7 +15,13 @@
#include <algorithm>
#include <map>
#include <set>
+#include <iostream>
using namespace cl;
+using std::map;
+using std::pair;
+using std::vector;
+using std::string;
+using std::cerr;
// Return the global command line option vector. Making it a function scoped
// static ensures that it will be initialized correctly before its first use.
@@ -31,7 +37,7 @@ static void AddArgument(const string &ArgName, Option *Opt) {
<< "' specified more than once!\n";
} else {
// Add argument to the argument map!
- getOpts().insert(make_pair(ArgName, Opt));
+ getOpts().insert(std::make_pair(ArgName, Opt));
}
}
@@ -59,7 +65,7 @@ static inline bool ProvideOption(Option *Handler, const char *ArgName,
break;
case ValueOptional: break;
default: cerr << "Bad ValueMask flag! CommandLine usage error:"
- << Handler->getValueExpectedFlag() << endl; abort();
+ << Handler->getValueExpectedFlag() << "\n"; abort();
}
// Run the handler now!
@@ -210,7 +216,7 @@ Option::Option(const char *argStr, const char *helpStr, int flags)
bool Option::error(string Message, const char *ArgName = 0) {
if (ArgName == 0) ArgName = ArgStr;
- cerr << "-" << ArgName << " option" << Message << endl;
+ cerr << "-" << ArgName << " option" << Message << "\n";
return true;
}
@@ -244,7 +250,7 @@ void Option::printOptionInfo(unsigned GlobalWidth) const {
unsigned L = std::strlen(ArgStr);
if (L == 0) return; // Don't print the empty arg like this!
cerr << " -" << ArgStr << string(GlobalWidth-L-6, ' ') << " - "
- << HelpStr << endl;
+ << HelpStr << "\n";
}
@@ -301,8 +307,8 @@ void EnumBase::processValues(va_list Vals) {
while (const char *EnumName = va_arg(Vals, const char *)) {
int EnumVal = va_arg(Vals, int);
const char *EnumDesc = va_arg(Vals, const char *);
- ValueMap.push_back(make_pair(EnumName, // Add value to value map
- make_pair(EnumVal, EnumDesc)));
+ ValueMap.push_back(std::make_pair(EnumName, // Add value to value map
+ std::make_pair(EnumVal, EnumDesc)));
}
}
@@ -339,7 +345,7 @@ bool EnumValueBase::handleOccurance(const char *ArgName, const string &Arg) {
unsigned EnumValueBase::getOptionWidth() const {
unsigned BaseSize = Option::getOptionWidth();
for (unsigned i = 0; i < ValueMap.size(); ++i)
- BaseSize = max(BaseSize, std::strlen(ValueMap[i].first)+8);
+ BaseSize = std::max(BaseSize, std::strlen(ValueMap[i].first)+8);
return BaseSize;
}
@@ -354,7 +360,7 @@ void EnumValueBase::printOptionInfo(unsigned GlobalWidth) const {
<< ValueMap[i].second.second;
if (i == 0) cerr << " (default)";
- cerr << endl;
+ cerr << "\n";
}
}
@@ -369,7 +375,7 @@ bool EnumFlagsBase::handleOccurance(const char *ArgName, const string &Arg) {
unsigned EnumFlagsBase::getOptionWidth() const {
unsigned BaseSize = 0;
for (unsigned i = 0; i < ValueMap.size(); ++i)
- BaseSize = max(BaseSize, std::strlen(ValueMap[i].first)+6);
+ BaseSize = std::max(BaseSize, std::strlen(ValueMap[i].first)+6);
return BaseSize;
}
@@ -379,7 +385,7 @@ void EnumFlagsBase::printOptionInfo(unsigned GlobalWidth) const {
cerr << " -" << ValueMap[i].first << string(GlobalWidth-L-6, ' ') << " - "
<< ValueMap[i].second.second;
if (i == 0) cerr << " (default)";
- cerr << endl;
+ cerr << "\n";
}
}
@@ -402,7 +408,7 @@ bool EnumListBase::handleOccurance(const char *ArgName, const string &Arg) {
unsigned EnumListBase::getOptionWidth() const {
unsigned BaseSize = 0;
for (unsigned i = 0; i < ValueMap.size(); ++i)
- BaseSize = max(BaseSize, std::strlen(ValueMap[i].first)+6);
+ BaseSize = std::max(BaseSize, std::strlen(ValueMap[i].first)+6);
return BaseSize;
}
@@ -414,7 +420,7 @@ void EnumListBase::printOptionInfo(unsigned GlobalWidth) const {
for (unsigned i = 0; i < ValueMap.size(); ++i) {
unsigned L = std::strlen(ValueMap[i].first);
cerr << " -" << ValueMap[i].first << string(GlobalWidth-L-6, ' ') << " - "
- << ValueMap[i].second.second << endl;
+ << ValueMap[i].second.second << "\n";
}
}
@@ -440,15 +446,15 @@ class Help : public Option {
virtual bool handleOccurance(const char *ArgName, const string &Arg) {
// Copy Options into a vector so we can sort them as we like...
vector<pair<string, Option*> > Options;
- copy(getOpts().begin(), getOpts().end(), back_inserter(Options));
+ copy(getOpts().begin(), getOpts().end(), std::back_inserter(Options));
// Eliminate Hidden or ReallyHidden arguments, depending on ShowHidden
Options.erase(remove_if(Options.begin(), Options.end(),
- ptr_fun(ShowHidden ? isReallyHidden : isHidden)),
+ std::ptr_fun(ShowHidden ? isReallyHidden : isHidden)),
Options.end());
// Eliminate duplicate entries in table (from enum flags options, f.e.)
- set<Option*> OptionSet;
+ std::set<Option*> OptionSet;
for (unsigned i = 0; i < Options.size(); )
if (OptionSet.count(Options[i].second) == 0)
OptionSet.insert(Options[i++].second); // Add to set
@@ -457,7 +463,7 @@ class Help : public Option {
if (ProgramOverview)
- cerr << "OVERVIEW:" << ProgramOverview << endl;
+ cerr << "OVERVIEW:" << ProgramOverview << "\n";
// TODO: Sort options by some criteria
cerr << "USAGE: " << ProgramName << " [options]\n\n";
@@ -478,7 +484,7 @@ class Help : public Option {
void getMaxArgLen(pair<string, Option *> OptPair) {
const Option *Opt = OptPair.second;
if (Opt->ArgStr[0] == 0) EmptyArg = Opt; // Capture the empty arg if exists
- MaxArgLen = max(MaxArgLen, Opt->getOptionWidth());
+ MaxArgLen = std::max(MaxArgLen, Opt->getOptionWidth());
}
void printOption(pair<string, Option *> OptPair) {
diff --git a/support/lib/Support/NameMangling.cpp b/support/lib/Support/NameMangling.cpp
index bed520a..2fbcb88 100644
--- a/support/lib/Support/NameMangling.cpp
+++ b/support/lib/Support/NameMangling.cpp
@@ -7,6 +7,7 @@
#include "llvm/Support/NameMangling.h"
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalValue.h"
+using std::string;
// MangleTypeName - Implement a consistent name-mangling scheme for
// a given type.