mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-16 14:27:54 +00:00
Use raw_ostream throughout the AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55092 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "llvm/Support/SystemUtils.h"
|
||||
#include "llvm/Support/Mangler.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/System/Signals.h"
|
||||
#include "llvm/Analysis/Passes.h"
|
||||
#include "llvm/Analysis/LoopPass.h"
|
||||
@@ -162,9 +163,12 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg)
|
||||
sys::RemoveFileOnSignal(uniqueAsmPath);
|
||||
|
||||
// generate assembly code
|
||||
std::ofstream asmFile(uniqueAsmPath.c_str());
|
||||
bool genResult = this->generateAssemblyCode(asmFile, errMsg);
|
||||
asmFile.close();
|
||||
std::string error;
|
||||
bool genResult = false;
|
||||
{
|
||||
raw_fd_ostream asmFile(uniqueAsmPath.c_str(), error);
|
||||
genResult = this->generateAssemblyCode(asmFile, errMsg);
|
||||
}
|
||||
if ( genResult ) {
|
||||
if ( uniqueAsmPath.exists() )
|
||||
uniqueAsmPath.eraseFromDisk();
|
||||
@@ -309,7 +313,8 @@ void LTOCodeGenerator::applyScopeRestrictions()
|
||||
}
|
||||
|
||||
/// Optimize merged modules using various IPO passes
|
||||
bool LTOCodeGenerator::generateAssemblyCode(std::ostream& out, std::string& errMsg)
|
||||
bool LTOCodeGenerator::generateAssemblyCode(raw_ostream& out,
|
||||
std::string& errMsg)
|
||||
{
|
||||
if ( this->determineTarget(errMsg) )
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user