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:
Michael J. Spencer 2010-12-09 18:06:07 +00:00
parent 014e189069
commit f2f516fc26
2 changed files with 14 additions and 5 deletions

View File

@ -43,6 +43,7 @@
#include "llvm/Support/Host.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/system_error.h"
#include "llvm/Config/config.h"
#include <cstdlib>
#include <unistd.h>
@ -221,9 +222,12 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg)
if ( !asmResult ) {
// remove old buffer if compile() called twice
delete _nativeObjectFile;
// 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

View File

@ -26,6 +26,7 @@
#include "llvm/Support/Host.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/system_error.h"
#include "llvm/Target/Mangler.h"
#include "llvm/Target/SubtargetFeature.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,
const char *triplePrefix) {
MemoryBuffer *buffer = MemoryBuffer::getFile(path);
error_code ec;
MemoryBuffer *buffer = MemoryBuffer::getFile(path, ec);
if (buffer == NULL)
return false;
return isTargetMatch(buffer, triplePrefix);
@ -78,9 +80,12 @@ LTOModule::LTOModule(Module *m, TargetMachine *t)
LTOModule *LTOModule::makeLTOModule(const char *path,
std::string &errMsg) {
OwningPtr<MemoryBuffer> buffer(MemoryBuffer::getFile(path, &errMsg));
if (!buffer)
error_code ec;
OwningPtr<MemoryBuffer> buffer(MemoryBuffer::getFile(path, ec));
if (!buffer) {
errMsg = ec.message();
return NULL;
}
return makeLTOModule(buffer.get(), errMsg);
}