mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 22:24:28 +00:00
Reverting r222828 and r222810-r222812 as they broke the build on Windows.
http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/11753 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222833 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -13,6 +13,8 @@
|
||||
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/DebugInfo/DIContext.h"
|
||||
#include "llvm/ExecutionEngine/ObjectBuffer.h"
|
||||
#include "llvm/ExecutionEngine/ObjectImage.h"
|
||||
#include "llvm/ExecutionEngine/RuntimeDyld.h"
|
||||
#include "llvm/ExecutionEngine/RuntimeDyldChecker.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
@ -205,32 +207,23 @@ static int printLineInfoForInput() {
|
||||
if (std::error_code EC = InputBuffer.getError())
|
||||
return Error("unable to read input: '" + EC.message() + "'");
|
||||
|
||||
ErrorOr<std::unique_ptr<ObjectFile>> MaybeObj(
|
||||
ObjectFile::createObjectFile((*InputBuffer)->getMemBufferRef()));
|
||||
|
||||
if (std::error_code EC = MaybeObj.getError())
|
||||
return Error("unable to create object file: '" + EC.message() + "'");
|
||||
|
||||
ObjectFile &Obj = **MaybeObj;
|
||||
|
||||
std::unique_ptr<ObjectImage> LoadedObject;
|
||||
// Load the object file
|
||||
std::unique_ptr<RuntimeDyld::LoadedObjectInfo> LoadedObjInfo =
|
||||
Dyld.loadObject(Obj);
|
||||
|
||||
if (Dyld.hasError())
|
||||
LoadedObject = Dyld.loadObject(
|
||||
llvm::make_unique<ObjectBuffer>(std::move(*InputBuffer)));
|
||||
if (!LoadedObject) {
|
||||
return Error(Dyld.getErrorString());
|
||||
}
|
||||
|
||||
// Resolve all the relocations we can.
|
||||
Dyld.resolveRelocations();
|
||||
|
||||
OwningBinary<ObjectFile> DebugObj = LoadedObjInfo->getObjectForDebug(Obj);
|
||||
|
||||
std::unique_ptr<DIContext> Context(
|
||||
DIContext::getDWARFContext(*DebugObj.getBinary()));
|
||||
DIContext::getDWARFContext(*LoadedObject->getObjectFile()));
|
||||
|
||||
// Use symbol info to iterate functions in the object.
|
||||
for (object::symbol_iterator I = DebugObj.getBinary()->symbol_begin(),
|
||||
E = DebugObj.getBinary()->symbol_end();
|
||||
for (object::symbol_iterator I = LoadedObject->begin_symbols(),
|
||||
E = LoadedObject->end_symbols();
|
||||
I != E; ++I) {
|
||||
object::SymbolRef::Type SymType;
|
||||
if (I->getType(SymType)) continue;
|
||||
@ -275,17 +268,11 @@ static int executeInput() {
|
||||
MemoryBuffer::getFileOrSTDIN(InputFileList[i]);
|
||||
if (std::error_code EC = InputBuffer.getError())
|
||||
return Error("unable to read input: '" + EC.message() + "'");
|
||||
ErrorOr<std::unique_ptr<ObjectFile>> MaybeObj(
|
||||
ObjectFile::createObjectFile((*InputBuffer)->getMemBufferRef()));
|
||||
|
||||
if (std::error_code EC = MaybeObj.getError())
|
||||
return Error("unable to create object file: '" + EC.message() + "'");
|
||||
|
||||
ObjectFile &Obj = **MaybeObj;
|
||||
|
||||
std::unique_ptr<ObjectImage> LoadedObject;
|
||||
// Load the object file
|
||||
Dyld.loadObject(Obj);
|
||||
if (Dyld.hasError()) {
|
||||
LoadedObject = Dyld.loadObject(
|
||||
llvm::make_unique<ObjectBuffer>(std::move(*InputBuffer)));
|
||||
if (!LoadedObject) {
|
||||
return Error(Dyld.getErrorString());
|
||||
}
|
||||
}
|
||||
@ -525,21 +512,14 @@ static int linkAndVerify() {
|
||||
// Load the input memory buffer.
|
||||
ErrorOr<std::unique_ptr<MemoryBuffer>> InputBuffer =
|
||||
MemoryBuffer::getFileOrSTDIN(InputFileList[i]);
|
||||
|
||||
if (std::error_code EC = InputBuffer.getError())
|
||||
return Error("unable to read input: '" + EC.message() + "'");
|
||||
|
||||
ErrorOr<std::unique_ptr<ObjectFile>> MaybeObj(
|
||||
ObjectFile::createObjectFile((*InputBuffer)->getMemBufferRef()));
|
||||
|
||||
if (std::error_code EC = MaybeObj.getError())
|
||||
return Error("unable to create object file: '" + EC.message() + "'");
|
||||
|
||||
ObjectFile &Obj = **MaybeObj;
|
||||
|
||||
std::unique_ptr<ObjectImage> LoadedObject;
|
||||
// Load the object file
|
||||
Dyld.loadObject(Obj);
|
||||
if (Dyld.hasError()) {
|
||||
LoadedObject = Dyld.loadObject(
|
||||
llvm::make_unique<ObjectBuffer>(std::move(*InputBuffer)));
|
||||
if (!LoadedObject) {
|
||||
return Error(Dyld.getErrorString());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user