mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
More code not compiled by CMake. :(.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121387 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
#include "llvm/Support/Host.h"
|
#include "llvm/Support/Host.h"
|
||||||
#include "llvm/Support/Program.h"
|
#include "llvm/Support/Program.h"
|
||||||
#include "llvm/Support/Signals.h"
|
#include "llvm/Support/Signals.h"
|
||||||
|
#include "llvm/Support/system_error.h"
|
||||||
#include "llvm/Config/config.h"
|
#include "llvm/Config/config.h"
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -221,9 +222,12 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg)
|
|||||||
if ( !asmResult ) {
|
if ( !asmResult ) {
|
||||||
// remove old buffer if compile() called twice
|
// remove old buffer if compile() called twice
|
||||||
delete _nativeObjectFile;
|
delete _nativeObjectFile;
|
||||||
|
|
||||||
// read .o file into memory buffer
|
// read .o file into memory buffer
|
||||||
_nativeObjectFile = MemoryBuffer::getFile(uniqueObjStr.c_str(),&errMsg);
|
error_code ec;
|
||||||
|
_nativeObjectFile = MemoryBuffer::getFile(uniqueObjStr.c_str(), ec);
|
||||||
|
if (ec)
|
||||||
|
errMsg = ec.message();
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove temp files
|
// remove temp files
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "llvm/Support/Host.h"
|
#include "llvm/Support/Host.h"
|
||||||
#include "llvm/Support/Path.h"
|
#include "llvm/Support/Path.h"
|
||||||
#include "llvm/Support/Process.h"
|
#include "llvm/Support/Process.h"
|
||||||
|
#include "llvm/Support/system_error.h"
|
||||||
#include "llvm/Target/Mangler.h"
|
#include "llvm/Target/Mangler.h"
|
||||||
#include "llvm/Target/SubtargetFeature.h"
|
#include "llvm/Target/SubtargetFeature.h"
|
||||||
#include "llvm/MC/MCAsmInfo.h"
|
#include "llvm/MC/MCAsmInfo.h"
|
||||||
@@ -56,7 +57,8 @@ bool LTOModule::isBitcodeFileForTarget(const void *mem, size_t length,
|
|||||||
|
|
||||||
bool LTOModule::isBitcodeFileForTarget(const char *path,
|
bool LTOModule::isBitcodeFileForTarget(const char *path,
|
||||||
const char *triplePrefix) {
|
const char *triplePrefix) {
|
||||||
MemoryBuffer *buffer = MemoryBuffer::getFile(path);
|
error_code ec;
|
||||||
|
MemoryBuffer *buffer = MemoryBuffer::getFile(path, ec);
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
return false;
|
return false;
|
||||||
return isTargetMatch(buffer, triplePrefix);
|
return isTargetMatch(buffer, triplePrefix);
|
||||||
@@ -78,9 +80,12 @@ LTOModule::LTOModule(Module *m, TargetMachine *t)
|
|||||||
|
|
||||||
LTOModule *LTOModule::makeLTOModule(const char *path,
|
LTOModule *LTOModule::makeLTOModule(const char *path,
|
||||||
std::string &errMsg) {
|
std::string &errMsg) {
|
||||||
OwningPtr<MemoryBuffer> buffer(MemoryBuffer::getFile(path, &errMsg));
|
error_code ec;
|
||||||
if (!buffer)
|
OwningPtr<MemoryBuffer> buffer(MemoryBuffer::getFile(path, ec));
|
||||||
|
if (!buffer) {
|
||||||
|
errMsg = ec.message();
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
return makeLTOModule(buffer.get(), errMsg);
|
return makeLTOModule(buffer.get(), errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user