[llvm-commits] [llvm-gcc-4.2] r79867 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-internal.h
Chris Lattner
sabre at nondot.org
Sun Aug 23 15:16:26 PDT 2009
Author: lattner
Date: Sun Aug 23 17:16:25 2009
New Revision: 79867
URL: http://llvm.org/viewvc/llvm-project?rev=79867&view=rev
Log:
wean llvm-gcc off Streams.h, eliminating some redundant streams.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.2/trunk/gcc/llvm-internal.h
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=79867&r1=79866&r2=79867&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Sun Aug 23 17:16:25 2009
@@ -49,7 +49,6 @@
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/StandardPasses.h"
-#include "llvm/Support/Streams.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/System/Program.h"
@@ -93,8 +92,6 @@
TargetMachine *TheTarget = 0;
TargetFolder *TheFolder = 0;
TypeConverter *TheTypeConverter = 0;
-llvm::OStream *AsmOutFile = 0;
-llvm::OStream *AsmIntermediateOutFile = 0;
/// DisableLLVMOptimizations - Allow the user to specify:
/// "-mllvm -disable-llvm-optzns" on the llvm-gcc command line to force llvm
@@ -490,7 +487,7 @@
const Target *TME =
TargetRegistry::lookupTarget(TargetTriple, Err);
if (!TME) {
- cerr << "Did not get a target machine! Triplet is " << TargetTriple << '\n';
+ errs() << "Did not get a target machine! Triplet is " << TargetTriple<<'\n';
exit(1);
}
@@ -577,8 +574,8 @@
}
if (!TheModule) {
- cerr << "Error reading bytecodes from PCH file\n";
- cerr << ErrMsg << "\n";
+ errs() << "Error reading bytecodes from PCH file\n";
+ errs() << ErrMsg << "\n";
exit(1);
}
@@ -605,7 +602,6 @@
AsmOutRawStream =
new formatted_raw_ostream(*new raw_os_ostream(*AsmOutStream),
formatted_raw_ostream::DELETE_STREAM);
- AsmOutFile = new OStream(*AsmOutStream);
PerModulePasses = new PassManager();
PerModulePasses->add(new TargetData(*TheTarget->getTargetData()));
@@ -689,7 +685,7 @@
OptLevel)) {
default:
case FileModel::Error:
- cerr << "Error interfacing to target machine!\n";
+ errs() << "Error interfacing to target machine!\n";
exit(1);
case FileModel::AsmFile:
break;
@@ -697,7 +693,7 @@
if (TheTarget->addPassesToEmitFileFinish(*PM, (MachineCodeEmitter *)0,
OptLevel)) {
- cerr << "Error interfacing to target machine!\n";
+ errs() << "Error interfacing to target machine!\n";
exit(1);
}
}
@@ -784,7 +780,7 @@
OptLevel)) {
default:
case FileModel::Error:
- cerr << "Error interfacing to target machine!\n";
+ errs() << "Error interfacing to target machine!\n";
exit(1);
case FileModel::AsmFile:
break;
@@ -792,7 +788,7 @@
if (TheTarget->addPassesToEmitFileFinish(*PM, (MachineCodeEmitter *)0,
OptLevel)) {
- cerr << "Error interfacing to target machine!\n";
+ errs() << "Error interfacing to target machine!\n";
exit(1);
}
}
@@ -812,8 +808,6 @@
AsmOutRawStream =
new formatted_raw_ostream(*new raw_os_ostream(*AsmOutStream),
formatted_raw_ostream::DELETE_STREAM);
- AsmOutFile = new OStream(*AsmOutStream);
-
flag_llvm_pch_read = 0;
if (emit_llvm_bc || emit_llvm)
@@ -946,7 +940,6 @@
strcat(&asm_intermediate_out_filename[0],".0");
FILE *asm_intermediate_out_file = fopen(asm_intermediate_out_filename, "w+b");
AsmIntermediateOutStream = new oFILEstream(asm_intermediate_out_file);
- AsmIntermediateOutFile = new OStream(*AsmIntermediateOutStream);
raw_ostream *AsmIntermediateRawOutStream =
new raw_os_ostream(*AsmIntermediateOutStream);
if (emit_llvm_bc)
@@ -961,8 +954,6 @@
fflush(asm_intermediate_out_file);
delete AsmIntermediateOutStream;
AsmIntermediateOutStream = 0;
- delete AsmIntermediateOutFile;
- AsmIntermediateOutFile = 0;
}
// Run module-level optimizers, if any are present.
@@ -987,8 +978,6 @@
AsmOutRawStream = 0;
delete AsmOutStream;
AsmOutStream = 0;
- delete AsmOutFile;
- AsmOutFile = 0;
timevar_pop(TV_LLVM_PERFILE);
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=79867&r1=79866&r2=79867&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Sun Aug 23 17:16:25 2009
@@ -40,8 +40,8 @@
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/IRBuilder.h"
#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
#include "llvm/Support/TargetFolder.h"
+#include "llvm/Support/raw_ostream.h"
extern "C" {
#include "llvm.h"
@@ -91,10 +91,6 @@
/// getTargetData - Return the current TargetData object from TheTarget.
const TargetData &getTargetData();
-/// AsmOutFile - A C++ ostream wrapper around asm_out_file.
-///
-extern llvm::OStream *AsmOutFile;
-
/// AttributeUsedGlobals - The list of globals that are marked attribute(used).
extern SmallSetVector<Constant *,32> AttributeUsedGlobals;
More information about the llvm-commits
mailing list