Fix build failure.

Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57355 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2008-10-10 17:57:50 +00:00
parent 7cdd9ee088
commit 7a76ed6774

View File

@ -24,6 +24,7 @@
#include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/Support/SystemUtils.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Config/config.h"
#include <fstream>
@ -189,7 +190,13 @@ bool LTOBugPoint::assembleBitcode(llvm::Module *M, const char *AsmFileName) {
CGPasses->add(new TargetData(*Target->getTargetData()));
MachineCodeEmitter* mce = NULL;
std::ofstream *Out = new std::ofstream(AsmFileName, std::ios::out);
std::string error;
raw_ostream *Out = new raw_fd_ostream(AsmFileName, error);
if (!error.empty()) {
std::cerr << error << '\n';
delete Out;
return false;
}
switch (Target->addPassesToEmitFile(*CGPasses, *Out,
TargetMachine::AssemblyFile, true)) {