Changes for 64bit gcc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2797 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anand Shukla
2002-06-25 21:43:28 +00:00
parent e6f74a9ce8
commit 63aaa11506
5 changed files with 33 additions and 17 deletions

View File

@ -16,6 +16,8 @@
#include "Support/Signals.h" #include "Support/Signals.h"
#include <fstream> #include <fstream>
#include <memory> #include <memory>
#include <iostream>
using std::cerr;
cl::String InputFilename ("", "Parse <arg> file, compile to bytecode", 0, "-"); cl::String InputFilename ("", "Parse <arg> file, compile to bytecode", 0, "-");
cl::String OutputFilename("o", "Override output filename", cl::NoFlags, ""); cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
@ -25,7 +27,7 @@ cl::Flag DumpAsm ("d", "Print assembly as parsed", cl::Hidden, false);
int main(int argc, char **argv) { int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n"); cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
ostream *Out = 0; std::ostream *Out = 0;
try { try {
// Parse the file now... // Parse the file now...
std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename)); std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename));
@ -47,7 +49,7 @@ int main(int argc, char **argv) {
} else { } else {
if (InputFilename == "-") { if (InputFilename == "-") {
OutputFilename = "-"; OutputFilename = "-";
Out = &cout; Out = &std::cout;
} else { } else {
std::string IFN = InputFilename; std::string IFN = InputFilename;
int Len = IFN.length(); int Len = IFN.length();
@ -80,11 +82,11 @@ int main(int argc, char **argv) {
WriteBytecodeToFile(M.get(), *Out); WriteBytecodeToFile(M.get(), *Out);
} catch (const ParseException &E) { } catch (const ParseException &E) {
cerr << E.getMessage() << endl; cerr << E.getMessage() << std::endl;
return 1; return 1;
} }
if (Out != &cout) delete Out; if (Out != &std::cout) delete Out;
return 0; return 0;
} }

View File

@ -16,6 +16,8 @@
#include "Support/Signals.h" #include "Support/Signals.h"
#include <fstream> #include <fstream>
#include <memory> #include <memory>
#include <iostream>
using std::cerr;
cl::String InputFilename ("", "Parse <arg> file, compile to bytecode", 0, "-"); cl::String InputFilename ("", "Parse <arg> file, compile to bytecode", 0, "-");
cl::String OutputFilename("o", "Override output filename", cl::NoFlags, ""); cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
@ -25,7 +27,7 @@ cl::Flag DumpAsm ("d", "Print assembly as parsed", cl::Hidden, false);
int main(int argc, char **argv) { int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n"); cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
ostream *Out = 0; std::ostream *Out = 0;
try { try {
// Parse the file now... // Parse the file now...
std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename)); std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename));
@ -47,7 +49,7 @@ int main(int argc, char **argv) {
} else { } else {
if (InputFilename == "-") { if (InputFilename == "-") {
OutputFilename = "-"; OutputFilename = "-";
Out = &cout; Out = &std::cout;
} else { } else {
std::string IFN = InputFilename; std::string IFN = InputFilename;
int Len = IFN.length(); int Len = IFN.length();
@ -80,11 +82,11 @@ int main(int argc, char **argv) {
WriteBytecodeToFile(M.get(), *Out); WriteBytecodeToFile(M.get(), *Out);
} catch (const ParseException &E) { } catch (const ParseException &E) {
cerr << E.getMessage() << endl; cerr << E.getMessage() << std::endl;
return 1; return 1;
} }
if (Out != &cout) delete Out; if (Out != &std::cout) delete Out;
return 0; return 0;
} }

View File

@ -16,6 +16,8 @@
#include "Support/Signals.h" #include "Support/Signals.h"
#include <fstream> #include <fstream>
#include <memory> #include <memory>
#include <iostream>
using std::cerr;
cl::String InputFilename ("", "Parse <arg> file, compile to bytecode", 0, "-"); cl::String InputFilename ("", "Parse <arg> file, compile to bytecode", 0, "-");
cl::String OutputFilename("o", "Override output filename", cl::NoFlags, ""); cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
@ -25,7 +27,7 @@ cl::Flag DumpAsm ("d", "Print assembly as parsed", cl::Hidden, false);
int main(int argc, char **argv) { int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n"); cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
ostream *Out = 0; std::ostream *Out = 0;
try { try {
// Parse the file now... // Parse the file now...
std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename)); std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename));
@ -47,7 +49,7 @@ int main(int argc, char **argv) {
} else { } else {
if (InputFilename == "-") { if (InputFilename == "-") {
OutputFilename = "-"; OutputFilename = "-";
Out = &cout; Out = &std::cout;
} else { } else {
std::string IFN = InputFilename; std::string IFN = InputFilename;
int Len = IFN.length(); int Len = IFN.length();
@ -80,11 +82,11 @@ int main(int argc, char **argv) {
WriteBytecodeToFile(M.get(), *Out); WriteBytecodeToFile(M.get(), *Out);
} catch (const ParseException &E) { } catch (const ParseException &E) {
cerr << E.getMessage() << endl; cerr << E.getMessage() << std::endl;
return 1; return 1;
} }
if (Out != &cout) delete Out; if (Out != &std::cout) delete Out;
return 0; return 0;
} }

View File

@ -1,7 +1,15 @@
LEVEL = ../.. LEVEL = ../..
TOOLNAME = opt TOOLNAME = opt
USEDLIBS = bcreader bcwriter instrument profpaths scalaropts \
#USEDLIBS = bcreader bcwriter profpaths \
# analysis transforms vmcore support
USEDLIBS = bcreader bcwriter instrument profpaths \
ipo ipa datastructure transforms target analysis transformutils vmcore support ipo ipa datastructure transforms target analysis transformutils vmcore support
#USEDLIBS = bcreader bcwriter instrument profpaths scalaropts \
# ipo ipa datastructure transforms target analysis transformutils vmcore support
include $(LEVEL)/Makefile.common include $(LEVEL)/Makefile.common

View File

@ -30,6 +30,9 @@
#include "Support/Signals.h" #include "Support/Signals.h"
#include <fstream> #include <fstream>
#include <memory> #include <memory>
#include <iostream>
using std::cerr;
// FIXME: This should be parameterizable eventually for different target // FIXME: This should be parameterizable eventually for different target
// types... // types...
@ -100,7 +103,6 @@ struct {
{ trace , createTraceValuesPassForBasicBlocks }, { trace , createTraceValuesPassForBasicBlocks },
{ tracem , createTraceValuesPassForFunction }, { tracem , createTraceValuesPassForFunction },
{ paths , createProfilePathsPass }, { paths , createProfilePathsPass },
{ print , createPrintFunctionPass }, { print , createPrintFunctionPass },
{ printm , createPrintModulePass }, { printm , createPrintModulePass },
{ verify , createVerifierPass }, { verify , createVerifierPass },