mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Initial modifications to MCAssembler and TargetMachine for the MCJIT.
Patch by Olivier Meurant! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109080 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -647,7 +647,7 @@ void MCAssembler::WriteSectionData(const MCSectionData *SD,
|
||||
assert(OW->getStream().tell() - Start == Layout.getSectionFileSize(SD));
|
||||
}
|
||||
|
||||
void MCAssembler::Finish() {
|
||||
void MCAssembler::Finish(MCObjectWriter *Writer) {
|
||||
DEBUG_WITH_TYPE("mc-dump", {
|
||||
llvm::errs() << "assembler backend - pre-layout\n--\n";
|
||||
dump(); });
|
||||
@@ -717,9 +717,15 @@ void MCAssembler::Finish() {
|
||||
dump(); });
|
||||
|
||||
uint64_t StartOffset = OS.tell();
|
||||
llvm::OwningPtr<MCObjectWriter> Writer(getBackend().createObjectWriter(OS));
|
||||
if (!Writer)
|
||||
report_fatal_error("unable to create object writer!");
|
||||
|
||||
llvm::OwningPtr<MCObjectWriter> OwnWriter(0);
|
||||
if (Writer == 0) {
|
||||
//no custom Writer_ : create the default one life-managed by OwningPtr
|
||||
OwnWriter.reset(getBackend().createObjectWriter(OS));
|
||||
Writer = OwnWriter.get();
|
||||
if (!Writer)
|
||||
report_fatal_error("unable to create object writer!");
|
||||
}
|
||||
|
||||
// Allow the object writer a chance to perform post-layout binding (for
|
||||
// example, to set the index fields in the symbol data).
|
||||
|
Reference in New Issue
Block a user